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

MediaStream stop() is deprecated #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

manuelodelain
Copy link
Contributor

Use MediaStreamTrack stop() instead of MediaStream stop().

https://developers.google.com/web/updates/2015/07/mediastream-deprecations

@manuelodelain manuelodelain changed the title MediaStream stop() is deprecated MediaStream stop() is deprecated Sep 14, 2015
@jhuckaby
Copy link
Owner

Thanks for catching this. However, the MediaStream stop() thing was added specifically for a Firefox bug (that's why it is wrapped in a try/catch). I don't want to remove that code, as I think Firefox hasn't yet updated to the recommended MediaStreamTrack implementation, and it would break things in current browser versions. So maybe we can add both implementations?

try { this.stream.stop(); } catch (e) {;}
try { this.stream.getTracks()[0].stop(); } catch (e) {;}

Seem ok? Even after MediaStream stop() is removed, it won't cause problems if it is wrapped in a try/catch.

@manuelodelain
Copy link
Contributor Author

Seems that Firefox implements MediaStreamTrack.stop() since the version 34.
https://developer.mozilla.org/fr/docs/Web/API/MediaStreamTrack/stop

I don't have problem with the latest Firefox version (40.0.3).

What was the bug with Firefox ?

@jhuckaby
Copy link
Owner

Darn, I can't find the issue now. It was a while ago. I'll go ahead and implement your change, after I test it on all browsers / platforms. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants