Closed Bug 1279936 Opened 8 years ago Closed 5 years ago

Support unprefixed navigator.getUserMedia()

Categories

(Core :: WebRTC: Audio/Video, task, P3)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: foolip, Unassigned, NeedInfo)

References

Details

(Keywords: site-compat)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36

Steps to reproduce:

Try using navigator.getUserMedia({audio:true}).


Actual results:

The method is not implemented, so an exception is thrown.


Expected results:

https://bugzilla.mozilla.org/show_bug.cgi?id=729522 is marked as fixed, but only mozGetUserMedia is supported. The unprefixed variant should also be there. Only 3 arguments though:
https://w3c.github.io/mediacapture-main/getusermedia.html#navigatorusermedia-interface-extensions
Component: Untriaged → Device Permissions
Afaik we have no plans to unprefix this legacy API.

I draw this conclusion from the fact that we unprefixed all WebRTC methods in Firefox 44, except this one. Our thinking then was that it doesn't make sense to introduce NEW legacy apis, and we wanted instead to drive convergence around navigator.mediaDevices.getUserMedia.
Status: UNCONFIRMED → NEW
Component: Device Permissions → WebRTC: Audio/Video
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Priority: -- → P5
It is in the spec, if you have no plans to support it can you raise a spec issue to figure out a path to interop here?
OK I've filed https://github.com/w3c/mediacapture-main/issues/368.

Note that there is no *legacy* interop issue here.

The only issue would be people writing *new* code only using this new legacy API, forgoing the interop dance:

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

We finally have proper use counters—that count pageloads—for

  • navigator.mozGetUserMedia: 0.003% vs.
  • navigator.mediaDevices.getUserMedia: 0.013%

Even though these are overall miniscule numbers, they suggest a solid 21% of all gUM calls are still callback based, which is sad. This isn't even accounting for people failing to do the prefix dance in comment 3.

Caveat: we still only have beta numbers, not release numbers, and there's a suspicion a number of gUM calls may be from fingerprinting libraries, which tend to favor old APIs for broadest impact.

But at some point, instead of moving people to use the navigator.mediaDevices.getUserMedia promise version, our approach here may actually entrench people to stick with prefixes—or confuse them about their necessity—hindering bug 1531812.

I see two ways to read these numbers:

  1. 21% is high enough that we should bite the bullet and implement the callback-based navigator.getUserMedia like the spec says.
  2. 0.003% is low enough that we could simply remove navigator.mozGetUserMedia and suffer the consequences.

The only reason to take option 2 would be to take a web compat hit in hopes of forcing people to switch to using promises. A noble action, though perhaps not an effective one. A product decision perhaps?

Flags: needinfo?(drno)
Priority: P5 → P2
Keywords: site-compat

Actually, there are more reasons to support 2:

  1. We have company: Safari does not support navigator.getUserMedia either.
  2. It's listed under Legacy Interface Extensions with a note saying "there is ongoing discussion as to a) whether it still belongs in the specification", and I can't find a wpt test for it.

Given comment 6, which I had forgotten, I'm going to reverse myself and suggest we keep an eye on this for a while longer.

The navigator.mozGetUserMedia number may drop further once bug 1528031 lands, since it removes navigator.mozGetUserMedia in http (trading 68's NotAllowedError for TypeError on http access, i.e. no longer triggering telemetry.)

Just leaving a record that I had this conversation with myself. 😉

Flags: needinfo?(drno)
Priority: P2 → P3

Unfortunately, the navigator.mozGetUserMedia insecure use counter is not showing up in the UX, so we don't know what that drop will be. The underlying telemetry seems missing. Nico, any idea why this might be?

Flags: needinfo?(na-g)
Type: defect → task

jib, nico, please followup on this when you have time. I see there is the site-compat keyword, but I don't know if this is really a compat issue.

Flags: needinfo?(jib)
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(jib)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.