Closed ghost closed 3 years ago
I found a way of switching the camera, just:
videoCapturer.dispose();
videoCapturer = createVideoCapturer();
videoCapturer.initialize(surfaceTextureHelper, this.getApplicationContext(), videoSource.getCapturerObserver());
videoCapturer.startCapture(VIDEO_SIZE_WIDTH, VIDEO_SIZE_HEIGHT, VIDEO_FPS);
Although it would be nice to have some kind of abstraction.
I'm aware this issue exists: https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-android/issues/38
But the answer doesn't solves the problem and is only suitable for web. I think a reset of the peer connection is too drastic just to switch the camera, there must be another option. Any hints on how to switch the camera while streaming in Android?
Thanks in advance