After some search in source code, I’m able to set back camera in this way:
easyrtc.getVideoSourceList( function(list) {
var i;
for( i = 0; i < list.length; i++ ) {
alert("label=" + list[i].label + ", id= " + list[i].id);
if(list[i].label.indexOf('back') > 0){ // Searching for label containing back (for back camera)
easyrtc.setVideoSource(list[i].id); // Set the id of back camera. Must be called before easyrtc.initMediaSource()
easyrtc.initMediaSource(
function(){ // success callback
var selfVideo = document.getElementById("self");
easyrtc.setVideoObjectSrc(selfVideo, easyrtc.getLocalStream());
easyrtc.connect("Company_Chat_Line", connectSuccess, connectFailure);
},connectFailure
);
break;
}
}
For version v1.0.17 use list[i].deviceid
instead of list[i].id