I am developing an Android video call using Sinch, and I am following Sinch training materials and samples. Most of them work fine, but I ran into two problems that I have no idea how to solve them.
1) I can not resume rendering the video. Scenario: When I set up the call, everything works fine, then I exit the operation without freezing (so the video call still continues). When I restart my work again, localview (my own camera) will not continue rendering. This makes the other phone see me as if the video call is stuck / stuck.
@Override
public void onServiceConnected(ComponentName name, IBinder svc)
{
service = ((ServiceChat.ChatBinder) svc).getService();
VideoController controller = service.GetSinchVideoController();
if(controller != null)
{
localVideo.addView(controller.getLocalView());
remoteVideo.addView(controller.getRemoteView());
}
}
@Override
protected void onDestroy()
{
VideoController controller = service.GetSinchVideoController();
if(controller != null)
{
localVideo.removeView(controller.getLocalView());
remoteVideo.removeView(controller.getRemoteView());
}
super.onDestroy();
}
2) Another problem that I am facing is that I cannot switch the camera
private void SwitchCamera()
{
VideoController controller = service.GetSinchVideoController();
if(controller.getCaptureDevicePosition() == Camera.CameraInfo.CAMERA_FACING_FRONT)
{
controller.setCaptureDevicePosition(Camera.CameraInfo.CAMERA_FACING_BACK);
}
else
{
controller.setCaptureDevicePosition(Camera.CameraInfo.CAMERA_FACING_FRONT);
}
}
but i got this error
org.webrtc.Logging: VideoCapturerAndroid: Ignoring camera switch request.
org.webrtc.Logging: VideoCapturerAndroid: Could not switch to camera with id 0
- , ? ,