End of video logic

This commit is contained in:
digital-gnome
2017-09-29 21:52:52 -04:00
parent 5f203fc813
commit 0e2b7d1b52

View File

@@ -167,6 +167,37 @@ if ( $Event->DefaultVideo() ) {
var duration = <?php echo $Event->Length() ?>, startTime = '<?php echo $Event->StartTime() ?>';
addVideoTimingTrack(document.getElementById('videoobj'), LabelFormat, monitorName, duration, startTime);
nearEventsQuery( eventData.Id );
var video = videojs('videoobj').ready(function(){
var player = this;
player.on('ended', function() {
switch(replayMode.value) {
case 'none':
break;
case 'single':
player.play();
break;
case 'all':
<!--nextEventStartTime.getTime() is a mootools workaround, highjacks Date.parse-->
var gapDuration = (new Date().getTime()) + (nextEventStartTime.getTime() - <?php echo (strtotime($Event->StartTime()) + $Event->Length())*1000 ?>);
var x = setInterval(function() {
var now = new Date().getTime();
var remainder = new Date(Math.round(gapDuration - now)).toISOString().substr(11,8);;
$j("#replayAllCountDown").html(remainder + " to next event.");
if (remainder < 0) {
clearInterval(x);
streamNext( true );
}
}, 1000);
break;
case 'gapless':
streamNext( true );
break;
}
});
});
</script>
<?php
} // end if DefaultVideo