feat(casting): add CastSelection model and resolution helpers

This commit is contained in:
Uruk
2026-05-21 23:46:19 +02:00
parent e5d61bf3ea
commit 3d65c3bb7a
4 changed files with 163 additions and 20 deletions

View File

@@ -70,3 +70,18 @@ export const DEFAULT_CAST_STATE: CastPlayerState = {
volume: 0.5,
isBuffering: false,
};
/**
* What is currently loaded on the cast — the single source of truth for
* audio / subtitle / quality / version selection.
*/
export interface CastSelection {
/** MediaSource (version) id. */
mediaSourceId: string;
/** Absolute MediaStream index of the audio track. */
audioStreamIndex: number;
/** Absolute MediaStream index of the subtitle track; -1 = subtitles off. */
subtitleStreamIndex: number;
/** Quality cap in bits/second; undefined = unconstrained. */
maxBitrate?: number;
}