switchCamera

public void switchCamera()

前后摄像头切换,适用于通过SDK打开默认摄像头的场景

在通话建立(IRongCallListener#onCallConnected)之后切换前后置摄像头,该方法适用于通过SDK打开默认摄像头的场景,配合 RongCallClient#startCall(Conversation.ConversationType, String, List, List, RongCallCommon.CallMediaType, String) 使用,startCall 方法默认打开前置摄像头

See also

IRongCallListener#onCallConnected

public void switchCamera(int cameraId, boolean mirror, CameraSwitchCallBack callBack)

切换指定 id 摄像头

在通话建立(IRongCallListener#onCallConnected)之后切换指定 ID 的摄像头,该方法适用于通过 SDK 打开指定摄像头的场景,配合 RongCallClient#startCall(int, boolean, Conversation.ConversationType, String, List, List, RongCallCommon.CallMediaType, String, StartCameraCallback) 使用。startCall 方法默认打开前置摄像头

Parameters

cameraId

摄像头 id

mirror

是否镜像视频流某些特殊设备将后置摄像头安装在设备的前面时,当打开后置摄像头时为了正常显示,请使用镜像处理;该参数设置仅对本地有效(发送出去的数据依然是未处理数据),如果本地视频流做了镜像处理,为了对端观看体验可以在 IRongCallListener#onRemoteUserJoined(String, RongCallCommon.CallMediaType, int, SurfaceView) 回调中添加如下设置:

                                                        public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {                                                             if (null != remoteVideo) {                                                                 ((RongRTCVideoView) remoteVideo).setMirror( boolean);//观看对方视频流是否镜像处理                                                             }                                                        }
callBack

摄像头切换回调

See also

IRongCallListener#onRemoteUserJoined(String, RongCallCommon.CallMediaType, int, * SurfaceView)
IRongCallListener#onCallConnected