2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web watch feed view file, $Date$, $Revision$
|
|
|
|
// Copyright (C) 2003, 2004, 2005, 2006 Philip Coombes
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
if ( !canView( 'Stream' ) )
|
|
|
|
{
|
|
|
|
$_REQUEST['view'] = "error";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$sql = "select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id = '".$_REQUEST['mid']."'";
|
|
|
|
$monitor = dbFetchOne( $sql );
|
|
|
|
|
|
|
|
if ( !isset($_REQUEST['control']) )
|
|
|
|
$_REQUEST['control'] = (canView( 'Control' ) && ($monitor['DefaultView'] == 'Control'));
|
|
|
|
|
|
|
|
$showControls = ( ZM_OPT_CONTROL && $monitor['Controllable'] && canView( 'Control' ) );
|
|
|
|
|
|
|
|
if ( !isset( $_REQUEST['scale'] ) )
|
|
|
|
$_REQUEST['scale'] = reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
|
|
|
|
|
|
|
$connkey = generateConnKey();
|
|
|
|
|
|
|
|
if ( ZM_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
|
|
|
|
{
|
|
|
|
$streamMode = "mpeg";
|
|
|
|
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$_REQUEST['scale'], "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) );
|
|
|
|
}
|
|
|
|
elseif ( canStream() )
|
|
|
|
{
|
|
|
|
$streamMode = "jpeg";
|
|
|
|
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$_REQUEST['scale'], "maxfps=".ZM_WEB_VIDEO_MAXFPS ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$streamMode = "single";
|
|
|
|
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$_REQUEST['scale'] ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
noCacheHeaders();
|
|
|
|
|
|
|
|
xhtmlHeaders( __FILE__, $monitor['Name']." - ".$SLANG['Feed'] );
|
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
|
|
|
<div id="content">
|
|
|
|
<div id="menuBar">
|
|
|
|
<div id="monitorName"><?= $monitor['Name'] ?></div>
|
|
|
|
<div id="closeControl"><a href="#" onclick="closeWindow(); return( false );"><?= $SLANG['Close'] ?></a></div>
|
|
|
|
<div id="menuControls">
|
|
|
|
<?php
|
|
|
|
if ( $showControls )
|
|
|
|
{
|
|
|
|
if ( canView( 'Control' ) )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<div id="controlControl"<?= $_REQUEST['control']?' class="hidden"':'' ?>><a id="controlLink" href="#" onclick="showControls(); return( false );"><?= $SLANG['Control'] ?></a></div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ( canView( 'Events' ) )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<div id="eventsControl"<?= $_REQUEST['control']?'':' class="hidden"' ?>><a id="eventsLink" href="#" onclick="showEvents(); return( false );"><?= $SLANG['Events'] ?></a></div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<?php
|
|
|
|
if ( canView( 'Control' ) && $monitor['Type'] == "Local" )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<div id="settingsControl"><?= makePopupLink( '?view=settings&mid='.$monitor['Id'], 'zmSettings'.$monitor['Id'], 'settings', $SLANG['Settings'], true, 'id="settingsLink"' ) ?></div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<div id="scaleControl"><?= $SLANG['Scale'] ?>: <?= buildSelect( "scale", $scales, "changeScale( this );" ); ?></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="imageFeed">
|
|
|
|
<?php
|
|
|
|
if ( $streamMode === "mpeg" )
|
|
|
|
{
|
|
|
|
outputVideoStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $_REQUEST['scale'] ), reScale( $monitor['Height'], $_REQUEST['scale'] ), ZM_MPEG_LIVE_FORMAT, $monitor['Name'] );
|
|
|
|
}
|
|
|
|
elseif ( $streamMode == "jpeg" )
|
|
|
|
{
|
|
|
|
if ( canStreamNative() )
|
|
|
|
outputImageStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $_REQUEST['scale'] ), reScale( $monitor['Height'], $_REQUEST['scale'] ), $monitor['Name'] );
|
2008-07-16 23:56:48 +08:00
|
|
|
elseif ( canStreamApplet() )
|
2008-07-14 21:54:50 +08:00
|
|
|
outputHelperStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $_REQUEST['scale'] ), reScale( $monitor['Height'], $_REQUEST['scale'] ), $monitor['Name'] );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
outputImageStill( "liveStream", $streamSrc, reScale( $monitor['Width'], $_REQUEST['scale'] ), reScale( $monitor['Height'], $_REQUEST['scale'] ), $monitor['Name'] );
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div id="monitorStatus">
|
|
|
|
<?php
|
|
|
|
if ( canEdit( 'Monitors' ) )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<div id="enableDisableAlarms"><a id="enableAlarmsLink" href="#" onclick="cmdEnableAlarms(); return( false );" class="hidden"><?= $SLANG['EnableAlarms'] ?></a><a id="disableAlarmsLink" href="#" onclick="cmdDisableAlarms(); return( false );" class="hidden"><?= $SLANG['DisableAlarms'] ?></a></div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ( canEdit( 'Monitors' ) )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<div id="forceCancelAlarm"><a id="forceAlarmLink" href="#" onclick="cmdForceAlarm()" class="hidden"><?= $SLANG['ForceAlarm'] ?></a><a id="cancelAlarmLink" href="#" onclick="cmdCancelForcedAlarm()" class="hidden"><?= $SLANG['CancelForcedAlarm'] ?></a></div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<div id="monitorState"><?= $SLANG['State'] ?>: <span id="stateValue"></span> - <span id="fpsValue"></span> fps</div>
|
|
|
|
</div>
|
2008-07-16 23:47:33 +08:00
|
|
|
<div id="dvrControls"<?= $streamMode=="single"?' class="hidden"':'' ?>>
|
2008-07-14 21:54:50 +08:00
|
|
|
<input type="button" value="<<" id="fastRevBtn" title="<?= $SLANG['Rewind'] ?>" class="unavail" disabled="disabled" onclick="streamCmdFastRev( true )"/>
|
|
|
|
<input type="button" value="<" id="slowRevBtn" title="<?= $SLANG['StepBack'] ?>" class="unavail" disabled="disabled" onclick="streamCmdSlowRev( true )"/>
|
|
|
|
<input type="button" value="||" id="pauseBtn" title="<?= $SLANG['Pause'] ?>" class="inactive" onclick="streamCmdPause( true )"/>
|
|
|
|
<input type="button" value="[]" id="stopBtn" title="<?= $SLANG['Stop'] ?>" class="unavail" disabled="disabled" onclick="streamCmdStop( true )"/>
|
|
|
|
<input type="button" value="|>" id="playBtn" title="<?= $SLANG['Play'] ?>" class="active" disabled="disabled" onclick="streamCmdPlay( true )"/>
|
|
|
|
<input type="button" value=">" id="slowFwdBtn" title="<?= $SLANG['StepForward'] ?>" class="unavail" disabled="disabled" onclick="streamCmdSlowFwd( true )"/>
|
|
|
|
<input type="button" value=">>" id="fastFwdBtn" title="<?= $SLANG['FastForward'] ?>" class="unavail" disabled="disabled" onclick="streamCmdFastFwd( true )"/>
|
|
|
|
<input type="button" value="–" id="zoomOutBtn" title="<?= $SLANG['ZoomOut'] ?>" class="avail" onclick="streamCmdZoomOut()"/>
|
|
|
|
</div>
|
2008-07-16 23:47:33 +08:00
|
|
|
<div id="replayStatus"<?= $streamMode=="single"?' class="hidden"':'' ?>>
|
2008-07-14 21:54:50 +08:00
|
|
|
<span id="mode">Mode: <span id="modeValue"></span></span>
|
|
|
|
<span id="rate">Rate: <span id="rateValue"></span>x</span>
|
|
|
|
<span id="delay">Delay: <span id="delayValue"></span>s</span>
|
|
|
|
<span id="level">Buffer: <span id="levelValue"></span>%</span>
|
|
|
|
<span id="zoom">Zoom: <span id="zoomValue"></span>x</span>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
if ( $showControls )
|
|
|
|
{
|
2008-07-23 00:24:36 +08:00
|
|
|
foreach ( getSkinIncludes( 'includes/control_functions.php' ) as $includeFile )
|
|
|
|
require_once $includeFile;
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2008-07-16 21:16:19 +08:00
|
|
|
<div id="ptzControls" class="ptzControls<?= $_REQUEST['control']?'':' hidden' ?>">
|
|
|
|
<?= ptzControls( $monitor ) ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ( canView( 'Events' ) )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<div id="events"<?= $_REQUEST['control']?' class="hidden"':'' ?>>
|
|
|
|
<table id="eventList" cellspacing="0">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="colId"><?= $SLANG['Id'] ?></th>
|
|
|
|
<th class="colName"><?= $SLANG['Name'] ?></th>
|
|
|
|
<th class="colTime"><?= $SLANG['Time'] ?></th>
|
|
|
|
<th class="colSecs"><?= $SLANG['Secs'] ?></th>
|
|
|
|
<th class="colFrames"><?= $SLANG['Frames'] ?></th>
|
|
|
|
<th class="colScore"><?= $SLANG['Score'] ?></th>
|
|
|
|
<th class="colDelete"> </th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ( ZM_WEB_SOUND_ON_ALARM )
|
|
|
|
{
|
|
|
|
$soundSrc = ZM_DIR_SOUNDS.'/'.ZM_WEB_ALARM_SOUND;
|
|
|
|
?>
|
|
|
|
<div id="alarmSound" class="hidden">
|
|
|
|
<?php
|
|
|
|
if ( ZM_WEB_USE_OBJECT_TAGS && isWindows() )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<object id="MediaPlayer" width="0" height="0"
|
|
|
|
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
|
|
|
|
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902">
|
|
|
|
<param name="FileName" value="<?= $soundSrc ?>"/>
|
|
|
|
<param name="autoStart" value="1"/>
|
|
|
|
<param name="loop" value="1"/>
|
|
|
|
<param name=hidden value="1"/>
|
|
|
|
<param name="showControls" value="0"/>
|
|
|
|
<embed src="<?= $soundSrc ?>"
|
|
|
|
autostart="true"
|
|
|
|
loop="true"
|
|
|
|
hidden="true">
|
|
|
|
</embed>
|
|
|
|
</object>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<embed src="<?= $soundSrc ?>"
|
|
|
|
autostart="true"
|
|
|
|
loop="true"
|
|
|
|
hidden="true">
|
|
|
|
</embed>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|