Fixed HLS and MP4 handling issues
This commit is contained in:
@@ -209,8 +209,13 @@ class VideoPlayer {
|
|||||||
this.isUsingProxy = needsProxy;
|
this.isUsingProxy = needsProxy;
|
||||||
const finalUrl = needsProxy ? this.getProxiedUrl(streamUrl) : streamUrl;
|
const finalUrl = needsProxy ? this.getProxiedUrl(streamUrl) : streamUrl;
|
||||||
|
|
||||||
// Priority 1: Use HLS.js for all browsers that support it (Chrome, Firefox, Edge, etc.)
|
// Detect if this is likely an HLS stream (vs direct video file like MP4)
|
||||||
if (Hls.isSupported()) {
|
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 = new Hls(this.getHlsConfig());
|
||||||
this.hls.loadSource(finalUrl);
|
this.hls.loadSource(finalUrl);
|
||||||
this.hls.attachMedia(this.video);
|
this.hls.attachMedia(this.video);
|
||||||
|
|||||||
Reference in New Issue
Block a user