node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »

@meisterplayer/plugin-hls

HLS.js plugin for Meister

This plugin allows HLS playback in browsers that do not natively support it. This plugin uses hls.js internally for playback of the streams.
NOTE The browser needs to implement the MediaSource API for this to work (which most modern browsers do).

Config options

autoRecoverMode [Boolean] (default: false)

By setting the autoRecoverMode you can let the HLS plugin try to automatically recover from Media errors. For example if the player cannot decode the video that is currently playing.

Example:

var meisterPlayer = new Meister('#player', {
    Hls: {
        autoRecoverMode: true,
    }
});
 
meisterPlayer.setItem({
    src: 'INSERT_HLS_M3U8_URL_HERE'
    type: 'm3u8',
});

disabled [Boolean] (default: false)

This disables the HLS.js plugin for the meister instance. This can be used if you use this in combination with a other plugin that can also play HLS (such as Safari or Edge natively).

Example:

var meisterPlayer = new Meister('#player', {
    Hls: {
        disabled: true,
    }
});

dvrEnabled [Boolean] (default: true)

This enables/disables DVR capabilities in HLS if it is supported by the stream.

Example:

var meisterPlayer = new Meister('#player', {
    Hls: {
        dvrEnabled: false,
    }
});

dvrThreshold [Number] (default: 300)

This value determines if a live stream is a DVR stream yes or no. If the live stream has added up more seconds then the dvrThreshold it is considered a DVR stream else not.

Example:

var meisterPlayer = new Meister('#player', {
    Hls: {
        dvrThreshold: 50,
    }
});

disableVisibilitySwitch [Boolean] (default: false)

Disables the quality switching when the player is not in an active tab or is minimized. (Default behavior is when the user either selects a different tab or minimizes the tab the player will select the lowest video quality to save bandwidth)

Example:

var meisterPlayer = new Meister('#player', {
    Hls: {
        disableVisibilitySwitch: true,
    }
});

maxErrors [Boolean] (default: 5)

Defines the maximum amount of errors that are allowed to be thrown. When the errors exceed this amount we throw a meister error.

Example:

var meisterPlayer = new Meister('#player', {
    Hls: {
        maxErrors: 6,
    }
});

Item config

These settings can be set per item. These will be available using the Hls: {} namespace.

fineTuning [Object]

Here you can set all the finetuning options that can be found here: https://github.com/video-dev/hls.js/blob/master/doc/API.md#fine-tuning

Example:

meister.setItem({
    src: 'M3U8_URL_HERE',
    type: 'm3u8',
    Hls: {
        fineTuning: {
            debug: true,
            nudgeMaxRetry: 5,
        }
    }
});