Closed Nodalailama closed 11 months ago
Hi,
It should be great to manage error like hls doc suggère, see https://github.com/video-dev/hls.js/blob/master/docs/API.md#fifth-step-error-handling.
hls.on(Hls.Events.ERROR, function (event, data) { var errorType = data.type; var errorDetails = data.details; var errorFatal = data.fatal; switch (data.details) { case Hls.ErrorDetails.FRAG_LOAD_ERROR: // .... break; default: break; } });
hls.on(Hls.Events.ERROR, function (event, data) { if (data.fatal) { switch (data.type) { case Hls.ErrorTypes.NETWORK_ERROR: // try to recover network error console.log('fatal network error encountered, try to recover'); hls.startLoad(); break; case Hls.ErrorTypes.MEDIA_ERROR: console.log('fatal media error encountered, try to recover'); hls.recoverMediaError(); break; default: // cannot recover hls.destroy(); break; } } });
Cordialement,
PS: I could have propose a PR for this and the 2 other issues I submitted today but I haven't done before ...
thanks for the feedback.
the hls.js code snippet was actually quite outdated. have a look here for more info on that https://github.com/muxinc/elements/pull/111
Hi,
It should be great to manage error like hls doc suggère, see https://github.com/video-dev/hls.js/blob/master/docs/API.md#fifth-step-error-handling.
Cordialement,
PS: I could have propose a PR for this and the 2 other issues I submitted today but I haven't done before ...