diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php index d3a185f33..d90ce4fda 100644 --- a/web/skins/classic/views/event.php +++ b/web/skins/classic/views/event.php @@ -41,10 +41,14 @@ if ( isset( $_REQUEST['rate'] ) ) $rate = validInt($_REQUEST['rate']); else $rate = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE ); -if ( isset( $_REQUEST['scale'] ) ) - $scale = validInt($_REQUEST['scale']); -else - $scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + +if ( isset( $_REQUEST['scale'] ) ) { + $scale = validInt($_REQUEST['scale']); +} else if ( isset( $_COOKIE['zmEventScale'.$event['MonitorId']] ) ) { + $scale = $_COOKIE['zmEventScale'.$event['MonitorId']]; +} else { + $scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); +} $replayModes = array( 'single' => translate('ReplaySingle'), diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index a1b2a2e55..e1553e6e5 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -13,6 +13,7 @@ function changeScale() var newHeight = ( baseHeight * scale ) / SCALE_BASE; streamScale( scale ); + Cookie.write( 'zmEventScale'+eventData.MonitorId, scale, { duration: 10*365 } ); /*Stream could be an applet so can't use moo tools*/ var streamImg = document.getElementById('evtStream'); diff --git a/web/skins/classic/views/js/event.js.php b/web/skins/classic/views/js/event.js.php index 7415e2c72..00c5ab4c6 100644 --- a/web/skins/classic/views/js/event.js.php +++ b/web/skins/classic/views/js/event.js.php @@ -27,6 +27,7 @@ var connKey = ''; var eventData = { Id: , + MonitorId: , Width: , Height: , Length: diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 264a4b65f..b38749c9c 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -32,8 +32,7 @@ function changeScale() var newWidth = ( monitorWidth * scale ) / SCALE_BASE; var newHeight = ( monitorHeight * scale ) / SCALE_BASE; - // This causes FF3 to kill the stream now, ok with FF2 - //streamCmdScale( scale ); + Cookie.write( 'zmWatchScale'+monitorId, scale, { duration: 10*365 } ); /*Stream could be an applet so can't use moo tools*/ var streamImg = document.getElementById('liveStream'); diff --git a/web/skins/classic/views/watch.php b/web/skins/classic/views/watch.php index 102ae41ac..492ed5b29 100644 --- a/web/skins/classic/views/watch.php +++ b/web/skins/classic/views/watch.php @@ -44,10 +44,13 @@ else $showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable() && canView( 'Control' ) ); -if ( isset( $_REQUEST['scale'] ) ) - $scale = validInt($_REQUEST['scale']); -else - $scale = reScale( SCALE_BASE, $monitor->DefaultScale, ZM_WEB_DEFAULT_SCALE ); +if ( isset( $_REQUEST['scale'] ) ) { + $scale = validInt($_REQUEST['scale']); +} else if ( isset( $_COOKIE['zmWatchScale'.$mid] ) ) { + $scale = $_COOKIE['zmWatchScale'.$mid]; +} else { + $scale = reScale( SCALE_BASE, $monitor->DefaultScale, ZM_WEB_DEFAULT_SCALE ); +} $connkey = generateConnKey();