dash.js
Open Source Media Player
Seamless and reliable DASH streaming on any browser-based device
View onGitHub
5287
1707
46.1k
Sponsors
Trusted by the industry leaders
Latest updates from GitHub
fix Settings sanitizer for initialTrackSelection based on idthis implements proposed changes from https://github.com/Dash-Industry-Forum/dash.js/issues/4737
additionally it adds two unit tests for MediaController and id-based initial track selectionOpened by stschr—yesterday
MediaController.setInitialMediaSettingForType() cannot filter on IdIt seems that it should be possible to specify the track id explicitly like this:
```
player.setInitialMediaSettingsFor('audio', { id: 'audio-und-mp4a' })
```
and the code in MediaController.setInitialMediaSettingForType() has the following line:
```
filteredTracks = filterTracksBySettings(filteredTracks, matchSettingsId, settings)
```
However, it's not possible to specify an initial setting because the id is filtered out in MediaPlayer._sanitizeSettings()
Sample file is here: https://content.media24.link/Dune2/manifest.mpd
Patch is simple.
```
--- a/src/streaming/MediaPlayer.js
+++ b/src/streaming/MediaPlayer.js
@@ -2725,6 +2725,9 @@ function MediaPlayer() {
return null;
}
+ if (value.id) {
+ output.id = value.id;
+ }
if (value.lang) {
output.lang = value.lang;
}
```Opened by gmcgarry—2 days ago
`enableManifestDurationMismatchFix` does not work for periods without `duration` field##### Environment
<!-- Replace [] with [x] to check off the list -->
- [x] The MPD passes the DASH-IF Conformance Tool on https://conformance.dashif.org/
- [x] The stream has correct Access-Control-Allow-Origin headers (CORS)
- [x] There are no network errors such as 404s in the browser console when trying to play the stream
- [x] The issue observed is not mentioned on https://github.com/Dash-Industry-Forum/dash.js/wiki/FAQ
- [x] The issue occurs in the latest reference client on http://reference.dashif.org/dash.js/ and not just on my page
* Dash.js version: v4.7.4 (haven't try with v5, but read the code. Issue should still exists)
* Browser name/version: Chrome
* OS name/version: Mac
##### Steps to reproduce
Set `enableManifestDurationMismatchFix` to true and play an asset with duration mismatch issue and some periods in the MPD does not have `duration` field.
##### Observed behavior
The duration is still the incorrect value from `MediaPresentationDuration` instead of the sum of all periods.
##### Root cause
https://github.com/Dash-Industry-Forum/dash.js/blob/development/src/streaming/ManifestLoader.js#L218
When calculating sum of all periods, currently, we are
```const sumPeriodDurations = manifest.Period.reduce((totalDuration, period) => totalDuration + period.duration, 0);```
Therefore, if there are any periods without `duration`, `sumPeriodDuration` will be `NaN`, and it will not continue to do the duration fix.
##### Potential fix
Use the `SegmentTemplate` to calculate the real duration.
Opened by KimmyWFox—2 days ago