Add headers and preferred headers to streams

This commit is contained in:
mrjvs 2023-12-26 16:14:10 +01:00
parent 4eaae64e4a
commit 4b1e8288b8
1 changed files with 9 additions and 7 deletions

View File

@ -9,20 +9,22 @@ export type StreamFile = {
export type Qualities = 'unknown' | '360' | '480' | '720' | '1080' | '4k';
export type FileBasedStream = {
type: 'file';
type StreamCommon = {
id: string; // only unique per output
flags: Flags[];
qualities: Partial<Record<Qualities, StreamFile>>;
captions: Caption[];
headers?: Record<string, string>; // these headers HAVE to be set to watch the stream
preferredHeaders?: Record<string, string>; // these headers are optional, would improve the stream
};
export type HlsBasedStream = {
export type FileBasedStream = StreamCommon & {
type: 'file';
qualities: Partial<Record<Qualities, StreamFile>>;
};
export type HlsBasedStream = StreamCommon & {
type: 'hls';
id: string; // only unique per output
flags: Flags[];
playlist: string;
captions: Caption[];
};
export type Stream = FileBasedStream | HlsBasedStream;