Skip to content

Commit 0d343c4

Browse files
Merge pull request #4212 from IgorA100/patch-51674
Fix: Load 'js/hls.js' if at least one of the cameras uses HLS on the Watch page
2 parents fae724a + 5f51249 commit 0d343c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

web/skins/classic/views/watch.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,16 @@
103103
}
104104
#Whether to show the controls button
105105
$hasPtzControls = false;
106+
$hasHLS = false;
106107
foreach ($monitors as $m) {
107108
if (( ZM_OPT_CONTROL && $m->Controllable() && canView('Control') && $m->Type() != 'WebSite' )) {
108109
//If there is control for at least one camera, then we display the block.
109110
$hasPtzControls = true;
111+
}
112+
if ( $m->RTSP2WebEnabled() and $m->RTSP2WebType == "HLS") {
113+
$hasHLS = true;
114+
}
115+
if ($hasPtzControls && $hasHLS) {
110116
break;
111117
}
112118
}
@@ -494,7 +500,7 @@ class="table-sm table-borderless"
494500
</div>
495501
</div>
496502
<?php
497-
if ( $monitor->RTSP2WebEnabled() and $monitor->RTSP2WebType == "HLS") {
503+
if ($hasHLS) {
498504
?>
499505
<script src="<?php echo cache_bust('js/hls.js') ?>"></script>
500506
<?php

0 commit comments

Comments
 (0)