Closed Bug 1011878 Opened 10 years ago Closed 9 years ago

mozGetUserMediaDevices doesn't work until getUserMedia is called

Categories

(Core :: WebRTC: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1046245

People

(Reporter: mayanktg, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release)
Build ID: 20140506152807

Steps to reproduce:

Call mozGetUserMediadevices(); with parameters - contraints, successCallback and errorCallback.


Actual results:

The successcallback or errorcallback for mozGetUserMediaDevices is not called until getUserMedia() has been called once before.



Expected results:

Irrespective of whether one has used getUserMedia before or not, function mozgetUserMEdiaDevices should call either successCallback or errorCallback.

Please specify if it's defined to work upon getUserMedia call.
Status: UNCONFIRMED → NEW
Component: WebRTC → WebRTC: Audio/Video
Ever confirmed: true
mozGetUserMediadevices() is internal - see Bug 793446, comment 3 - and is part of the implementation of getUserMedia(). I don't believe it is meant to function independently.

Not to be confused with getMediaDevices() http://dev.w3.org/2011/webrtc/editor/getusermedia.html#navigatorusermedia which doesn't exist yet. We could perhaps repurpose this bug for this, if we don't have one already (I couldn't find it).
(In reply to Jan-Ivar Bruaroey [:jib] from comment #1)
> mozGetUserMediadevices() is internal - see Bug 793446, comment 3 - and is
> part of the implementation of getUserMedia(). I don't believe it is meant to
> function independently.

Some more context here:
- Mayank's code is running in chrome, not web-content.
- The bug he is working on is bug 975542, and he's trying to disable a button in the UI if there's no camera connected to the computer. Is there any way to do this currently?
Attached patch Best guess fixSplinter Review
Does this help?
Attachment #8424849 - Flags: feedback?(mayanktg)
Comment on attachment 8424849 [details] [diff] [review]
Best guess fix

Review of attachment 8424849 [details] [diff] [review]:
-----------------------------------------------------------------

mozGetUserMediaDevices still seem to be dependent on gUM. I tried using it without gUM still the results are same as described in previous comments. Maybe as Jan-Ivar said it isn't meant to function independently.
Comment on attachment 8424849 [details] [diff] [review]
Best guess fix

Thanks for looking into this, the patch doesn't help unfortunately.

Here are detailed steps to reproduce to help debugging:

1. Set devtools.chrome.enabled to true in about:config
2. Tools -> Web Developer -> Browser Console
3. Tools -> Web Developer -> Scratchpad
4. In the Scratchpad's menu, Evnrionment -> Browser 
5. Paste this in the scratchpad:
navigator.mozGetUserMedia({audio: true}, function () {window.console.log("GUM success!");}, function () {window.console.log("GUM Error!");});

navigator.mozGetUserMediaDevices(
  { video: false,
    audio: true
  },
  devices => { 
    window.console.log("Number of audio devices: " + devices.length);
  },
  error => { window.console.log("Error!");}
);

6. Select the gUMD call, press Command+R and observe that nothing is logged in the Browser Console.
7. Select the gUM call, press Command+R. "GUM success!" should be logged to the Browser Console.
8. Select the gUMD call again, press Command+R and see that it now logs "Number of audio devices: <some number>"
Attachment #8424849 - Flags: feedback?(mayanktg) → feedback-
Blocks: 1025150
The desired behavior should be covered by navigator.mediaDevices.enumerateDevices().
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: