From 064d550cc8aa1b0f487d1d6fe6d627611a469c77 Mon Sep 17 00:00:00 2001 From: Trevor Mears Date: Sun, 28 Dec 2025 03:46:59 -0800 Subject: [PATCH] Fixed HLS and MP4 handling issues --- public/js/components/VideoPlayer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/js/components/VideoPlayer.js b/public/js/components/VideoPlayer.js index b150996..40bb7c8 100644 --- a/public/js/components/VideoPlayer.js +++ b/public/js/components/VideoPlayer.js @@ -209,8 +209,13 @@ class VideoPlayer { this.isUsingProxy = needsProxy; const finalUrl = needsProxy ? this.getProxiedUrl(streamUrl) : streamUrl; - // Priority 1: Use HLS.js for all browsers that support it (Chrome, Firefox, Edge, etc.) - if (Hls.isSupported()) { + // Detect if this is likely an HLS stream (vs direct video file like MP4) + const looksLikeHls = finalUrl.includes('.m3u8') || + finalUrl.includes('m3u8') || + (!finalUrl.includes('.mp4') && !finalUrl.includes('.mkv') && !finalUrl.includes('.avi')); + + // Priority 1: Use HLS.js for HLS streams on browsers that support it + if (looksLikeHls && Hls.isSupported()) { this.hls = new Hls(this.getHlsConfig()); this.hls.loadSource(finalUrl); this.hls.attachMedia(this.video);