-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detachMediaSource causes misleading MEDIA_ERR_SRC_NOT_SUPPORTED error message #927
Comments
Just bumping this as I'm looking at re-introducing 1.6.0's changes, particularly around #974. Do we know why we explicitly attempt to set the source to null here, or is it just for completeness of a reset? Most user agents throw this exception, plus dash.js currently follows up by attempting to play it. We mentioned this on a call a while back and I believe we said we'd see if anyone could remember why this was done at all. If not, I'll remove it again. |
There may have been early issues with captions not getting removed between content playback? Either way, I'd suggest going ahead and removing the setSource("') during player reset and then looking for problems. During reset, if we set the MediaSource instance to null, would that allow clean garbage collection and obviate the need to explicitly remove the src object from the mediaSource instance? |
@bbcrddave Just submitted a PR #1051 fix for #947 does this cover this issue as well. |
I think this is fixed by #1051 |
Seems to have resolved the issue - awesome! |
Nice! Thanks @bbcrddave for confirming |
When resetting the player, usually in an error scenario, detachMediaSource sets the media element's src attribute to an empty string (
""
), presumably in order to allow the existing MediaSource object to be garbage collected.On Chrome Desktop at least, this causes a MediaError to be thrown, and the media element error attribute set to MEDIA_ERR_SRC_NOT_SUPPORTED (4), which is then logged in the console.
This is confusing for users and also for developers when issues are reported, since the underlying problem is often (probably) nothing to do with this - see #922 for example.
Putting an empty try ... catch around the
setSource("")
might be a good place to start since we don't actually care if it goes wrong or not?I'm not really sure what the correct thing to do is, but I thought it was worth noting anyway.
The text was updated successfully, but these errors were encountered: