7

In my one to one video calling app using OpenTok, the publisher's view becomes black after it goes to background mode and enters foreground. The subscriber is also not able to see the view(only seeing black box).

I am setting the publisher and subscriber properties as such:

publisher.publishVideo = true

subscriber.subscribeToVideo = true

Any solution will be very helpful.

Manik
  • 1,495
  • 11
  • 19
  • TokBox Developer Evangelist here. Could you please share which platform you're using? (iOS or Android) – Manik Nov 08 '18 at 22:14
  • We are using iOS platform – Muhammad Raza Nov 09 '18 at 05:01
  • It's important to note that you need to make some changes so you can run the application in background mode while in an OpenTok Session and reclaim the publisher's video when you come back into foreground. For more information, please visit: https://tokbox.com/developer/sdks/ios/background-state.html – Manik Nov 09 '18 at 22:16
  • i am calling doPublish() Again when application comes in foreground but it gives me a error in result. ' Error Domain=OTSessionErrorDomain Code=1011 "(null)" ' here is my code, lazy var publisher: OTPublisher = { let settings = OTPublisherSettings() settings.videoTrack = isVideoEnable settings.audioTrack = true settings.name = UIDevice.current.name return OTPublisher(delegate: self, settings: settings)! }( – Syed Zeeshan Nov 12 '18 at 07:32
  • func doPublish() { publisher.publishAudio = true publisher.publishVideo = true publisher.cameraPosition = .front session?.publish(publisher, error: &error) guard error == nil else { print(error!) return } guard publisher.view != nil else { return } publishView = publisher.view } – Syed Zeeshan Nov 12 '18 at 07:36
  • Hey Syed, you cannot publish the same publisher when it's already publishing. Could you file an issue in the following repo so I can help you debug further? https://github.com/opentok/opentok-ios-sdk-samples-swift – Manik Nov 13 '18 at 01:51
  • Done! https://github.com/opentok/opentok-ios-sdk-samples-swift/issues/75 – Syed Zeeshan Nov 13 '18 at 07:36
  • I'm also seeing this issue on android. – Svetlana Rozhkova Jun 02 '20 at 14:15

0 Answers0