2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web watch feed view file, $Date$, $Revision$
|
2008-07-25 17:48:16 +08:00
|
|
|
// Copyright (C) 2001-2008 Philip Coombes
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
|
2015-09-18 03:35:38 +08:00
|
|
|
require_once('includes/Monitor.php');
|
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
if ( !canView( 'Stream' ) )
|
|
|
|
{
|
2008-09-26 17:47:20 +08:00
|
|
|
$view = "error";
|
2008-07-14 21:54:50 +08:00
|
|
|
return;
|
|
|
|
}
|
2015-12-02 03:30:24 +08:00
|
|
|
|
|
|
|
// This is for input sanitation
|
|
|
|
$mid = intval( $_REQUEST['mid'] );
|
|
|
|
if ( ! visibleMonitor( $mid ) ) {
|
2014-12-12 22:32:03 +08:00
|
|
|
$view = "error";
|
|
|
|
return;
|
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2015-12-02 03:30:24 +08:00
|
|
|
$monitor = new Monitor( $mid );
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2015-12-02 03:30:24 +08:00
|
|
|
$showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable() && canView( 'Control' ) );
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( isset( $_REQUEST['scale'] ) )
|
|
|
|
$scale = validInt($_REQUEST['scale']);
|
|
|
|
else
|
2015-09-18 03:35:38 +08:00
|
|
|
$scale = reScale( SCALE_BASE, $monitor->DefaultScale, ZM_WEB_DEFAULT_SCALE );
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
$connkey = generateConnKey();
|
|
|
|
|
2010-11-04 00:40:33 +08:00
|
|
|
if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
$streamMode = "mpeg";
|
2015-09-18 03:35:38 +08:00
|
|
|
$streamSrc = $monitor->getStreamSrc( array( "mode=".$streamMode, "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
elseif ( canStream() )
|
|
|
|
{
|
|
|
|
$streamMode = "jpeg";
|
2015-12-02 03:30:24 +08:00
|
|
|
$streamSrc = $monitor->getStreamSrc( array( "mode=".$streamMode, "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "buffer=".$monitor->StreamReplayBuffer() ) );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$streamMode = "single";
|
2015-09-18 03:35:38 +08:00
|
|
|
$streamSrc = $monitor->getStreamSrc( array( "mode=".$streamMode, "scale=".$scale ) );
|
2013-09-22 03:00:50 +08:00
|
|
|
Info( "The system has fallen back to single jpeg mode for streaming. Consider enabling Cambozola or upgrading the client browser.");
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2015-09-18 03:35:38 +08:00
|
|
|
$showDvrControls = ( $streamMode == 'jpeg' && $monitor->StreamReplayBuffer() != 0 );
|
2008-12-06 02:46:32 +08:00
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
noCacheHeaders();
|
|
|
|
|
2015-09-18 03:35:38 +08:00
|
|
|
xhtmlHeaders( __FILE__, $monitor->Name()." - ".translate('Feed') );
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
|
|
|
<div id="content">
|
|
|
|
<div id="menuBar">
|
2015-09-18 03:35:38 +08:00
|
|
|
<div id="monitorName"><?php echo $monitor->Name() ?></div>
|
2015-05-10 21:10:30 +08:00
|
|
|
<div id="closeControl"><a href="#" onclick="closeWindow(); return( false );"><?php echo translate('Close') ?></a></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<div id="menuControls">
|
|
|
|
<?php
|
2015-09-18 03:35:38 +08:00
|
|
|
if ( canView( 'Control' ) && $monitor->Type() == "Local" )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
|
|
|
?>
|
2015-12-02 03:30:24 +08:00
|
|
|
<div id="settingsControl"><?php echo makePopupLink( '?view=settings&mid='.$monitor->Id(), 'zmSettings'.$monitor->Id(), 'settings', translate('Settings'), true, 'id="settingsLink"' ) ?></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<div id="scaleControl"><?php echo translate('Scale') ?>: <?php echo buildSelect( "scale", $scales, "changeScale( this );" ); ?></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="imageFeed">
|
|
|
|
<?php
|
2010-11-04 00:40:33 +08:00
|
|
|
if ( $streamMode == "mpeg" )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
2015-12-02 03:30:24 +08:00
|
|
|
outputVideoStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), ZM_MPEG_LIVE_FORMAT, $monitor->Name() );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
elseif ( $streamMode == "jpeg" )
|
|
|
|
{
|
|
|
|
if ( canStreamNative() )
|
2015-12-02 03:30:24 +08:00
|
|
|
outputImageStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() );
|
2008-07-16 23:56:48 +08:00
|
|
|
elseif ( canStreamApplet() )
|
2015-12-02 03:30:24 +08:00
|
|
|
outputHelperStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-12-02 03:30:24 +08:00
|
|
|
outputImageStill( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() );
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div id="monitorStatus">
|
|
|
|
<?php
|
|
|
|
if ( canEdit( 'Monitors' ) )
|
|
|
|
{
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<div id="enableDisableAlarms"><a id="enableAlarmsLink" href="#" onclick="cmdEnableAlarms(); return( false );" class="hidden"><?php echo translate('EnableAlarms') ?></a><a id="disableAlarmsLink" href="#" onclick="cmdDisableAlarms(); return( false );" class="hidden"><?php echo translate('DisableAlarms') ?></a></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ( canEdit( 'Monitors' ) )
|
|
|
|
{
|
|
|
|
?>
|
2016-04-17 21:29:14 +08:00
|
|
|
<div id="forceCancelAlarm">
|
|
|
|
<a id="forceAlarmLink" href="#" onclick="cmdForceAlarm();"><?php echo translate('ForceAlarm') ?></a>
|
|
|
|
<a id="cancelAlarmLink" href="#" onclick="cmdCancelForcedAlarm();" class="hidden"><?php echo translate('CancelForcedAlarm') ?></a>
|
|
|
|
</div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2015-05-10 21:10:30 +08:00
|
|
|
<div id="monitorState"><?php echo translate('State') ?>: <span id="stateValue"></span> - <span id="fpsValue"></span> fps</div>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
2014-12-05 07:44:23 +08:00
|
|
|
<div id="dvrControls"<?php echo $showDvrControls?'':' class="hidden"' ?>>
|
2015-05-10 21:10:30 +08:00
|
|
|
<input type="button" value="<<" id="fastRevBtn" title="<?php echo translate('Rewind') ?>" class="unavail" disabled="disabled" onclick="streamCmdFastRev( true )"/>
|
|
|
|
<input type="button" value="<" id="slowRevBtn" title="<?php echo translate('StepBack') ?>" class="unavail" disabled="disabled" onclick="streamCmdSlowRev( true )"/>
|
|
|
|
<input type="button" value="||" id="pauseBtn" title="<?php echo translate('Pause') ?>" class="inactive" onclick="streamCmdPause( true )"/>
|
|
|
|
<input type="button" value="[]" id="stopBtn" title="<?php echo translate('Stop') ?>" class="unavail" disabled="disabled" onclick="streamCmdStop( true )"/>
|
|
|
|
<input type="button" value="|>" id="playBtn" title="<?php echo translate('Play') ?>" class="active" disabled="disabled" onclick="streamCmdPlay( true )"/>
|
|
|
|
<input type="button" value=">" id="slowFwdBtn" title="<?php echo translate('StepForward') ?>" class="unavail" disabled="disabled" onclick="streamCmdSlowFwd( true )"/>
|
|
|
|
<input type="button" value=">>" id="fastFwdBtn" title="<?php echo translate('FastForward') ?>" class="unavail" disabled="disabled" onclick="streamCmdFastFwd( true )"/>
|
|
|
|
<input type="button" value="–" id="zoomOutBtn" title="<?php echo translate('ZoomOut') ?>" class="avail" onclick="streamCmdZoomOut()"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
2014-12-05 07:44:23 +08:00
|
|
|
<div id="replayStatus"<?php echo $streamMode=="single"?' class="hidden"':'' ?>>
|
2015-05-10 21:10:30 +08:00
|
|
|
<span id="mode"><?php echo translate('Mode') ?>: <span id="modeValue"></span></span>
|
|
|
|
<span id="rate"><?php echo translate('Rate') ?>: <span id="rateValue"></span>x</span>
|
|
|
|
<span id="delay"><?php echo translate('Delay') ?>: <span id="delayValue"></span>s</span>
|
|
|
|
<span id="level"><?php echo translate('Buffer') ?>: <span id="levelValue"></span>%</span>
|
|
|
|
<span id="zoom"><?php echo translate('Zoom') ?>: <span id="zoomValue"></span>x</span>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
<?php
|
2008-12-06 02:46:32 +08:00
|
|
|
if ( $showPtzControls )
|
2008-07-14 21:54:50 +08:00
|
|
|
{
|
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
|
|
|
?>
|
2016-04-04 23:39:12 +08:00
|
|
|
<div id="ptzControls" class="ptzControls">
|
2014-12-05 07:44:23 +08:00
|
|
|
<?php echo ptzControls( $monitor ) ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ( canView( 'Events' ) )
|
|
|
|
{
|
|
|
|
?>
|
2016-04-04 23:39:12 +08:00
|
|
|
<div id="events">
|
2008-07-14 21:54:50 +08:00
|
|
|
<table id="eventList" cellspacing="0">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colId"><?php echo translate('Id') ?></th>
|
|
|
|
<th class="colName"><?php echo translate('Name') ?></th>
|
|
|
|
<th class="colTime"><?php echo translate('Time') ?></th>
|
|
|
|
<th class="colSecs"><?php echo translate('Secs') ?></th>
|
|
|
|
<th class="colFrames"><?php echo translate('Frames') ?></th>
|
|
|
|
<th class="colScore"><?php echo translate('Score') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
<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">
|
2014-12-05 07:44:23 +08:00
|
|
|
<param name="FileName" value="<?php echo $soundSrc ?>"/>
|
2009-05-26 02:03:46 +08:00
|
|
|
<param name="autoStart" value="0"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<param name="loop" value="1"/>
|
2009-10-17 01:09:16 +08:00
|
|
|
<param name="hidden" value="1"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<param name="showControls" value="0"/>
|
2014-12-05 07:44:23 +08:00
|
|
|
<embed src="<?php echo $soundSrc ?>"
|
2008-07-14 21:54:50 +08:00
|
|
|
autostart="true"
|
|
|
|
loop="true"
|
|
|
|
hidden="true">
|
|
|
|
</embed>
|
|
|
|
</object>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<embed src="<?php echo $soundSrc ?>"
|
2008-07-14 21:54:50 +08:00
|
|
|
autostart="true"
|
|
|
|
loop="true"
|
|
|
|
hidden="true">
|
|
|
|
</embed>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|