video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.9k stars 2.58k forks source link

Make M3U8Parser available for other uses. #2183

Open patrickmichalina opened 5 years ago

patrickmichalina commented 5 years ago

Is your feature request related to a problem? Please describe.

Since Safari for iOS does not emit events about the available quality levels in an HLS video, there is no native way to create a custom quality selection menu to overlay an HLS video. This of course is easy to do with hls.js because it parses the manifest and emits an event with available qualities.

My request here is for this library to export its M3U8Parser so it can be used in Safari to achieve this. The alternative is to use another m3u8 parser which just adds more javascript overhead and has the potential to not parse the same way - causing mismatch between clients.

Describe alternatives you've considered

Something like this library m3u8-file-parser

itsjamie commented 5 years ago

Hello @patrickmichalina, sorry this went stale.

I'll mark this for consideration for the 1.0 API.

I could see us including this and exporting it, but not including it in the API guarantee for semver. Would that be ok for your purposes?

Mostly, it shouldn't be an issue, but the less API that is part of the public guarantee the easier it is to get minor fixes in without having to discuss if it's a breaking change.

patrickmichalina commented 5 years ago

That would work! Thank you

robwalch commented 1 year ago

This issue might be resolved by adding a named export of M3U8Parser ~but our last attempt to add named exported to the default library export failed: Related to #5630 and #5729.~

TeodorDre commented 1 year ago

Any updates here? Also, it is a good feature for SmartTV (WebOS / Tizen) Players

robwalch commented 11 months ago

Would you like to submit a PR making the parser available for ESM import by adding M3U8Parser to https://github.com/video-dev/hls.js/blob/master/src/exports-named.ts ?