I use simplewebrtc.com's webrtc solution (see https://simplewebrtc.com/demo.html). When you join the room the front camera will be used. But i want to use back camera. There is info page (see "Selecting a microphone and camera" at https://simplewebrtc.com/notsosimple.html ) for that but i couldn't implement it. Could anybody help me please?
Asked
Active
Viewed 2,588 times
1 Answers
0
first: In webrtc i think this should be handled in constraints passed to getUserMedia.
{ audio: true, video: { facingMode: { exact: "environment" } } }
you can log the lable of the using video device in browser's console:
var videoTracks = localStream.getVideoTracks();
if (videoTracks.length > 0) {
trace('Using video device: ' + videoTracks[0].label);
}
second: In browser's setting you can set default camera, e.g. in chrome go to Settings>Advanced>Content Settings>Camera

Ali Abdollahi
- 143
- 11
-
1There is no option to select the camera in Chrome settings. I couldn't implement your code. Where should i add it? – Cenk Ten Sep 06 '17 at 13:45
-
The localStream variable in the code is the stream returned from getUserMedia. – Ali Abdollahi Sep 10 '17 at 06:51
-
Check this for browser settings https://stackoverflow.com/questions/14610945/how-to-choose-input-video-device-for-webrtc – Ali Abdollahi Sep 10 '17 at 06:53
-
and this http://support.doublerobotics.com/customer/portal/articles/1273966-how-to-change-the-camera-or-mic-chrome-uses – Ali Abdollahi Sep 10 '17 at 06:54