Using the Jitsi SDK for Android version 1.16.0, I seem to be unable to obtain video on a device that has a camera, but not a camera where the facingMode is ‘user’.
The same issue occurs when I build the SDK from the current tip of master.
This is the log from my application, show that there is a camera (facingmode ‘back’), but failing to use that camera for some reason.
06-20 16:08:15.444 4308-4364/nl.goodbytes.demo I/ReactNativeJS: '[modules/RTC/RTCUtils.js]', '<n>: ', 'Get media constraints', { audio: false,
video:
{ mandatory: {},
optional: [ { facingMode: 'user' } ],
facingMode: 'user' } }
06-20 16:08:15.470 4308-4308/nl.goodbytes.demo I/com.oney.WebRTCModule.WebRTCModule: getUserMedia(video): { NativeMap: {"facingMode":"user","optional":[{"facingMode":"user"}],"mandatory":{}} }
06-20 16:08:15.472 4308-4308/nl.goodbytes.demo I/CameraManagerGlobal: Connecting to camera service
06-20 16:08:15.477 4308-4308/nl.goodbytes.demo D/com.oney.WebRTCModule.WebRTCModule: Creating video capturer using Camera2 API.
06-20 16:08:15.481 4308-4364/nl.goodbytes.demo I/ReactNativeJS: '[modules/RTC/RTCUtils.js]', '<n>: ', 'Get media constraints', { audio: true, video: false }
06-20 16:08:15.488 4308-4364/nl.goodbytes.demo I/ReactNativeJS: '[modules/xmpp/xmpp.js]', '<n>: ', 'P2P STUN servers: ', [ { urls: 'stun:stun.l.google.com:19302' },
{ urls: 'stun:stun1.l.google.com:19302' },
{ urls: 'stun:stun2.l.google.com:19302' } ]
06-20 16:08:15.499 4308-4308/nl.goodbytes.demo I/com.oney.WebRTCModule.WebRTCModule: getUserMedia(audio): mandatory: [], optional: [googNoiseSuppression: true, googEchoCancellation: true, echoCancellation: true, googEchoCancellation2: true, googDAEchoCancellation: true]
06-20 16:08:15.503 4308-4308/nl.goodbytes.demo D/com.oney.WebRTCModule.WebRTCModule: MediaStream id: d45df408-f615-43e8-896b-a972885ecddc
06-20 16:08:15.513 4308-4364/nl.goodbytes.demo I/ReactNativeJS: '[modules/xmpp/xmpp.js]', '<n>: ', '(TIME) Strophe connecting:\t', 1529507295512
06-20 16:08:15.598 4308-4364/nl.goodbytes.demo W/ReactNativeJS: '[__filename]', '<s>: ', 'Calendar access not granted.'
06-20 16:08:15.601 4308-4364/nl.goodbytes.demo I/ReactNativeJS: '[modules/RTC/RTCUtils.js]', '<n>: ', 'Available devices: ', [ { facing: 'back',
label: 'Camera 0, Facing back, Orientation 0',
kind: 'videoinput',
deviceId: '0',
groupId: null },
{ facing: null,
label: 'Audio',
kind: 'audioinput',
deviceId: 'audio-1',
groupId: null } ]
06-20 16:08:15.602 4308-4364/nl.goodbytes.demo W/ReactNativeJS: '[modules/statistics/AnalyticsAdapter.js]', '<n>: ', 'Not sending an event, disposed.'
'[modules/statistics/AnalyticsAdapter.js]', '<n>: ', 'Not sending an event, disposed.'
06-20 16:08:15.605 4308-4364/nl.goodbytes.demo W/ReactNativeJS: '[__filename]', '<s>: ', 'Calendar access not granted.'
06-20 16:08:15.607 4308-4364/nl.goodbytes.demo W/ReactNativeJS: '[modules/RTC/RTCUtils.js]', '<n>: ', 'Failed to get access to local media. Error ', { name: null,
message: 'Failed to create new track',
constraintName: undefined }, { audio: false,
video:
{ mandatory: {},
optional: [ { facingMode: 'user' } ],
facingMode: 'user' } }
06-20 16:08:15.609 4308-4364/nl.goodbytes.demo E/ReactNativeJS: '[modules/RTC/RTCUtils.js]', '<n>: ', 'failed to obtain video stream - stop', [gum.general: Failed to create new track]
06-20 16:08:15.618 4308-4364/nl.goodbytes.demo W/ReactNativeJS: '[modules/statistics/AnalyticsAdapter.js]', '<n>: ', 'Not sending an event, disposed.'
06-20 16:08:15.619 4308-4365/nl.goodbytes.demo E/unknown:ReactNative: console.error: "[modules/RTC/RTCUtils.js]", "<n>: ", "failed to obtain video stream - stop", {"gum":{"error":{"name":null,"message":"Failed to create new track"},"constraints":{"audio":false,"video":{"mandatory":{},"optional":[{"facingMode":"user"}],"facingMode":"user"}},"devices":["video"]},"name":"gum.general","message":"Failed to create new track","stack":"r@index.android.bundle:719:85856\nindex.android.bundle:719:214612\nu@index.android.bundle:719:199789\nindex.android.bundle:719:200157\nindex.android.bundle:705:1290\nvalue@index.android.bundle:35:3467\nindex.android.bundle:35:1240\nvalue@index.android.bundle:35:2606\nvalue@index.android.bundle:35:1210\n[native code]"}, stack:
<unknown>@332:2579
n@719:302307
<unknown>@719:218994
<unknown>@719:214624
u@719:199789
<unknown>@719:200157
<unknown>@705:1290
value@35:3467
<unknown>@35:1240
value@35:2606
value@35:1210
06-20 16:08:15.619 4308-4364/nl.goodbytes.demo E/ReactNativeJS: '[__filename]', '<s>: ', 'Failed to create local tracks', [ 'video' ], [gum.general: Failed to create new track]
06-20 16:08:15.624 4308-4365/nl.goodbytes.demo E/unknown:ReactNative: console.error: "[__filename]", "<s>: ", "Failed to create local tracks", ["video"], {"gum":{"error":{"name":null,"message":"Failed to create new track"},"constraints":{"audio":false,"video":{"mandatory":{},"optional":[{"facingMode":"user"}],"facingMode":"user"}},"devices":["video"]},"name":"gum.general","message":"Failed to create new track","stack":"r@index.android.bundle:719:85856\nindex.android.bundle:719:214612\nu@index.android.bundle:719:199789\nindex.android.bundle:719:200157\nindex.android.bundle:705:1290\nvalue@index.android.bundle:35:3467\nindex.android.bundle:35:1240\nvalue@index.android.bundle:35:2606\nvalue@index.android.bundle:35:1210\n[native code]"}, stack:
<unknown>@332:2579
s@676:833
<unknown>@820:991
<unknown>@66:629
<unknown>@66:657
<unknown>@40:1772
b@40:628
w@40:992
callImmediates@40:3173
value@35:2778
<unknown>@35:1360
value@35:2606
value@35:1330
value@35:1265