From 34f6590107a9c14708b0ea8ad491b02cd187bff3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 2 Dec 2015 12:10:26 -0500 Subject: [PATCH] upgrade montage to use Monitor object and getStreamSrc which knows which server to connect to --- web/skins/classic/views/montage.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/web/skins/classic/views/montage.php b/web/skins/classic/views/montage.php index d9f92805a..fc86ad64b 100644 --- a/web/skins/classic/views/montage.php +++ b/web/skins/classic/views/montage.php @@ -24,6 +24,8 @@ if ( !canView( 'Stream' ) ) return; } +require_once( 'includes/Monitor.php' ); + $groupSql = ""; if ( !empty($_REQUEST['group']) ) { @@ -64,7 +66,7 @@ foreach( dbFetchAll( $sql ) as $row ) $row['scaleWidth'] = $scaleWidth; $row['scaleHeight'] = $scaleHeight; $row['connKey'] = generateConnKey(); - $monitors[] = $row; + $monitors[] = new Monitor( $row ); } $focusWindow = true; @@ -107,29 +109,29 @@ if ( $showControl ) connKey(); // Minor hack if ( !isset( $scale ) ) - $scale = reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + $scale = reScale( SCALE_BASE, $monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE ); ?> -
-
-
+
+
+
getStreamSrc( array( "mode=mpeg", "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) ); + outputVideoStream( "liveStream".$monitor->Id(), $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), ZM_MPEG_LIVE_FORMAT ); } else { - $streamSrc = getStreamSrc( array( "mode=jpeg", "monitor=".$monitor['Id'], "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) ); + $streamSrc = $monitor->getStreamSrc( array( "mode=jpeg", "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) ); if ( canStreamNative() ) { - outputImageStream( "liveStream".$monitor['Id'], $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), validHtmlStr($monitor['Name']) ); + outputImageStream( "liveStream".$monitor->Id(), $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), validHtmlStr($monitor->Name()) ); } else { - outputHelperStream( "liveStream".$monitor['Id'], $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ) ); + outputHelperStream( "liveStream".$monitor->Id(), $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ) ); } } ?> @@ -138,7 +140,7 @@ else if ( !ZM_WEB_COMPACT_MONTAGE ) { ?> -
 -  fps
+
 -  fps