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

(webkit|moz)getUserMedia usage and webcompat issues #992

Closed
karlcow opened this issue Mar 6, 2024 · 14 comments
Closed

(webkit|moz)getUserMedia usage and webcompat issues #992

karlcow opened this issue Mar 6, 2024 · 14 comments
Labels

Comments

@karlcow
Copy link
Member

karlcow commented Mar 6, 2024

On navigator.getUserMedia still creates webcompat issues, I was trying to understand what is the current state of implementations.

API WebKit Gecko Blink
navigator.getUserMedia undefined undefined
navigator.webkitGetUserMedia undefined undefined
navigator.mozGetUserMedia undefined undefined
navigator.mediaDevices.getUserMedia

Some bugs have been opened for Gecko and Blink to deprecate/remove the prefixed version of navigator.getUserMedia

WebKit is getting breakage because of code like

navigator.getUserMedia =
  navigator.getUserMedia ||
  navigator.webkitGetUserMedia ||
  navigator.mozGetUserMedia ||
  navigator.msGetUserMedia;

Trying to explore further the implementation history around WebKit

Some questions

  • What is the usage situation for Blink, Gecko on the prefixed versions?
  • Is their will to remove them soonish? (and do site interventions at least for Gecko)
  • Or was there attempt to remove that were reverted because of compat issues?

The spec is currently saying:

This decision reflected consensus as long as the original API remained available here under the Navigator object for backwards compatibility reasons, since the working group acknowledges that early users of these APIs have been encouraged to define getUserMedia as "var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;" in order for their code to be functional both before and after official implementations of getUserMedia() in popular browsers. To ensure functional equivalence, the getUserMedia() method here is defined in terms of the method under MediaDevices.

@fippo
Copy link
Contributor

fippo commented Mar 6, 2024

Code that does look for msGetUserMedia (which was not a thing in Edge Spartan even) is doing bad things that folks in the WebRTC space agreed were for ages (2012) which led to adapter.js as something that does this kind of stuff in a more controlled fashion.

Usage for chromium is small but not zero: https://webrtchacks.github.io/chromestatus/?buckets=1401,1402
See also webrtcHacks/adapter#764 (five years... oops)

@karlcow
Copy link
Member Author

karlcow commented Mar 6, 2024

See also webrtcHacks/adapter#764 (five years... oops)

Oh nooooo… ! 😭

@karlcow
Copy link
Member Author

karlcow commented Mar 6, 2024

Usage for chromium is small but not zero: https://webrtchacks.github.io/chromestatus/?buckets=1401,1402

as of today around 0.008% of page loads.
I wonder what is the opinion of @foolip on this.

@fippo
Copy link
Contributor

fippo commented Mar 6, 2024

That is still 4% of relative usage sadly. It isn't in video conferencing, the usage is pretty flat.

But good news, I think I figured out why people might be copy-pasting this:
https://web.dev/articles/getusermedia-intro?hl=en
still mentions it... that should be fixable!

@eladalon1983
Copy link
Member

@beaufortfrancois

@karlcow
Copy link
Member Author

karlcow commented Mar 7, 2024

@samdutton would it be possible to change the article content on https://web.dev/articles/getusermedia-intro?hl=en
so that the code is using the more modern API call.

@beaufortfrancois
Copy link
Contributor

I'll be happy to update https://web.dev/articles/getusermedia-intro. Please let me know which changes you'd like to make to the article.

@gsnedders
Copy link
Member

What is the usage situation for Blink, Gecko on the prefixed versions?

Note the question isn't really just about the prefixed versions; it's also about the non-standard (or at least "not normatively defined in any standard") navigator.getUserMedia.

@beaufortfrancois
Copy link
Contributor

As discussed offline with @fippo, I'm in the process of updating https://web.dev/articles/getusermedia-intro.

@beaufortfrancois
Copy link
Contributor

FYI https://web.dev/articles/getusermedia-intro has been updated.

@fippo
Copy link
Contributor

fippo commented Mar 27, 2024

webrtcHacks/adapter#764 has been addressed by the newly published 9.0.0. How long that will take to get adopted...

@jan-ivar
Copy link
Member

Firefox is blocked on essentially the same issue webrtcHacks/adapter#1156.

@foolip
Copy link
Member

foolip commented Apr 16, 2024

Perhaps the spec should just spec these aliases conditional on https://html.spec.whatwg.org/multipage/system-state.html#concept-navigator-compatibility-mode?

@aboba
Copy link
Contributor

aboba commented Aug 8, 2024

Closing - not a spec issue.

@aboba aboba closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants