opentok / opentok-ios-sdk-samples-swift

Sample applications using the OpenTok iOS SDK in Swift
https://tokbox.com/
MIT License
137 stars 65 forks source link

How do you stop a Publisher that is not published to a session? #205

Closed derekpitts28 closed 4 months ago

derekpitts28 commented 8 months ago

In our use case we create a publisher that shows a preview of the users camera to the user BEFORE connecting to the session. Currently i see no way to 'stop' the publisher. The android SDK has an onStop call that stops the camera but there is no such call in the iOS SDK.

goncalocostamendes commented 8 months ago

@derekpitts28 the best way to stop the camera while on preview is to simply call [_publisher setPublishVideo:false]; which will stop the video and release the capturer. To display it simply call [_publisher setPublishVideo:true];

goncalocostamendes commented 4 months ago

@derekpitts28 I hope your doubt was cleared. I've also answered the same question on your Android and iOS sample repos. I will close the ticket. If you still have any doubts, please let me know