- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any way to switch from the front facing cam to the rear cam in the android client?
If not, can I set the rear camera as the default for the stream?
- Tags:
- HTML5
- JavaScript*
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Vinay,
yes, it's possible. I've done it with the following solution in the MainActivity:
1. Get the cameras
private void showCameraList() {
CameraType[] camTypes = MediaStreamParameters.getCameraList();
if(camTypes.length == 1){
selectedCam = 0;
joinRoom();
}else{
int camNumber = camTypes.length;
ArrayList<String> cams = new ArrayList<String>();
for (int i = 0; i < camNumber; i++) {
cams.add(camTypes.name());
}
CharSequence[] cs = cams.toArray(new CharSequence[cams.size()]);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Choose CAM");
builder.setCancelable(false);
builder.setItems(cs, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
// Do something with the selection
selectedCam = item;
joinRoom();
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
Does the following:
If theres only 1 cam present it joins the room directly. If there are more, it lets you choose the camera and sets the index to a variable (selectedCam).
2. set Parameters
I cannot remember where, but you'll need to set the Parameters like this:
private MediaStreamParameters msp;
msp = new MediaStreamParameters(true, true);
msp.setResolution(size.x, size.y);
msp.setCameraId(selectedCam);
localView = new VideoStreamsView(CallActivity.this.getApplicationContext(), size);
runOnUiThread(new Runnable() {
public void run() {
localContainer.addView(localView);
}
});
localStream = new Stream(msp);
localStream.attach(localView);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
https://software.intel.com/en-us/forums/topic/543285 should help solve this issue. Let us know in case you have further issues.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page