clean out unused variables and don't scale the popup window. The contents of it won't be scaled.
This commit is contained in:
parent
bfa46e26ee
commit
d5d48bef8a
|
@ -27,23 +27,19 @@ if ( !canView( 'Stream' ) )
|
||||||
require_once( 'includes/Monitor.php' );
|
require_once( 'includes/Monitor.php' );
|
||||||
|
|
||||||
$groupSql = "";
|
$groupSql = "";
|
||||||
if ( !empty($_REQUEST['group']) )
|
if ( !empty($_REQUEST['group']) ) {
|
||||||
{
|
|
||||||
$row = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_REQUEST['group']) );
|
$row = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_REQUEST['group']) );
|
||||||
$sql = "select * from Monitors where Function != 'None' and find_in_set( Id, '".$row['MonitorIds']."' ) order by Sequence";
|
$sql = "select * from Monitors where Function != 'None' and find_in_set( Id, '".$row['MonitorIds']."' ) order by Sequence";
|
||||||
} else {
|
} else {
|
||||||
$sql = "select * from Monitors where Function != 'None' order by Sequence";
|
$sql = "select * from Monitors where Function != 'None' order by Sequence";
|
||||||
}
|
}
|
||||||
|
|
||||||
$maxWidth = 0;
|
|
||||||
$maxHeight = 0;
|
|
||||||
$showControl = false;
|
$showControl = false;
|
||||||
$index = 0;
|
|
||||||
$monitors = array();
|
$monitors = array();
|
||||||
foreach( dbFetchAll( $sql ) as $row )
|
|
||||||
{
|
|
||||||
if ( !visibleMonitor( $row['Id'] ) )
|
foreach( dbFetchAll( $sql ) as $row ) {
|
||||||
{
|
if ( !visibleMonitor( $row['Id'] ) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,17 +50,11 @@ foreach( dbFetchAll( $sql ) as $row )
|
||||||
else
|
else
|
||||||
$scale = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
$scale = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||||
|
|
||||||
$scaleWidth = reScale( $row['Width'], $scale );
|
$row['Scale'] = $scale;
|
||||||
$scaleHeight = reScale( $row['Height'], $scale );
|
$row['PopupScale'] = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||||
if ( $maxWidth < $scaleWidth )
|
|
||||||
$maxWidth = $scaleWidth;
|
|
||||||
if ( $maxHeight < $scaleHeight )
|
|
||||||
$maxHeight = $scaleHeight;
|
|
||||||
if ( ZM_OPT_CONTROL && $row['ControlId'] )
|
if ( ZM_OPT_CONTROL && $row['ControlId'] )
|
||||||
$showControl = true;
|
$showControl = true;
|
||||||
$row['index'] = $index++;
|
|
||||||
$row['scaleWidth'] = $scaleWidth;
|
|
||||||
$row['scaleHeight'] = $scaleHeight;
|
|
||||||
$row['connKey'] = generateConnKey();
|
$row['connKey'] = generateConnKey();
|
||||||
$monitors[] = new Monitor( $row );
|
$monitors[] = new Monitor( $row );
|
||||||
}
|
}
|
||||||
|
@ -110,37 +100,17 @@ if ( $showControl )
|
||||||
foreach ( $monitors as $monitor )
|
foreach ( $monitors as $monitor )
|
||||||
{
|
{
|
||||||
$connkey = $monitor->connKey(); // Minor hack
|
$connkey = $monitor->connKey(); // Minor hack
|
||||||
if ( !isset( $scale ) )
|
|
||||||
$scale = reScale( SCALE_BASE, $monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE );
|
|
||||||
?>
|
|
||||||
<div id="monitorFrame<?php echo $monitor->index() ?>" class="monitorFrame" title="<?php echo $monitor->Name() ?>">
|
|
||||||
<div id="monitor<?php echo $monitor->index() ?>" class="monitor idle">
|
|
||||||
<div id="imageFeed<?php echo $monitor->index() ?>" class="imageFeed" onclick="createPopup( '?view=watch&mid=<?php echo $monitor->Id() ?>', 'zmWatch<?php echo $monitor->Id() ?>', 'watch', <?php echo $monitor->scaleWidth() ?>, <?php echo $monitor->scaleHeight() ?> );">
|
|
||||||
<?php
|
|
||||||
if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
|
|
||||||
{
|
|
||||||
$streamSrc = $monitor->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 = $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()) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outputHelperStream( "liveStream".$monitor->Id(), $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
<div id="monitorFrame<?php echo $monitor->Id() ?>" class="monitorFrame" title="<?php echo $monitor->Name() ?>">
|
||||||
|
<div id="monitor<?php echo $monitor->Id() ?>" class="monitor idle">
|
||||||
|
<div id="imageFeed<?php echo $monitor->Id() ?>" class="imageFeed" onclick="createPopup( '?view=watch&mid=<?php echo $monitor->Id() ?>', 'zmWatch<?php echo $monitor->Id() ?>', 'watch', <?php echo reScale( $monitor->Width(), $monitor->PopupScale() ); ?>, <?php echo reScale( $monitor->Height(), $monitor->PopupScale() ); ?> );">
|
||||||
|
<?php echo getStreamHTML( $monitor, $monitor->Scale() ); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if ( !ZM_WEB_COMPACT_MONTAGE )
|
if ( !ZM_WEB_COMPACT_MONTAGE )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div id="monitorState<?php echo $monitor->index() ?>" class="monitorState idle"><?php echo translate('State') ?>: <span id="stateValue<?php echo $monitor->index() ?>"></span> - <span id="fpsValue<?php echo $monitor->index() ?>"></span> fps</div>
|
<div id="monitorState<?php echo $monitor->Id() ?>" class="monitorState idle"><?php echo translate('State') ?>: <span id="stateValue<?php echo $monitor->Id() ?>"></span> - <span id="fpsValue<?php echo $monitor->Id() ?>"></span> fps</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue