diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js
index c6d9eeb68b..9a928709ac 100644
--- a/src/plugins/htmlVideoPlayer/plugin.js
+++ b/src/plugins/htmlVideoPlayer/plugin.js
@@ -69,12 +69,12 @@ function tryRemoveElement(elem) {
}
}
-function enableNativeTrackSupport(currentSrc, track) {
+function enableNativeTrackSupport(mediaSource, track) {
if (track?.DeliveryMethod === 'Embed') {
return true;
}
- if (browser.firefox && (currentSrc || '').toLowerCase().includes('.m3u8')) {
+ if (browser.firefox && (mediaSource?.TranscodingSubProtocol || mediaSource?.Container) === 'hls') {
return false;
}
@@ -341,11 +341,11 @@ export class HtmlVideoPlayer {
* @private
*/
updateVideoUrl(streamInfo) {
- const isHls = streamInfo.url.toLowerCase().includes('.m3u8');
-
const mediaSource = streamInfo.mediaSource;
const item = streamInfo.item;
+ const isHls = (mediaSource?.TranscodingSubProtocol || mediaSource?.Container) === 'hls';
+
// Huge hack alert. Safari doesn't seem to like if the segments aren't available right away when playback starts
// This will start the transcoding process before actually feeding the video url into the player
// Edit: Also seeing stalls from hls.js
@@ -513,7 +513,7 @@ export class HtmlVideoPlayer {
elem.crossOrigin = crossOrigin;
}
- if (enableHlsJsPlayer(options.mediaSource.RunTimeTicks, 'Video') && val.includes('.m3u8')) {
+ if (enableHlsJsPlayer(options.mediaSource.RunTimeTicks, 'Video') && (options.mediaSource.TranscodingSubProtocol || options.mediaSource.Container) === 'hls') {
return this.setSrcWithHlsJs(elem, options, val);
} else if (options.playMethod !== 'Transcode' && options.mediaSource.Container === 'flv') {
return this.setSrcWithFlvJs(elem, options, val);
@@ -1561,7 +1561,7 @@ export class HtmlVideoPlayer {
})[0];
this.setTrackForDisplay(this.#mediaElement, track, targetTextTrackIndex);
- if (enableNativeTrackSupport(this.#currentSrc, track)) {
+ if (enableNativeTrackSupport(this._currentPlayOptions?.mediaSource, track)) {
if (streamIndex !== -1) {
this.setCueAppearance();
}