AirenSoft / OvenPlayer

OvenPlayer is JavaScript-based LLHLS and WebRTC Player for OvenMediaEngine.
https://OvenMediaEngine.com/ovenplayer
MIT License
508 stars 124 forks source link

Question about fatal errors #347

Closed hernanrz closed 1 year ago

hernanrz commented 1 year ago

According to the docs, hls.js can throw fatal or non fatal errors, my question is: Do the non-fatal errors also trigger an "error" state change event in the player?

SangwonOh commented 1 year ago

@hernanrz Hi. Thanks for reading our documents. For the non-fatal hls errors the OvenPlayer do not trigger the error state.

https://github.com/AirenSoft/OvenPlayer/blob/73531ffdcd9baf363710ce7d44acd5bfebdc4944/src/js/api/provider/html5/providers/Hls.js#L192

hernanrz commented 1 year ago

Thanks! We are seeing many errors with ovenplayer, playing a HLS stream created by nginx-rtmp, videojs on the other hand doesn't throw errors at all with the same stream... I don't know how to capture the details of the errors, any tips on how to debug these errors would be appreciated

SangwonOh commented 1 year ago

@hernanrz You can hook the hls instance and add error event listener.

    ovenPlayer.on('hlsPrepared', function (hls) {
        console.log(hls);
        hls.on(Hls.Events.ERROR, function (event, data) {
            // This is error data HLS.js throws
            console.log(data);
        });
    });
hernanrz commented 1 year ago

Thank you, I'll try this

On Tue, May 2, 2023 at 4:01 AM Sangwon Oh @.***> wrote:

@hernanrz https://github.com/hernanrz You can hook the hls instance and add error event listener.

ovenPlayer.on('hlsPrepared', function (hls) {
    console.log(hls);
    hls.on(Hls.Events.ERROR, function (event, data) {
        // This is error data HLS.js throws
        console.log(data);
    });
});

— Reply to this email directly, view it on GitHub https://github.com/AirenSoft/OvenPlayer/issues/347#issuecomment-1531046964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGN4MPDG4U4MYPWWITZKGLXEC5PFANCNFSM6AAAAAAXB5FFPM . You are receiving this because you were mentioned.Message ID: @.***>