GetUserMedia fails when going from back camera to front camera but not front to back.
Reported by
cgfarm...@gmail.com,
Jul 19 2017
|
||||
Issue descriptionSteps to reproduce the problem: 1. Call getUserMedia with the deviceId of the rearCamera as a constraint. 2. Make another query to getUserMedia with the user facing camera as deviceId. What is the expected behavior? The camera works the same, regardless of starting on the rear or the front camera. What went wrong? 3. Receive TrackStreamStart error. Get user media failed! NavigatorUserMediaErrorconstraintName: ""message: ""name: "TrackStartError"__proto__: NavigatorUserMediaError Did this work before? No Does this work in other browsers? N/A Chrome version: 59.0.3071.115 Channel: stable OS Version: 26 Flash Version: The constraints such as facing:'environment' do not work either. It is very trivial to setup a test case here with an Android phone in a WebView.
,
Jul 22 2017
It looks like the issue is that both cameras cannot be open at the same time on Android, at least on some devices. I can reproduce the issue with https://jsfiddle.net/guidou/8e1cLn1j/ if I set CLOSE_FIRST to false (don't close the track from the first getUserMedia call). It works fine if I set it to true. cgfarmer4: do you get the same behavior with this script? chfremer@: do you know if this behavior is intended due to a limitation in Android?
,
Jul 24 2017
re #2: Agreed that it seems that not all devices allow opening both cameras simultaneously, see [1]. I am not aware of any Chromium-side code that would restrict to a single camera on Android. Adding mcasas@ in case I overlooked something. https://stackoverflow.com/questions/30377081/access-both-back-and-front-cameras-simultaneously
,
Jul 24 2017
I will be away from my Pixel XL for a couple weeks but your example shows using facingMode as a constraint. I have never got that constraint to work with the Pixel. The only way I was able to get it to work was to call MediaDevices.enumerateDevices() and then pass the deviceId as the optional constraint. This might be a different bug altogether. With that said, your point about both cameras being open seems to be the case in my code as I was not calling stop on the previous mediaStream of the other camera. Just seems odd that it works when you start with the front but not the other way around.
,
Jul 31 2017
I tested with Samsung Galaxy S8, Nexus 4, Nexus 5x, Pixel and Motorola X Force. Only the Nexus 5X supports opening both cameras and it works as intended. All the others fail to open the second camera if the first one is still open. This looks like it works as intended. Wrt to the facingMode constraint, it worked on all devices except the Pixel. Filed bug 750701 to track the problem with the facingMode constraint on the Pixel. Closing this bug as WontFix since it's working as intended.
,
Jul 31 2017
Thanks! |
||||
►
Sign in to add a comment |
||||
Comment 1 by emir...@chromium.org
, Jul 22 2017Status: Assigned (was: Unconfirmed)