Zooming and flashlight

1,011 views
Skip to first unread message

Shweta

unread,
Mar 13, 2018, 6:00:12 AM3/13/18
to discuss-webrtc

I am looking for zooming and flash light implementation in android with webrtc.

 

I have tried using  CameraManager manager for flash but it gives exception . 
 
CameraManager camManager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
String cameraId = null; // Usually back camera is at 0 position.
try {
    cameraId = camManager.getCameraIdList()[0];
    camManager.setTorchMode(cameraId, true);   //Turn ON
    isFlashOn = true;
    btnSwitch.setImageResource(R.drawable.icons_flash_on);
} catch (CameraAccessException e) {
    e.printStackTrace();
}
 
 
Exception
 
CAMERA_IN_USE (4): setTorchMode:1483: Torch for camera "0" is not available due to an existing camera user
 
 
For zooming I have tried using camara parameters but it did not work.
 
if (zoom >= 0 && zoom < maxZoom) {
    zoom++;
    params.setZoom(zoom);
    camera.setParameters(params);
}

 

Apparao Mulpuri

unread,
Mar 14, 2018, 7:42:15 AM3/14/18
to discuss-webrtc
From the WebRTC source code, the CameraManager, which is managing the Camera devices once the Video call is started is not exposed with the public interface. 

So for now, you can't do the enable flash or zoom in Android with new Camera Manager instance. However, its possible in iOS since there Webrtc uses AVFoundation library.

- Apparao

Lucas K

unread,
May 16, 2018, 2:31:04 AM5/16/18
to discuss-webrtc
Are there any updates in terms of when enabling flash will be supported? thanks

googl...@ixperta.com

unread,
Jul 27, 2018, 3:33:14 AM7/27/18
to discuss-webrtc
Any update??

Zion Cohen

unread,
Aug 23, 2019, 7:38:53 PM8/23/19
to discuss-webrtc
Is there any plan to enable flash or zoom in Android WebRTC? if yes than when?


On Wednesday, 14 March 2018 13:42:15 UTC+2, Apparao Mulpuri wrote:

Salih Yalçın

unread,
May 27, 2020, 5:57:19 AM5/27/20
to discuss-webrtc
Hi, 

What are the latest news about this issue ? Has anyone find a solution for this ? 

Lothar Schulz

unread,
Dec 10, 2020, 7:59:45 AM12/10/20
to discuss-webrtc

I'd love to have this feature available.
Thanks in advance for updating this thread with the latest status.

Reply all
Reply to author
Forward
0 new messages