feat(FormatUtils): Support multiple audio tracks in the DASH manifest #308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently the DASH manifest doesn't include any language or default track information, which is fine for videos that only have a single audio track/language, as the player will just pick the first audio format that it can play, however for videos with multiple different audio track in different languages, that means that the player still picks the first one it can play, which is likely to be in a different language than the original video audio. For Mr. Beast videos that means listening to the video in Arabic, with no way to change it.
If the video has multiple languages, this pull request adds the language and default track information to the DASH manifest. I also added the audioSamplingRate, as the DASH specification says that it should be included in the manifest, that will now be included for all audio formats regardless of whether the video has multiple languages or not.
So far I've only tested these changes with FreeTube and video.js correctly selected the default track and also picked up on the different languages (as we don't have a language picker yet you have to dig around in video.js at runtime to notice that it knows about the different languages). So testing this with other players might be a good idea.
https://dashif-documents.azurewebsites.net/DASH-IF-IOP/master/DASH-IF-IOP.html#audio-constraints
Type of change
Checklist: