I am using the pubnub Android sdk to create a Basic Streaming app so far it works great. While Streaming I would like to Change the camera. I though of just creating a button which Switches the camera.
Currently the camera picker part in the VideoChatActivity class Looks like this (inside the oncreate method):
int camNumber = VideoCapturerAndroid.getDeviceCount();
String frontFacingCam = VideoCapturerAndroid.getNameOfFrontFacingDevice();
String backFacingCam = VideoCapturerAndroid.getNameOfBackFacingDevice();
// Creates a VideoCapturerAndroid instance for the device name
VideoCapturer capturer = VideoCapturerAndroid.create(frontFacingCam);
It basically picks the front camera and streams the view. How can I make it simple that an onclick Event changes the camera?