Skip to content

Add navigator.mediaDevices.getUserMedia(), deprecate old method #342

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

Merged

Conversation

rtyley
Copy link
Contributor

@rtyley rtyley commented Nov 29, 2018

The navigator.getUserMedia() method is deprecated, and in fact during our hackday, I found that I could gain Firefox support just by using the navigator.mediaDevices.getUserMedia() method instead, which is documented as having good cross-browser support. The deprecation seems to have occurred around 28th May 2014.

The `navigator.getUserMedia()` method is deprecated:

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia

...and in fact during hacking [1], I found that I could gain Firefox
support just by using the `navigator.mediaDevices.getUserMedia()` method
instead, which is documented as having good cross-browser support:

https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Browser_compatibility

The deprecation seems to have occurred around 28th May 2014:

w3c/mediacapture-main@de3bdaf#diff-ea76d38900f79cfae8f60e5f7cf16dd1R2755

[1] https://twitter.com/rtyley/status/1067815067780087808
*
* @see [[https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia]]
*/
def mediaDevices: MediaDevices
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Scaladoc does not correspond to this member. You took the one from MediaDevices but it should be the one from Navigator.mediaDevices.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be best to add = js.native to that method, so that it is not considered as abstract. This is what we typically do for interfaces that are actually implemented natively by the DOM.

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@sjrd sjrd merged commit 4cf1503 into scala-js:master Nov 30, 2018
@rtyley
Copy link
Contributor Author

rtyley commented Nov 30, 2018

Thank you - it's a pleasure using scalajs!

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.

2 participants