From d08885c295e0c81772992437a81bd5b717066e8b Mon Sep 17 00:00:00 2001 From: Timi Tuohenmaa <8275701+timitt@users.noreply.github.com> Date: Sat, 29 Mar 2025 13:17:24 +0200 Subject: [PATCH] Enable use of hls.js when LG WebOS 4 or newer is used. --- src/components/htmlMediaHelper.js | 6 ++++++ src/scripts/browserDeviceProfile.js | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/components/htmlMediaHelper.js b/src/components/htmlMediaHelper.js index f876568ce4d..b2453c35809 100644 --- a/src/components/htmlMediaHelper.js +++ b/src/components/htmlMediaHelper.js @@ -48,6 +48,12 @@ export function enableHlsJsPlayer(runTimeTicks, mediaType) { return false; } + // Native HLS support in WebOS only plays stereo sound. hls.js works better, but works only on WebOS 4 or newer. + // Using hls.js also seems to fix fast forward issues that native HLS has. + if (browser.web0sVersion >= 4) { + return true; + } + // The native players on these devices support seeking live streams, no need to use hls.js here if (browser.tizen || browser.web0s) { return false; diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index 4370edaeaf9..eeb1551f521 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -137,6 +137,14 @@ function supportsEac3(videoTestElement) { } function supportsAc3InHls(videoTestElement) { + // We use hls.js on WebOS 4 and newer and hls.js uses Media Sources Extensions (MSE) API. + // On WebOS MSE does support AC-3 and EAC-3 only on audio mp4 file but not on audiovideo mp4 + // therefore until audio and video is not separated when generating stream and m3u8 this should + // return false. + if (browser.web0sVersion >= 4) { + return false; + } + if (browser.tizen || browser.web0s) { return true; }