Skip to content

Commit

Permalink
feat(toDash): Add audio track labels to the manifest when available (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed May 14, 2023
1 parent 046103a commit 84b4f1e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/utils/FormatUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,22 @@ 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', {
id: `${set_id++}`,
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);
Expand Down

0 comments on commit 84b4f1e

Please sign in to comment.