Support for stream with multiple subtitle types
Created by: Wayne-Morgan
Environment
-
The MPD passes the DASH-IF Conformance Tool on http://dashif.org/conformance.html -
The stream has correct Access-Control-Allow-Origin headers (CORS) -
There are no network errors such as 404s in the browser console when trying to play the stream -
The issue observed is not mentioned on https://github.com/Dash-Industry-Forum/dash.js/wiki/FAQ -
The issue occurs in the latest reference client on http://reference.dashif.org/dash.js/ and not just on my page
- Link to playable MPD file: Any stream which provides subtitles both as "text/vtt" AND "application/mp4"
- Dash.js version: 2.6.7
- Browser name/version: Chrome, IE, Edge, Safari
- OS name/version: iOS, Windows
Steps to reproduce
- Play the stream with subtitles switched off by default
- Observe subtitles
Observed behaviour
Subtitles are displayed even though the menu says they are off (if subtitles are switched on then off, behaviour is okay)
Analysis
On investigation it was found that the BufferControllers for both text and fragmentedText refer to the same instance of TextSourceBuffer. They both call the initialize() method: the second call overwriting the configuration made by the first call. I suspect that many problems may be caused by multiple uses of the TextSourceBuffer object, but this particular problem seems to be caused by the overwriting of the mediaInfos array. The text/vtt subtitles end up with an index of -1, so are enabled when they should be disabled.
If multiple subtitle types cannot be supported, then it would be good if priority is given to one type, so that one of the subtitle types behaves correctly.
Console output
Console output can be provided if necessary, but I'll have to edit it to remove references to customer streams.