add monitorStreamReplayBuffer to javascript vars. Use it to determine whether to update fast forward and reverse buttons

pull/2926/head
Isaac Connor 2020-03-02 12:43:07 -05:00
parent 908e892d48
commit da79f761ad
2 changed files with 58 additions and 38 deletions

View File

@ -260,10 +260,12 @@ function streamCmdPause( action ) {
setButtonState('pauseBtn', 'active');
setButtonState('playBtn', 'inactive');
setButtonState('stopBtn', 'inactive');
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
}
if ( action ) {
streamCmdReq.send(streamCmdParms+"&command="+CMD_PAUSE);
}
@ -274,16 +276,20 @@ function streamCmdPlay( action ) {
setButtonState('playBtn', 'active');
if ( streamStatus.delayed == true ) {
setButtonState('stopBtn', 'inactive');
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
}
} else {
setButtonState('stopBtn', 'unavail');
setButtonState('fastFwdBtn', 'unavail');
setButtonState('slowFwdBtn', 'unavail');
setButtonState('slowRevBtn', 'unavail');
setButtonState('fastRevBtn', 'unavail');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'unavail');
setButtonState('slowFwdBtn', 'unavail');
setButtonState('slowRevBtn', 'unavail');
setButtonState('fastRevBtn', 'unavail');
}
}
if ( action ) {
streamCmdReq.send(streamCmdParms+"&command="+CMD_PLAY);
@ -294,10 +300,12 @@ function streamCmdStop( action ) {
setButtonState('pauseBtn', 'inactive');
setButtonState('playBtn', 'unavail');
setButtonState('stopBtn', 'active');
setButtonState('fastFwdBtn', 'unavail');
setButtonState('slowFwdBtn', 'unavail');
setButtonState('slowRevBtn', 'unavail');
setButtonState('fastRevBtn', 'unavail');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'unavail');
setButtonState('slowFwdBtn', 'unavail');
setButtonState('slowRevBtn', 'unavail');
setButtonState('fastRevBtn', 'unavail');
}
if ( action ) {
streamCmdReq.send(streamCmdParms+"&command="+CMD_STOP);
}
@ -309,10 +317,12 @@ function streamCmdFastFwd( action ) {
setButtonState('pauseBtn', 'inactive');
setButtonState('playBtn', 'inactive');
setButtonState('stopBtn', 'inactive');
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
}
if ( action ) {
streamCmdReq.send(streamCmdParms+"&command="+CMD_FASTFWD);
}
@ -322,40 +332,50 @@ function streamCmdSlowFwd( action ) {
setButtonState('pauseBtn', 'inactive');
setButtonState('playBtn', 'inactive');
setButtonState('stopBtn', 'inactive');
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'active');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'active');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
}
if ( action ) {
streamCmdReq.send(streamCmdParms+"&command="+CMD_SLOWFWD);
}
setButtonState('pauseBtn', 'active');
setButtonState('slowFwdBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('slowFwdBtn', 'inactive');
}
}
function streamCmdSlowRev( action ) {
setButtonState('pauseBtn', 'inactive');
setButtonState('playBtn', 'inactive');
setButtonState('stopBtn', 'inactive');
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'active');
setButtonState('fastRevBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'active');
setButtonState('fastRevBtn', 'inactive');
}
if ( action ) {
streamCmdReq.send(streamCmdParms+"&command="+CMD_SLOWREV);
}
setButtonState('pauseBtn', 'active');
setButtonState('slowRevBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('slowRevBtn', 'inactive');
}
}
function streamCmdFastRev( action ) {
setButtonState('pauseBtn', 'inactive');
setButtonState('playBtn', 'inactive');
setButtonState('stopBtn', 'inactive');
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
if ( monitorStreamReplayBuffer ) {
setButtonState('fastFwdBtn', 'inactive');
setButtonState('slowFwdBtn', 'inactive');
setButtonState('slowRevBtn', 'inactive');
setButtonState('fastRevBtn', 'inactive');
}
if ( action ) {
streamCmdReq.send(streamCmdParms+"&command="+CMD_FASTREV);
}

View File

@ -44,13 +44,13 @@ var showMode = "<?php echo ($showPtzControls && !empty($control))?"control":"eve
var connKey = '<?php echo $connkey ?>';
var maxDisplayEvents = <?php echo 2 * MAX_EVENTS ?>;
var monitorId = <?php echo $monitor->Id() ?>;
var monitorWidth = <?php echo $monitor->ViewWidth() ?>;
var monitorHeight = <?php echo $monitor->ViewHeight() ?>;
var monitorUrl = '<?php echo $monitor->UrlToIndex(); ?>';
var monitorType = '<?php echo ( $monitor->Type() ) ?>';
var monitorRefresh = '<?php echo ( $monitor->Refresh() ) ?>';
var monitorUrl = '<?php echo $monitor->UrlToIndex() ?>';
var monitorType = '<?php echo $monitor->Type() ?>';
var monitorRefresh = '<?php echo $monitor->Refresh() ?>';
var monitorStreamReplayBuffer = <?php echo $monitor->StreamReplayBuffer() ?>;
var scale = '<?php echo $scale ?>';