1

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?

Craig Conover
  • 4,710
  • 34
  • 59
tigerel
  • 317
  • 2
  • 7
  • 15
  • 1
    @Craig Conover any ideas yet ? :) – tigerel Mar 21 '18 at 14:08
  • 1
    @CraigConover so if the camera is the Switch I do not Need to changed anything to the "pubnub stream Code"? – tigerel Mar 21 '18 at 15:38
  • Well, PuNub is not streaming any video/audio. PubNub is only the signal protocol that is used to signal the other client that you are connecting to. Audio/Video is sent through non-PubNub stream. So I would doubt there is anything you need to do with PubNub in this context. – Craig Conover Mar 21 '18 at 15:43
  • @CraigConover still any idea how to fix this in your sample Android app? – tigerel Mar 21 '18 at 15:46
  • There is nothing to fix. The solution to switching the camera is in the SO link I provided above. – Craig Conover Mar 21 '18 at 15:49
  • You have an issue with changing the camera from front to back? Again, not something that is controlled by PubNub. The sample app "as is" and a bit outdated. – Craig Conover Mar 21 '18 at 18:58

0 Answers0