replayAll fixes
replayAll now handles end of events gracefully. Fixed bug where back to back continuous events or events that overlap would cause it to try to countdown all of epoch time.
This commit is contained in:
parent
798b4838bd
commit
067f8a8089
|
@ -1,3 +1,11 @@
|
|||
.vjsMessage {
|
||||
font-size: 2em;
|
||||
line-height: 1.5;
|
||||
color: white;
|
||||
background-color: black;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.alarmCue {
|
||||
background-color: #222222;
|
||||
height: 1.5em;
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
.vjsMessage {
|
||||
font-size: 2em;
|
||||
line-height: 1.5;
|
||||
color: white;
|
||||
background-color: black;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.alarmCue {
|
||||
background-color: #222222;
|
||||
height: 1.5em;
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
.vjsMessage {
|
||||
font-size: 2em;
|
||||
line-height: 1.5;
|
||||
color: white;
|
||||
background-color: black;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.alarmCue {
|
||||
background-color: #222222;
|
||||
height: 1.5em;
|
||||
|
|
|
@ -172,10 +172,9 @@ if ( $Event->DefaultVideo() ) {
|
|||
vjsReplay(<?php echo (strtotime($Event->StartTime()) + $Event->Length())*1000 ?>);
|
||||
</script>
|
||||
|
||||
<p id="replayAllCountDown"></p>
|
||||
<p id="dvrControlsVjs" class="dvrControls">
|
||||
<input type="button" value="<+" id="prevBtnVjs" title="<?php echo translate('Prev') ?>" class="inactive" onclick="streamPrev( true );"/>
|
||||
<input type="button" value="+>" id="nextBtnVjs" title="<?php echo translate('Next') ?>" class="inactive" onclick="streamNext( true );"/>
|
||||
<p id="dvrControls" class="dvrControls">
|
||||
<input type="button" value="<+" id="prevBtn" title="<?php echo translate('Prev') ?>" class="inactive" onclick="streamPrev( true );"/>
|
||||
<input type="button" value="+>" id="nextBtn" title="<?php echo translate('Next') ?>" class="inactive" onclick="streamNext( true );"/>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -11,18 +11,27 @@ function vjsReplay(endTime) {
|
|||
player.play();
|
||||
break;
|
||||
case 'all':
|
||||
// nextEventStartTime.getTime() is a mootools workaround, highjacks Date.parse
|
||||
var gapDuration = (new Date().getTime()) + (nextEventStartTime.getTime() - endTime);
|
||||
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 );
|
||||
if (nextEventId == 0) {
|
||||
$j("#videoobj").html('<p class="vjsMessage">No more events</p>');
|
||||
} else {
|
||||
var nextStartTime = nextEventStartTime.getTime(); //nextEventStartTime.getTime() is a mootools workaround, highjacks Date.parse
|
||||
if (nextStartTime <= endTime) {
|
||||
streamNext( true );
|
||||
return;
|
||||
}
|
||||
}, 1000);
|
||||
break;
|
||||
$j("#videoobj").html('<p class="vjsMessage"></p>');
|
||||
var gapDuration = (new Date().getTime()) + (nextStartTime - endTime);
|
||||
var x = setInterval(function() {
|
||||
var now = new Date().getTime();
|
||||
var remainder = new Date(Math.round(gapDuration - now)).toISOString().substr(11,8);
|
||||
$j(".vjsMessage").html(remainder + ' to next event.');
|
||||
if (remainder < 0) {
|
||||
clearInterval(x);
|
||||
streamNext( true );
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
break;
|
||||
case 'gapless':
|
||||
streamNext( true );
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue