mirror of
https://github.com/p-stream/providers.git
synced 2026-01-11 20:10:33 +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;
|
||||
hasCorsRestrictions: boolean;
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -62,6 +62,13 @@ export async function addWyzieCaptions(
|
|||
type: subtitle.format === 'srt' || subtitle.format === 'vtt' ? subtitle.format : 'srt',
|
||||
hasCorsRestrictions: false,
|
||||
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];
|
||||
|
|
|
|||
Loading…
Reference in a new issue