Skip to content

Commit

Permalink
Fix: Load 'js/hls.js' if at least one of the cameras uses HLS on the …
Browse files Browse the repository at this point in the history
…Watch page (watch.php)
  • Loading branch information
IgorA100 authored Jan 29, 2025
1 parent 0c3a7e6 commit 5f51249
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/skins/classic/views/watch.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@
}
#Whether to show the controls button
$hasPtzControls = false;
$hasHLS = false;
foreach ($monitors as $m) {
if (( ZM_OPT_CONTROL && $m->Controllable() && canView('Control') && $m->Type() != 'WebSite' )) {
//If there is control for at least one camera, then we display the block.
$hasPtzControls = true;
}
if ( $m->RTSP2WebEnabled() and $m->RTSP2WebType == "HLS") {
$hasHLS = true;
}
if ($hasPtzControls && $hasHLS) {
break;
}
}
Expand Down Expand Up @@ -494,7 +500,7 @@ class="table-sm table-borderless"
</div>
</div>
<?php
if ( $monitor->RTSP2WebEnabled() and $monitor->RTSP2WebType == "HLS") {
if ($hasHLS) {
?>
<script src="<?php echo cache_bust('js/hls.js') ?>"></script>
<?php
Expand Down

0 comments on commit 5f51249

Please sign in to comment.