From 84b4f1efd111321e4f3e5a87844790c4ec9b0b52 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Sun, 14 May 2023 06:11:02 +0200 Subject: [PATCH] feat(toDash): Add audio track labels to the manifest when available (#402) --- src/utils/FormatUtils.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/utils/FormatUtils.ts b/src/utils/FormatUtils.ts index 91211c2b..a81ef42e 100644 --- a/src/utils/FormatUtils.ts +++ b/src/utils/FormatUtils.ts @@ -363,7 +363,12 @@ class FormatUtils { this.#el(document, 'Role', { schemeIdUri: 'urn:mpeg:dash:role:2011', value: role - }) + }), + this.#el(document, 'Label', { + id: set_id.toString() + }, [ + document.createTextNode(first_format.audio_track?.display_name as string) + ]) ); const set = this.#el(document, 'AdaptationSet', { @@ -371,7 +376,9 @@ class FormatUtils { mimeType: mime_types[i].split(';')[0], startWithSAP: '1', subsegmentAlignment: 'true', - lang: first_format.language as string + lang: first_format.language as string, + // Non-standard attribute used by shaka instead of the standard Label element + label: first_format.audio_track?.display_name as string }, children); period.appendChild(set);