Error and switch on SourceBuffer append requests for non-existing tracks #5485
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.
This PR will...
Error and switch on SourceBuffer append requests for non-existing tracks.
Why is this Pull Request needed?
Prevents the player from stalling when encountering muxed "audiovideo" (mp4) after setting up with unmuxed "video" and "audio" SourceBuffers (TS or unmuxed main and alt-audio mp4)
Are there any points in the code the reviewer needs to double check?
There may be cases where muxed mp4 content could be appended into either a "video" or "audio" SourceBuffer (but not both). Only some MSE implementations handle this, ignoring the unrecognized tracks, but some devices do not (iPad for example). Either way, that is not correct behavior, or behavior we should support. Mixing content in HLS this way is not the best for compatibility an should not be supported.
Feature requests for unmuxing muxed mp4 when needed could be entertained (file an issue). There also may be future work that involves resetting SourceBuffers on an as-needed basis, but this comes with very obvious DOM and rendering side-effects that degrade UX. For now, handling this as an error and switching back down to a supported variant is the behavior HLS.js should take.
Resolves issues:
Related to #1510
Checklist