From 0e2b7d1b522a67e0bb7e8eeed9161ccc872baf74 Mon Sep 17 00:00:00 2001 From: digital-gnome <31593470+digital-gnome@users.noreply.github.com> Date: Fri, 29 Sep 2017 21:52:52 -0400 Subject: [PATCH] End of video logic --- web/skins/classic/views/event.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php index 25951fa23..a67a564df 100644 --- a/web/skins/classic/views/event.php +++ b/web/skins/classic/views/event.php @@ -167,6 +167,37 @@ if ( $Event->DefaultVideo() ) { var duration = Length() ?>, startTime = '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': + + var gapDuration = (new Date().getTime()) + (nextEventStartTime.getTime() - 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; + } + }); + });