File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
web/skins/classic/views/js Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1439,19 +1439,27 @@ function monitorsSetScale(id=null) {
14391439// Kick everything off
14401440$j ( window ) . on ( "load" , initPage ) ;
14411441
1442+ var prevStateStarted = false ;
14421443document . onvisibilitychange = ( ) => {
14431444 // Always clear it because the return to visibility might happen before timeout
14441445 TimerHideShow = clearTimeout ( TimerHideShow ) ;
14451446 if ( document . visibilityState === "hidden" ) {
14461447 TimerHideShow = setTimeout ( function ( ) {
14471448 //Stop monitor when closing or hiding page
14481449 if ( monitorStream ) {
1449- monitorStream . kill ( ) ;
1450+ if ( monitorStream . started ) {
1451+ prevStateStarted = 'played' ;
1452+ //Stop only if playing or paused.
1453+ monitorStream . kill ( ) ;
1454+ } else {
1455+ prevStateStarted = false ;
1456+ }
14501457 }
14511458 } , 15 * 1000 ) ;
14521459 } else {
14531460 //Start monitor when show page
1454- if ( monitorStream && ! monitorStream . started && ( idle < ZM_WEB_VIEWING_TIMEOUT ) ) {
1461+ if ( monitorStream && prevStateStarted == 'played' && ( idle < ZM_WEB_VIEWING_TIMEOUT ) ) {
1462+ onPlay ( ) ; //Set the correct state of the player buttons.
14551463 monitorStream . start ( ) ;
14561464 }
14571465 }
You can’t perform that action at this time.
0 commit comments