Merge branch 'IgorA100-patch-116'

This commit is contained in:
Isaac Connor
2024-05-23 13:46:34 -04:00
4 changed files with 10 additions and 9 deletions

View File

@@ -992,8 +992,7 @@ function xhtmlFooter() {
if ( $basename == 'montage' ) {
echo output_script_if_exists(array('assets/gridstack/dist/gridstack-all.js'));
echo output_script_if_exists(array('assets/jquery.panzoom/dist/jquery.panzoom.js'));
}
if ( $basename == 'watch' || $basename == 'event') {
} else if ( $basename == 'watch' || $basename == 'event') {
echo output_script_if_exists(array('assets/jquery.panzoom/dist/jquery.panzoom.js'));
}

View File

@@ -560,10 +560,11 @@ function handleClick(evt) {
function startMonitors() {
for (let i = 0, length = monitorData.length; i < length; i++) {
const obj = document.getElementById('liveStream'+monitors[i].id);
const url = new URL(obj.src);
url.searchParams.set('scale', parseInt(obj.clientWidth / monitors[i].width * 100));
obj.src = url;
if (obj.src) {
const url = new URL(obj.src);
url.searchParams.set('scale', parseInt(obj.clientWidth / monitors[i].width * 100));
obj.src = url;
}
// Start the fps and status updates. give a random delay so that we don't assault the server
const delay = Math.round( (Math.random()+0.5)*statusRefreshTimeout );

View File

@@ -13,6 +13,9 @@ const canStreamNative = <?php echo canStreamNative()?'true':'false' ?>;
var monitorData = new Array();
<?php
global $presetLayoutsNames;
echo 'const ZM_PRESET_LAYOUT_NAMES = '.json_encode($presetLayoutsNames).';'.PHP_EOL;
global $monitors;
foreach ( $monitors as $monitor ) {
?>

View File

@@ -338,9 +338,6 @@ foreach ($monitors as $monitor) {
<script src="<?php echo cache_bust('js/hls.js') ?>"></script>
<?php } ?>
<script src="<?php echo cache_bust('js/MonitorStream.js') ?>"></script>
<?php xhtmlFooter() ?>
<?php echo '<script nonce="'.$cspNonce.'"> const ZM_PRESET_LAYOUT_NAMES = '.json_encode($presetLayoutsNames).' </script>'.PHP_EOL;?>
<!-- In May 2024, IgorA100 globally changed grid layout -->
<div id="messageModal" class="modal fade" tabindex="-1">
@@ -361,3 +358,4 @@ foreach ($monitors as $monitor) {
</div>
</div>
</div>
<?php xhtmlFooter() ?>