简体   繁体   中英

hls.js - how to subscribe to any event

First time I play a playlist, I keep getting bufferStalledError .

I can detect this error, however, if I resolve this error then a jump or skip in the video play back occurs and it stops occurring.

However, if i ignore it then it will play without a noticable interruption and the video keeps playing . But this error will continue to be raised but without any noticable issues.

However, at times, the same error will result in an overflow and hls.js won't be able to recover automatically, and no further errors are reported after such a failure than the last bufferStalled error .

I have to restart the video through destroy and attach again resuming the play functionality hls.js is unable to do automatically or through recoverMediaErrors() .

The only problem is that I am unable to subscribe to an event that says that the video is playing, or stuck. After a bufferStalledMediaError hls.js will recover it automatically without a glitch, but sometimes it fails to do so. In both cases no more errors are reported .

But is there maybe another event reported that says it is playing that is not an error report?

Is there an hls.on(Hls.Events.ALL, ... ) event ?

What about setting up a TimeLineController ? It's not documented.

Reference: https://github.com/dailymotion/hls.js/blob/master/API.md

I don't think there is a built in way to listen to all events, but you could always just subscribe to every event:

Object.keys(Hls.Events).forEach(function (e) {
    _hlsInstance.on(Hls.Events[e], console.info.bind(console));
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM