Skip to content
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

Closed
davemevans opened this issue Dec 8, 2015 · 6 comments
Milestone

Comments

@davemevans
Copy link
Contributor

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.

@LloydW93
Copy link
Member

LloydW93 commented Jan 5, 2016

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.

@wilaw
Copy link
Member

wilaw commented Jan 5, 2016

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?

@wilaw wilaw added this to the 2.0.0 milestone Jan 5, 2016
@dsparacio
Copy link
Contributor

@bbcrddave Just submitted a PR #1051 fix for #947 does this cover this issue as well.

@dsparacio
Copy link
Contributor

I think this is fixed by #1051

@davemevans
Copy link
Contributor Author

Seems to have resolved the issue - awesome!

@dsparacio
Copy link
Contributor

Nice! Thanks @bbcrddave for confirming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants