2020-08-05 04:36:24 +08:00
|
|
|
<?php
|
2021-12-15 06:05:56 +08:00
|
|
|
global $monitor_index;
|
2021-12-11 04:34:35 +08:00
|
|
|
global $nextMid;
|
|
|
|
global $options;
|
|
|
|
global $monitors;
|
2020-08-05 04:36:24 +08:00
|
|
|
global $streamMode;
|
|
|
|
global $showPtzControls;
|
|
|
|
global $connkey;
|
|
|
|
global $monitor;
|
|
|
|
global $scale;
|
2020-10-03 04:46:28 +08:00
|
|
|
global $labels;
|
2021-12-11 04:34:35 +08:00
|
|
|
global $cycle;
|
2020-08-05 04:36:24 +08:00
|
|
|
?>
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// Import constants
|
|
|
|
//
|
|
|
|
|
2020-10-17 04:47:42 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var CMD_NONE = <?php echo CMD_NONE ?>;
|
|
|
|
var CMD_PAUSE = <?php echo CMD_PAUSE ?>;
|
|
|
|
var CMD_PLAY = <?php echo CMD_PLAY ?>;
|
|
|
|
var CMD_STOP = <?php echo CMD_STOP ?>;
|
|
|
|
var CMD_FASTFWD = <?php echo CMD_FASTFWD ?>;
|
|
|
|
var CMD_SLOWFWD = <?php echo CMD_SLOWFWD ?>;
|
|
|
|
var CMD_SLOWREV = <?php echo CMD_SLOWREV ?>;
|
|
|
|
var CMD_FASTREV = <?php echo CMD_FASTREV ?>;
|
|
|
|
var CMD_ZOOMIN = <?php echo CMD_ZOOMIN ?>;
|
|
|
|
var CMD_ZOOMOUT = <?php echo CMD_ZOOMOUT ?>;
|
|
|
|
var CMD_PAN = <?php echo CMD_PAN ?>;
|
|
|
|
var CMD_SCALE = <?php echo CMD_SCALE ?>;
|
|
|
|
var CMD_PREV = <?php echo CMD_PREV ?>;
|
|
|
|
var CMD_NEXT = <?php echo CMD_NEXT ?>;
|
|
|
|
var CMD_SEEK = <?php echo CMD_SEEK ?>;
|
|
|
|
var CMD_QUERY = <?php echo CMD_QUERY ?>;
|
2021-12-17 05:38:15 +08:00
|
|
|
var CMD_MAXFPS = <?php echo CMD_MAXFPS ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var SOUND_ON_ALARM = <?php echo ZM_WEB_SOUND_ON_ALARM ?>;
|
|
|
|
var POPUP_ON_ALARM = <?php echo ZM_WEB_POPUP_ON_ALARM ?>;
|
2020-12-03 09:44:12 +08:00
|
|
|
var LIST_THUMBS = <?php echo ZM_WEB_LIST_THUMBS?'true':'false' ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var streamMode = "<?php echo $streamMode ?>";
|
|
|
|
var showMode = "<?php echo ($showPtzControls && !empty($control))?"control":"events" ?>";
|
2021-12-11 04:34:35 +08:00
|
|
|
var cycle = <?php echo $cycle ? 'true' : 'false' ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var connKey = '<?php echo $connkey ?>';
|
|
|
|
var maxDisplayEvents = <?php echo 2 * MAX_EVENTS ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2015-12-02 03:30:24 +08:00
|
|
|
var monitorId = <?php echo $monitor->Id() ?>;
|
2019-11-23 01:18:30 +08:00
|
|
|
var monitorWidth = <?php echo $monitor->ViewWidth() ?>;
|
|
|
|
var monitorHeight = <?php echo $monitor->ViewHeight() ?>;
|
2020-03-03 01:43:07 +08:00
|
|
|
var monitorUrl = '<?php echo $monitor->UrlToIndex() ?>';
|
|
|
|
var monitorType = '<?php echo $monitor->Type() ?>';
|
|
|
|
var monitorRefresh = '<?php echo $monitor->Refresh() ?>';
|
|
|
|
var monitorStreamReplayBuffer = <?php echo $monitor->StreamReplayBuffer() ?>;
|
2020-10-04 06:00:20 +08:00
|
|
|
var monitorControllable = <?php echo $monitor->Controllable()?'true':'false' ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2021-12-15 06:05:56 +08:00
|
|
|
var monIdx = <?php echo $monitor_index; ?>;
|
2021-12-11 04:34:35 +08:00
|
|
|
var nextMid = "<?php echo isset($nextMid)?$nextMid:'' ?>";
|
|
|
|
var mode = "<?php echo $options['mode'] ?>";
|
|
|
|
|
|
|
|
var monitorData = new Array();
|
|
|
|
<?php
|
2021-12-23 00:25:46 +08:00
|
|
|
foreach ($monitors as $m) {
|
2021-12-11 04:34:35 +08:00
|
|
|
?>
|
|
|
|
monitorData[monitorData.length] = {
|
2021-12-23 00:25:46 +08:00
|
|
|
'id': <?php echo $m->Id() ?>,
|
|
|
|
'width': <?php echo $m->ViewWidth() ?>,
|
|
|
|
'height':<?php echo $m->ViewHeight() ?>,
|
2022-01-11 13:22:37 +08:00
|
|
|
'janusEnabled':<?php echo $m->JanusEnabled() ?>,
|
2021-12-23 00:25:46 +08:00
|
|
|
'url': '<?php echo $m->UrlToIndex() ?>',
|
|
|
|
'onclick': function(){window.location.assign( '?view=watch&mid=<?php echo $m->Id() ?>' );},
|
|
|
|
'type': '<?php echo $m->Type() ?>',
|
|
|
|
'refresh': '<?php echo $m->Refresh() ?>'
|
2021-12-11 04:34:35 +08:00
|
|
|
};
|
|
|
|
<?php
|
|
|
|
} // end foreach monitor
|
|
|
|
?>
|
|
|
|
|
|
|
|
var SCALE_BASE = <?php echo SCALE_BASE ?>;
|
2017-11-21 03:25:13 +08:00
|
|
|
var scale = '<?php echo $scale ?>';
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var statusRefreshTimeout = <?php echo 1000*ZM_WEB_REFRESH_STATUS ?>;
|
|
|
|
var eventsRefreshTimeout = <?php echo 1000*ZM_WEB_REFRESH_EVENTS ?>;
|
|
|
|
var imageRefreshTimeout = <?php echo 1000*ZM_WEB_REFRESH_IMAGE ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var canStreamNative = <?php echo canStreamNative()?'true':'false' ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2021-12-11 04:34:35 +08:00
|
|
|
var imageControlMode = '<?php
|
|
|
|
$control = $monitor->Control();
|
|
|
|
if ($control->CanMoveMap()) {
|
|
|
|
echo 'moveMap';
|
|
|
|
} else if ($control->CanMoveRel()) {
|
|
|
|
echo 'movePseudoMap';
|
|
|
|
} else if ($control->CanMoveCon()) {
|
|
|
|
echo 'moveConMap';
|
|
|
|
}
|
|
|
|
?>';
|
2009-05-26 02:03:46 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var refreshApplet = <?php echo (canStreamApplet() && $streamMode == "jpeg")?'true':'false' ?>;
|
|
|
|
var appletRefreshTime = <?php echo ZM_RELOAD_CAMBOZOLA ?>;
|
2020-10-03 04:46:28 +08:00
|
|
|
|
|
|
|
var labels = new Array();
|
|
|
|
<?php
|
|
|
|
$labels = array();
|
2021-12-23 00:25:46 +08:00
|
|
|
ZM\Debug("Presets");
|
2021-12-11 04:34:35 +08:00
|
|
|
foreach (dbFetchAll('SELECT * FROM ControlPresets WHERE MonitorId = ?', NULL, array($monitor->Id())) as $row) {
|
|
|
|
$label = $labels[$row['Preset']] = $row['Label'];
|
2021-12-23 00:25:46 +08:00
|
|
|
echo 'labels['. validInt($row['Preset']) .'] = \''.validJsStr($label).'\';'.PHP_EOL;
|
2020-10-03 04:46:28 +08:00
|
|
|
}
|
|
|
|
?>
|
2021-12-11 04:34:35 +08:00
|
|
|
var deleteString = "<?php echo translate('Delete') ?>";
|
|
|
|
var enableAlarmsStr = "<?php echo translate('EnableAlarms') ?>";
|
|
|
|
var disableAlarmsStr = "<?php echo translate('DisableAlarms') ?>";
|
|
|
|
var forceAlarmStr = "<?php echo translate('ForceAlarm') ?>";
|
|
|
|
var cancelForcedAlarmStr = "<?php echo translate('CancelForcedAlarm') ?>";
|
2021-11-11 03:22:05 +08:00
|
|
|
var translate = {
|
2021-12-11 04:34:35 +08:00
|
|
|
"seconds": "<?php echo translate('seconds') ?>",
|
2021-11-11 03:22:05 +08:00
|
|
|
"Fullscreen": "<?php echo translate('Fullscreen') ?>",
|
|
|
|
"Exit Fullscreen": "<?php echo translate('Exit Fullscreen') ?>",
|
|
|
|
};
|