Skip to content

Extend hlsjsConfig with ability to ignore errors #102

@stevendesu

Description

@stevendesu

Currently when a fatal error is thrown and cannot be recovered, _hls.destroy() is called, tech.error is set, and the error event is triggered. This basically halts all playback, forces an error display on the player, and makes recovery nearly impossible.

In some cases people may want to implement their own recovery logic - particularly if they have unique insights into the reason for the failure, or a special fallback case. In my case, a stream had two different M3U8 URLs. When one failed to play, the other could be used as a backup (different cameras for the same event). I therefore wishes to intercept the HLS error event and, if fatal, switch to the other camera, seek to the same currentTime(), and continue playback.

It would be nice if the entire _onError method were optional, perhaps with something like:

    var options = {
        html5: {
            hlsjsConfig: {
                ignoreErrors: true
            }
        }
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions