diff --git a/docs/initialization.md b/docs/initialization.md index a9724528..d379bab6 100644 --- a/docs/initialization.md +++ b/docs/initialization.md @@ -452,6 +452,22 @@ sources: [ ] ``` +### **overrideNative** + +You can prevent the use of some browser's native HLS capabilities by setting the flag +`overrideNative` to the video source. This forces the use of Media Source Extensions +to provide a more consistent experience between browsers. + +``` +sources: [ + { + type: 'hls', + file: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8', + overrideNative: true, + } +] +``` + ### **volume** | **Type** | Default | Required | diff --git a/src/js/api/SupportChecker.js b/src/js/api/SupportChecker.js index cbd954a3..e47ffc4a 100755 --- a/src/js/api/SupportChecker.js +++ b/src/js/api/SupportChecker.js @@ -43,14 +43,18 @@ const SupportChecker = function(){ const file = source.file; const type = source.type; + const overrideNative = source.overrideNative; if(!type){return false;} const mimeType = source.mimeType || MimeTypes[type]; // Latest Edge browser returns "Chrome" from userAgentObject.browser // Make sure to use hls.js Android devices - if(isHls(file, type) && (userAgentObject.browser === "Microsoft Edge" || userAgentObject.os === "Android")) { + if (isHls(file, type) && (userAgentObject.browser === "Microsoft Edge" || userAgentObject.os === "Android")) { + return false; + } + if (isHls(file, type) && overrideNative) { return false; } @@ -58,7 +62,7 @@ const SupportChecker = function(){ return false; } - if(isWebRTC(file, type)){ + if (isWebRTC(file, type)) { return false; }