videojs / videojs-contrib-hls

HLS library for video.js
http://videojs.github.io/videojs-contrib-hls/
Other
2.84k stars 792 forks source link

Changing hls substream from script #1352

Closed gregfr closed 6 years ago

gregfr commented 6 years ago

Greetings I'm looking for a way to switch substream, in the same way the selector does, but but from JS. I tried to use videojs.Hls.xhr.beforeRequest and change options.uri, but it says on the same substream for a while before switching (I guess there's some kind of caching involved). What is the proper way to make the player switch substream from a script?

Thanks in advance

greg

gesinger commented 6 years ago

Hey @gregfr , if you want to try writing a custom ABR function for selecting playlists, you can do so using https://github.com/videojs/videojs-contrib-hls#hlsselectplaylist . Please let us know if that helps.

gesinger commented 6 years ago

Closing for now. If this doesn't help your use case, please let us know. Thank you.