From da79f761ad619702d355dcf116d87700e05ad45f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 2 Mar 2020 12:43:07 -0500 Subject: [PATCH] add monitorStreamReplayBuffer to javascript vars. Use it to determine whether to update fast forward and reverse buttons --- web/skins/classic/views/js/watch.js | 88 +++++++++++++++---------- web/skins/classic/views/js/watch.js.php | 8 +-- 2 files changed, 58 insertions(+), 38 deletions(-) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 7d4ba5e4b..3ecf6f5d6 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -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); } diff --git a/web/skins/classic/views/js/watch.js.php b/web/skins/classic/views/js/watch.js.php index 5e3e3a718..3140c65bc 100644 --- a/web/skins/classic/views/js/watch.js.php +++ b/web/skins/classic/views/js/watch.js.php @@ -44,13 +44,13 @@ var showMode = "'; var maxDisplayEvents = ; - var monitorId = Id() ?>; var monitorWidth = ViewWidth() ?>; var monitorHeight = ViewHeight() ?>; -var monitorUrl = 'UrlToIndex(); ?>'; -var monitorType = 'Type() ) ?>'; -var monitorRefresh = 'Refresh() ) ?>'; +var monitorUrl = 'UrlToIndex() ?>'; +var monitorType = 'Type() ?>'; +var monitorRefresh = 'Refresh() ?>'; +var monitorStreamReplayBuffer = StreamReplayBuffer() ?>; var scale = '';