Example:

adaptation : {
desktop: {
bitrates: {
minSelectableAudioBitrate: '128kbps',
maxSelectableAudioBitrate: '320kbps',
minSelectableVideoBitrate: '900kbps',
maxSelectableVideoBitrate: Infinity
}
},
mobile: {
bitrates: {
minSelectableAudioBitrate: 0,
maxSelectableAudioBitrate: '256000bps',
minSelectableVideoBitrate: 0,
maxSelectableVideoBitrate: '2.5mbps'
}
}
}
interface AdaptationConfig {
    bitrates?: BitrateLimitationConfig;
    disableDownloadCancelling?: boolean;
    exclude?: boolean;
    limitToPlayerSize?: boolean;
    logic?: AdaptationLogicType;
    maxStartupBitrate?: Bitrate;
    onAudioAdaptation?: ((data) => string);
    onVideoAdaptation?: ((data) => string);
    preload?: boolean;
    qualityStabilityBalance?: number;
    resolution?: VideoSizeLimitationConfig;
    rttEstimationMethod?: RttEstimationMethod;
    startupBitrate?: Bitrate;
}

Hierarchy (view full)

Properties

Lower and upper bitrate boundaries to limit qualities.

disableDownloadCancelling?: boolean

The player automatically cancels requests if it takes too long and retries in a lower quality (default, false). This behavior can be disabled by setting this option to true.

exclude?: boolean

Specifies whether qualities that must not be switched to should be removed when parsing the manifest or not. Qualities which must not be switched to can be specified by bitrates or resolution. Default is false.

limitToPlayerSize?: boolean

Limits the automatically selected quality to the player size, so the player won't select quality levels with a higher resolution than the video element. This is disabled (false) per default.

Defines the type/version of adaptation logic to be used. Default is DOWNLOAD_PREDICTION.

maxStartupBitrate?: Bitrate

The maximum bitrate the player should start playback with. Has no effect if startupBitrate is used.

onAudioAdaptation?: ((data) => string)

A callback function to customize the player's adaptation logic that is called before the player tries to download a new audio segment.

Example:

const conf = {
...
adaptation: {
desktop: {
onAudioAdaptation: (data) => {
// Do your custom logic
return newRepresentationId;
}
},
mobile: {
onAudioAdaptation: (data) => {
// Do your custom logic
return newRepresentationId;
}
},
}
};

Type declaration

    • (data): string
    • Parameters

      • data: AudioAdaptationData

        An object carrying the suggested attribute, holding the suggested representation/quality ID the player would select

      Returns string

Returns

A valid representation/quality ID which the player should use, based on your custom logic (either data.suggested to switch to the player's suggested quality, or a id)

See

getAvailableAudioQualities to get a list of all available audio qualities

onVideoAdaptation?: ((data) => string)

A callback function to customize the player's adaptation logic that is called before the player tries to download a new video segment.

Example:

const conf = {
...
adaptation: {
desktop: {
onVideoAdaptation: (data) => {
// Do your custom logic
return newRepresentationId;
}
},
mobile: {
onVideoAdaptation: (data) => {
// Do your custom logic
return newRepresentationId;
}
},
}
};

To simply restrict video qualities to the current video player size, use limitToPlayerSize.

Type declaration

    • (data): string
    • Parameters

      • data: VideoAdaptationData

        An object carrying the suggested attribute, holding the suggested representation/quality ID the player would select

      Returns string

Returns

A valid representation/quality ID which the player should use, based on your custom logic (either data.suggested to switch to the player's suggested quality, or a id)

See

getAvailableVideoQualities to get a list of all available video qualities

preload?: boolean

Specifies whether the player preloads the content (default: true for VOD, false for live streams) or not.

qualityStabilityBalance?: number

Defines the balance between quality (i.e. bitrate) and stability in a range of [0, 1]. A value of 0 means that the player will aim to play the best possible quality, potentially at the cost of lower playback stability. A value of 1 means that the player will aim for the highest stability with the least amount of stalls, while potentially sacrificing quality. This is only relevant when using the Low Latency adaptation logic.

Default is 0.5.

Lower and upper resolution boundaries. Use 0 for no limitation for minimum selectable width/height and Infinity for no limitation for maximum selectable width/height.

rttEstimationMethod?: RttEstimationMethod

Defines what method shall be used to estimate the round-trip-time of the network based on the measured RTTs of previous downloads. Possible values are WeightedAverage and Median. The Median estimation method may perform better on low-performance devices. Default value is WeightedAverage. Can only be used with the 'v3' logic.

startupBitrate?: Bitrate

The bitrate the player should start playback with. If this option doesn’t exist in the configuration, the player will try to find the best startup bitrate automatically.