Skip to content

Enable hls.js with WebOS #6678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/htmlMediaHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be webOsVersion (e.g. a capital O, not a Zero)?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the variable name is correct like this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this some jellyfin infill, since the only GitHub search hits are in these in these (and clone) repos...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you've been searching wrong?

browser.web0sVersion = web0sVersion(browser);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why it is written with zero, but it is certainly correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just because of the UserAgent string:
https://webostv.developer.lge.com/develop/specifications/web-api-and-web-engine

Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this some jellyfin infill, since the only GitHub search hits are in these in these (and clone) repos...

Maybe you've been searching wrong?

browser.web0sVersion = web0sVersion(browser);

That's in a JellyFin repo...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I understand correctly. jellyfin-webos is just a slim wrapper around jellyfin-web so it's correct that this code is in jellyfin-web.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I understand correctly. jellyfin-webos is just a slim wrapper around jellyfin-web so it's correct that this code is in jellyfin-web.

It's fine, I was previously unaware that the Web0S was driven by the Agent string (per @dmitrylyzo 's comment and thus asked a question about if the spelling was intentional. I did a Google and GitHub search to see if that spelling was used elsewhere and found that it was unique to the jellyfin-web repo (and the forks) and it was only here and being that it was browser.web0sVersion , I was concerned that no browser actually implemented that.

I didn't check to see that it was actually a infilled method declared in brower.js and filled into the global browser scope because I'm not in the habit of adding things to the global browser scope except for polyfills... and since this was not a spec-mentioned thing, I was surprised.

I am very sorry for wasting so much time just asking a question... I should have dived into the code first. Mea culpa.

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;
Expand Down
8 changes: 8 additions & 0 deletions src/scripts/browserDeviceProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading