powered by Jive Software

Camera facing mode

ofmeet open the front camera by default when using Android device. I used facingMode option in spec to select the back camera, but with no luck. Any idea? The spec I used to choose camera is below. In my test I changed “user” to “environment”.

{

mandatory: {

width: { min: 640 },

height: { min: 480 }

},

optional: [

{ width: 650 },

{ width: { min: 650 }},

{ frameRate: 60 },

{ width: { max: 800 }},

{ facingMode: “user” }

]

}

I got a workaround to choose the back camera in application from the demos along with webrtc project. The demo is located in \WebRTC\samples\js\demos\html\device-switch.html. The basic idea is to get souce id which identify front/back camera by calling MediaStreamTrack.getSources,and then pass the souce id to getUserMedia.

MediaStreamTrack.getSources(gotSources);

getUserMedia({ audio: {optional: [{sourceId: audio_source}]},

video: {optional: [{sourceId: video_source}]}

}, gotStream, function() {});

Thanks for the tip. I will raise a ticket to add this to the config.js file or somewhere