Files
v10/dist/dev/media/abr/quality-selection.js
T

21 lines
662 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//#region src/media/abr/quality-selection.ts
/**
* Default quality selection configuration.
* Values match Shaka Player upgrade threshold (0.85 = 15% headroom).
*/
const DEFAULT_QUALITY_CONFIG = {
safetyMargin: .85,
upgradeMargin: 1.15
};
/**
* Resolution as a total pixel count (`width × height`), the basis for
* comparing two tracks at the same bitrate. Missing dimensions count as 0, so
* tracks without resolution metadata (e.g. audio) area-compare equal.
*/
function resolutionArea(track) {
return (track.width ?? 0) * (track.height ?? 0);
}
//#endregion
export { DEFAULT_QUALITY_CONFIG, resolutionArea };
//# sourceMappingURL=quality-selection.js.map