mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-04 00:15:20 -04:00
fix: pick HLS player when index.m3u8 exists, not from DefaultVideo refs #4757
Closed events that have already had their DefaultVideo column rewritten to the renamed mp4 (every event recorded before the C++ fix landed) need a client-side fallback so the HLS player still gets picked up. Treat the on-disk index.m3u8 as the source of truth for HLS availability and gate on the codec choice — auto / MP4 / MP4HLS all use HLS when the manifest is there; MJPEG and any other explicit non-video choice keep the old behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
47d3af70c7
commit
10a4f9af13
1 file changed
+7
-3
@@ -354,9 +354,13 @@ if (file_exists($Event->Path().'/objdetect.jpg')) {
|
||||
<div id="zoompan" class="zoompan">
|
||||
<?php
|
||||
if ($video_tag) {
|
||||
// Use HLS byte-range playback if m3u8 manifest exists on disk
|
||||
$has_hls = (($codec == 'MP4HLS') || str_ends_with($Event->DefaultVideo(), '.m3u8'))
|
||||
&& file_exists($Event->Path() . '/index.m3u8');
|
||||
// Prefer HLS byte-range playback whenever the manifest exists on disk and the
|
||||
// user hasn't explicitly opted into a non-HLS playback mode. Closed events
|
||||
// have DefaultVideo rewritten to the renamed mp4, so checking the file system
|
||||
// is what catches them.
|
||||
$has_hls = file_exists($Event->Path() . '/index.m3u8')
|
||||
&& (($codec == 'MP4HLS') || ($codec == 'MP4') || ($codec == 'auto')
|
||||
|| str_ends_with($Event->DefaultVideo(), '.m3u8'));
|
||||
if ($has_hls) {
|
||||
$Server = $Event->Server();
|
||||
$hlsSrc = $Server->PathToIndex() . '?view=view_hls&eid=' . $Event->Id();
|
||||
|
||||
Reference in new issue
Block a user