clappr / clappr-level-selector-plugin

Clappr Level Selector Plugin
MIT License
76 stars 56 forks source link

Work for native HLS #23

Open ariselseng opened 8 years ago

ariselseng commented 8 years ago

Hi, Allowing the user to change the quality on a phone is very important. Actually much more important than on a desktop, in my opinion.

How difficult would it be to make this happen? Should we add the support to the html5_video playback or use some other method?

leandromoreira commented 8 years ago

While I don't disagree with you @cowai, I want to point out some things first:

ariselseng commented 8 years ago

If there is no api in native hls to get the available levels, I would suggest that this plugin could have that as parameters in the plugin options. And simply force chosen manifest as source for the player. That would kill adaptive bitrate completely though and I would call it a hack. But it would be much better than nothing at least.

me-vlad commented 8 years ago

@cowai @leandromoreira you can get available bitrates from m3u8 playlist (EXT-X-STREAM-INF tag)

https://tools.ietf.org/html/draft-pantos-http-live-streaming-18#page-22 https://developer.apple.com/library/ios/technotes/tn2288/_index.html#//apple_ref/doc/uid/DTS40012238-CH1-BASIC_VARIANT_PLAYLIST

Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute.

leandromoreira commented 8 years ago

@me-vlad I think we can only interact with the video tag by using its events and attributes. I don't think we can proxy the requests too, therefore we can't see the playlist content :(

me-vlad commented 8 years ago

@leandromoreira you're right, Its bad idea with playlist parsing. Another solution - possibility to add manual configuration for each level and switching sources as it done in videojs resolutions switcher for example
https://github.com/kmoskwiak/videojs-resolution-switcher

ariselseng commented 8 years ago

https://github.com/dailymotion/hls.js/issues/193 Related thread talking about native hls in Safari.

Basically we need to reload the source of chosen level. To get the levels we either need to parse, or to supply it in the config. I dont think there is any other way.

ariselseng commented 8 years ago

@leandromoreira Have you had the time to gather some thoughts on this? Would you be willing to accept code that either parses the manifest or gets a supplied list as a config?

leandromoreira commented 8 years ago

@cowai for sure submit your PR and we'll build this together :)