mirror of
https://github.com/p-stream/providers.git
synced 2026-05-11 20:30:52 +00:00
more wyzie caption information
This commit is contained in:
parent
d752edc7b4
commit
062d8bfda6
2 changed files with 14 additions and 0 deletions
|
|
@ -13,6 +13,13 @@ export type Caption = {
|
||||||
url: string;
|
url: string;
|
||||||
hasCorsRestrictions: boolean;
|
hasCorsRestrictions: boolean;
|
||||||
language: string;
|
language: string;
|
||||||
|
// Optional fields provided by Wyzie
|
||||||
|
flagUrl?: string;
|
||||||
|
display?: string;
|
||||||
|
media?: string;
|
||||||
|
isHearingImpaired?: boolean;
|
||||||
|
source?: string;
|
||||||
|
encoding?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function getCaptionTypeFromUrl(url: string): CaptionType | null {
|
export function getCaptionTypeFromUrl(url: string): CaptionType | null {
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,13 @@ export async function addWyzieCaptions(
|
||||||
type: subtitle.format === 'srt' || subtitle.format === 'vtt' ? subtitle.format : 'srt',
|
type: subtitle.format === 'srt' || subtitle.format === 'vtt' ? subtitle.format : 'srt',
|
||||||
hasCorsRestrictions: false,
|
hasCorsRestrictions: false,
|
||||||
language: subtitle.language,
|
language: subtitle.language,
|
||||||
|
// Additional metadata from Wyzie
|
||||||
|
flagUrl: subtitle.flagUrl,
|
||||||
|
display: subtitle.display,
|
||||||
|
media: subtitle.media,
|
||||||
|
isHearingImpaired: subtitle.isHearingImpaired,
|
||||||
|
source: typeof subtitle.source === 'number' ? subtitle.source.toString() : subtitle.source,
|
||||||
|
encoding: subtitle.encoding,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return [...captions, ...wyzieCaptions];
|
return [...captions, ...wyzieCaptions];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue