fix video.js not being included when we are viewing an event without an h264 file, and when buttons do not exist.

This commit is contained in:
Isaac Connor 2016-10-27 17:05:33 -04:00
parent 340b172dc4
commit ca69a79bed
3 changed files with 20 additions and 9 deletions

View File

@ -95,7 +95,14 @@ var $j = jQuery.noConflict();
<?php } ?>
<?php if ( $title == 'Login' && (defined('ZM_OPT_USE_GOOG_RECAPTCHA') && ZM_OPT_USE_GOOG_RECAPTCHA) ) { ?>
<script src='https://www.google.com/recaptcha/api.js'></script>
<?php }
<?php } else if ( $title == 'Event' ) {
?>
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
<script src="//vjs.zencdn.net/4.11/video.js"></script>
<script src="./js/videojs.zoomrotate.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<?php
}
if ( $skinJsPhpFile )
{
?>

View File

@ -153,10 +153,6 @@ if ( $Event->DefaultVideo() ) {
</video>
</div>
<!--script>includeVideoJs();</script-->
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
<script src="//vjs.zencdn.net/4.11/video.js"></script>
<script src="./js/videojs.zoomrotate.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<script>
var LabelFormat = "<?php echo validJsStr($Monitor->LabelFormat())?>";
var monitorName = "<?php echo validJsStr($Monitor->Name())?>";

View File

@ -1,3 +1,5 @@
var vid = null;
function setButtonState( element, butClass )
{
if ( element ) {
@ -214,7 +216,9 @@ function getEventResponse( respObj, respText )
return;
eventData = respObj.event;
if ( !$('eventStills').hasClass( 'hidden' ) && currEventId != eventData.Id )
var eventStills = $('eventStills');
if ( eventStills && !$('eventStills').hasClass( 'hidden' ) && currEventId != eventData.Id )
resetEventStills();
currEventId = eventData.Id;
@ -275,8 +279,10 @@ function getNearEventsResponse( respObj, respText )
PrevEventDefVideoPath = respObj.nearevents.PrevEventDefVideoPath;
NextEventDefVideoPath = respObj.nearevents.NextEventDefVideoPath;
$('prevEventBtn').disabled = !prevEventId;
$('nextEventBtn').disabled = !nextEventId;
var prevEventBtn = $('prevEventBtn');
if ( prevEventBtn ) prevEventBtn.disabled = !prevEventId;
var nextEventBtn = $('nextEventBtn');
if ( nextEventBtn ) nextEventBtn.disabled = !nextEventId;
}
var nearEventsReq = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getNearEventsResponse } );
@ -859,7 +865,9 @@ function setupListener()
function initPage() {
//FIXME prevent blocking...not sure what is happening or best way to unblock
vid = videojs("videoobj");
if ( $('videoobj') ) {
vid = videojs("videoobj");
}
if ( vid ) {
/*
setupListener();