Peer5 / videojs-contrib-hls.js

HLS library for video.js using Dailymotion's hls.js tech
Apache License 2.0
108 stars 55 forks source link

Get 'hls' reference #13

Closed lvgg3271 closed 6 years ago

lvgg3271 commented 7 years ago

Thanks for your working first.

The problem is How can i get a reference to hls? I need to handle errors outside the videojs-contrib-hlsjs.js.

shacharz commented 7 years ago

You can listen to hls events since this PR check it against master, I haven't released it yet.

mrbar42 commented 7 years ago

fixed on latest version (>v3.0.0)

spodlecki commented 7 years ago

I've been messing around, trying to get your events to be triggered. I think I'm missing something obvious, how would I listen for hlsManifestLoaded

I've tried to do: player.on('hlsManifestLoaded', fn) but it is never triggered.

I can see, through the code, that you are triggering the events via the Tech, but I don't think that bubbles up to the player which is the constant API...

Any help appreciated! I did not see any documentation to access the hls object either. From the code, doesn't look like you can?

leoafarias commented 7 years ago

@spodlecki player.tech_.on('hlsManifestLoaded', fn)

This should do the trick for what you need.

benvirus commented 6 years ago

The best way is to offer the 'hls' reference through player.tech_. sourceHandler_.hls, so we can get more infornation and invoke some hls's method. For example, change the level through setting hls.currentLevel .