mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
21 lines
662 B
JavaScript
21 lines
662 B
JavaScript
//#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
|