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
|
2016-12-26 23:23:16 +08:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
|
2015-09-18 03:35:38 +08:00
|
|
|
require_once('includes/Monitor.php');
|
|
|
|
|
2018-06-26 02:50:54 +08:00
|
|
|
if ( !canView('Stream') ) {
|
2016-09-27 08:09:09 +08:00
|
|
|
$view = 'error';
|
|
|
|
return;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2015-12-02 03:30:24 +08:00
|
|
|
|
2017-11-02 01:08:01 +08:00
|
|
|
if ( ! isset($_REQUEST['mid']) ) {
|
|
|
|
$view = 'error';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-12-02 03:30:24 +08:00
|
|
|
// This is for input sanitation
|
2018-06-26 02:50:54 +08:00
|
|
|
$mid = intval($_REQUEST['mid']);
|
|
|
|
if ( ! visibleMonitor($mid) ) {
|
2016-09-27 22:05:16 +08:00
|
|
|
$view = 'error';
|
|
|
|
return;
|
2014-12-12 22:32:03 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2019-02-22 22:19:07 +08:00
|
|
|
$monitor = new ZM\Monitor($mid);
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2017-05-19 09:48:21 +08:00
|
|
|
#Whether to show the controls button
|
2018-04-27 05:18:36 +08:00
|
|
|
$showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable() && canView('Control') && $monitor->Type() != 'WebSite' );
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2018-06-26 02:50:54 +08:00
|
|
|
if ( isset($_REQUEST['scale']) ) {
|
2016-09-27 21:46:04 +08:00
|
|
|
$scale = validInt($_REQUEST['scale']);
|
2018-06-26 02:50:54 +08:00
|
|
|
} else if ( isset($_COOKIE['zmWatchScale'.$mid]) ) {
|
2016-09-27 21:46:04 +08:00
|
|
|
$scale = $_COOKIE['zmWatchScale'.$mid];
|
|
|
|
} else {
|
2018-06-26 02:50:54 +08:00
|
|
|
$scale = reScale(SCALE_BASE, $monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE);
|
2016-09-27 21:46:04 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
$connkey = generateConnKey();
|
|
|
|
|
2016-06-21 00:40:33 +08:00
|
|
|
$streamMode = getStreamMode();
|
2008-12-06 02:46:32 +08:00
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
noCacheHeaders();
|
|
|
|
|
2017-12-06 05:26:21 +08:00
|
|
|
$popup = ((isset($_REQUEST['popup'])) && ($_REQUEST['popup'] == 1));
|
2017-12-06 01:51:07 +08:00
|
|
|
|
2018-06-26 02:50:54 +08:00
|
|
|
xhtmlHeaders( __FILE__, $monitor->Name().' - '.translate('Feed') );
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
2017-12-06 01:51:07 +08:00
|
|
|
<?php if ( !$popup ) echo getNavBarHTML() ?>
|
2017-12-02 00:29:30 +08:00
|
|
|
<div id="header">
|
2015-09-18 03:35:38 +08:00
|
|
|
<div id="monitorName"><?php echo $monitor->Name() ?></div>
|
2008-07-14 21:54:50 +08:00
|
|
|
<div id="menuControls">
|
|
|
|
<?php
|
2018-07-10 00:33:21 +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
|
|
|
|
}
|
|
|
|
?>
|
2018-09-15 04:20:00 +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>
|
2018-11-30 03:04:35 +08:00
|
|
|
<div id="closeControl"><a href="#" onclick="<?php echo $popup ? 'window.close()' : 'history.go(-1);return false;' ?>"><?php echo $popup ? translate('Close') : translate('Back') ?></a></div>
|
2017-12-02 00:29:30 +08:00
|
|
|
</div>
|
2019-06-28 22:28:53 +08:00
|
|
|
<?php
|
2019-07-08 05:25:49 +08:00
|
|
|
if ( $monitor->Status() != 'Connected' ) {
|
2019-06-28 22:28:53 +08:00
|
|
|
echo '<div class="warning">Monitor is not capturing. We will be unable to provide an image</div>';
|
|
|
|
}
|
|
|
|
?>
|
2017-12-02 00:29:30 +08:00
|
|
|
<div id="content">
|
2019-06-11 22:58:54 +08:00
|
|
|
<div id="imageFeed"
|
|
|
|
<?php
|
|
|
|
if ( $streamMode == 'jpeg' ) {
|
|
|
|
echo 'title="Click to zoom, shift click to pan, ctrl click to zoom out"';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
><?php echo getStreamHTML( $monitor, array('scale'=>$scale) ); ?></div>
|
|
|
|
|
|
|
|
|
2018-04-27 05:18:36 +08:00
|
|
|
<?php if ( $monitor->Type() != 'WebSite' ) { ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<div id="monitorStatus">
|
2018-06-26 02:50:54 +08:00
|
|
|
<?php if ( canEdit('Monitors') ) { ?>
|
|
|
|
<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
|
|
|
|
}
|
2018-06-26 02:50:54 +08:00
|
|
|
if ( canEdit('Monitors') ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-04-17 21:29:14 +08:00
|
|
|
<div id="forceCancelAlarm">
|
2019-01-16 22:59:58 +08:00
|
|
|
<a id="forceAlarmLink" href="#" data-on-click="cmdForceAlarm"><?php echo translate('ForceAlarm') ?></a>
|
|
|
|
<a id="cancelAlarmLink" href="#" data-on-click="cmdCancelForcedAlarm" class="hidden"><?php echo translate('CancelForcedAlarm') ?></a>
|
2016-04-17 21:29:14 +08:00
|
|
|
</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>
|
2018-04-19 00:30:18 +08:00
|
|
|
<div id="dvrControls">
|
|
|
|
<?php
|
|
|
|
if ( $streamMode == 'jpeg' ) {
|
|
|
|
if ( $monitor->StreamReplayBuffer() != 0 ) {
|
|
|
|
?>
|
2019-01-16 22:59:58 +08:00
|
|
|
<input type="button" value="<<" id="fastRevBtn" title="<?php echo translate('Rewind') ?>" class="unavail" disabled="disabled" data-on-click-true="streamCmdFastRev"/>
|
|
|
|
<input type="button" value="<" id="slowRevBtn" title="<?php echo translate('StepBack') ?>" class="unavail" disabled="disabled" data-on-click-true="streamCmdSlowRev"/>
|
2018-04-19 00:30:18 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2019-01-16 22:59:58 +08:00
|
|
|
<input type="button" value="||" id="pauseBtn" title="<?php echo translate('Pause') ?>" class="inactive" data-on-click-true="streamCmdPause"/>
|
|
|
|
<input type="button" value="[]" id="stopBtn" title="<?php echo translate('Stop') ?>" class="unavail" disabled="disabled" data-on-click-true="streamCmdStop"/>
|
|
|
|
<input type="button" value="|>" id="playBtn" title="<?php echo translate('Play') ?>" class="active" disabled="disabled" data-on-click-true="streamCmdPlay"/>
|
2018-04-19 00:30:18 +08:00
|
|
|
<?php
|
|
|
|
if ( $monitor->StreamReplayBuffer() != 0 ) {
|
|
|
|
?>
|
2019-01-16 22:59:58 +08:00
|
|
|
<input type="button" value=">" id="slowFwdBtn" title="<?php echo translate('StepForward') ?>" class="unavail" disabled="disabled" data-on-click-true="streamCmdSlowFwd"/>
|
|
|
|
<input type="button" value=">>" id="fastFwdBtn" title="<?php echo translate('FastForward') ?>" class="unavail" disabled="disabled" data-on-click-true="streamCmdFastFwd"/>
|
2018-04-19 00:30:18 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2019-01-16 22:59:58 +08:00
|
|
|
<input type="button" value="–" id="zoomOutBtn" title="<?php echo translate('ZoomOut') ?>" class="avail" data-on-click="streamCmdZoomOut"/>
|
2018-04-19 00:30:18 +08:00
|
|
|
<?php
|
2018-04-27 05:18:36 +08:00
|
|
|
} // end if streamMode==jpeg
|
2018-04-19 00:30:18 +08:00
|
|
|
?>
|
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>
|
2018-04-27 05:18:36 +08:00
|
|
|
<?php } // end if $monitor->Type() != 'WebSite' ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2016-09-27 22:05:16 +08:00
|
|
|
if ( $showPtzControls ) {
|
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
|
|
|
|
}
|
2019-01-25 22:22:08 +08:00
|
|
|
if ( canView('Events') && ($monitor->Type() != 'WebSite') ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-04-04 23:39:12 +08:00
|
|
|
<div id="events">
|
2019-01-25 22:22:08 +08:00
|
|
|
<table id="eventList">
|
2008-07-14 21:54:50 +08:00
|
|
|
<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
|
|
|
|
}
|
2016-09-27 22:05:16 +08:00
|
|
|
if ( ZM_WEB_SOUND_ON_ALARM ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
$soundSrc = ZM_DIR_SOUNDS.'/'.ZM_WEB_ALARM_SOUND;
|
|
|
|
?>
|
|
|
|
<div id="alarmSound" class="hidden">
|
|
|
|
<?php
|
2016-09-27 22:05:16 +08:00
|
|
|
if ( ZM_WEB_USE_OBJECT_TAGS && isWindows() ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<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
|
2016-09-27 22:05:16 +08:00
|
|
|
} else {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
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>
|