opentok-ios-sdk-samples-swift
opentok-ios-sdk-samples-swift copied to clipboard
Not able to see camera preview after stopping screen-sharing.
Hi,
I have made a demo in which Video Call and also there is an option to share the screen.
I have taken the global variable of a publisher.
For starting screen sharing, I used below code.
func setupScreenSharing() {
publisher.videoType = .screen
publisher.audioFallbackEnabled = false
capturer = ScreenCapturer(withView: view)
publisher.videoCapture = capturer
}
To stop screen sharing, and a setback to the camera, I used below code.
func resetVideoCallSettings() {
publisher.videoCapture?.releaseCapture()
capturer?.stop()
publisher.videoType = .camera
publisher.audioFallbackEnabled = false
publisher.publishVideo = true
publisher.publishAudio = true
publisher.cameraPosition = .front
}
But not getting any success, please let me know what I did wrong.
Thanks.
@robjperez @Lucashuang0802 Facing the same issue. Please help.