diff --git a/src/utils/DashManifest.tsx b/src/utils/DashManifest.tsx index 5c0620450..155c58c99 100644 --- a/src/utils/DashManifest.tsx +++ b/src/utils/DashManifest.tsx @@ -241,10 +241,14 @@ async function DashManifest({ lang={set.language} contentType="text" > - + { + set.track_roles.map((role) => ( + + )) + } diff --git a/src/utils/StreamingInfo.ts b/src/utils/StreamingInfo.ts index a56785c61..5f09cdd1b 100644 --- a/src/utils/StreamingInfo.ts +++ b/src/utils/StreamingInfo.ts @@ -128,6 +128,7 @@ export interface TextSet { mime_type: string; language: string; track_name: string; + track_roles: ('caption' | 'dub')[]; representation: TextRepresentation; } @@ -760,10 +761,17 @@ function getTextSets( const url = new URL(caption_track.base_url); url.searchParams.set('fmt', format); + const track_roles: ('caption' | 'dub')[] = [ 'caption' ]; + + if (url.searchParams.has('tlang')) { + track_roles.push('dub'); + } + return { mime_type, language: caption_track.language_code, track_name: caption_track.name.toString(), + track_roles, representation: { uid: `text-${caption_track.vss_id}`, base_url: transform_url(url).toString()