opentok-ios-sdk-samples-swift icon indicating copy to clipboard operation
opentok-ios-sdk-samples-swift copied to clipboard

Not able to see camera preview after stopping screen-sharing.

Open SarthakShah31 opened this issue 5 years ago • 1 comments

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.

SarthakShah31 avatar Nov 23 '18 08:11 SarthakShah31

@robjperez @Lucashuang0802 Facing the same issue. Please help.

tejas-ardeshna avatar Nov 23 '18 11:11 tejas-ardeshna