0

I am using Opentok code for my swift program. I have two questions.

1) I use same session in my two UIViewcontrollers. Once I open my connection with the session, should I close it before opening /connecting it in the second page?

2) sometime I am getting black screen insead of subscribers video. I use the static session created in the trial version.

Please advice.

Vinod
  • 675
  • 3
  • 7
  • 25

1 Answers1

0
var error: OTError? = nil
session.disconnect(error)
if error != nil {
print("disconnect failed with error: (\(error))")
}
session(session, streamDestroyed: stream)
  • call this in viewWillDisappear ? – Vinod Jul 18 '17 at 09:55
  • Ok, I shall try this. – Vinod Jul 18 '17 at 10:07
  • This code throws two errors. 1) Cannot invoke 'disconnect' with an argument list of type '(OTError?)' 2) Cannot call value of non-function type 'OTSession' --- here is my class https://github.com/opentok/opentok-ios-sdk-samples-swift/blob/master/Basic-Video-Chat/Basic-Video-Chat/ViewController.swift – Vinod Jul 18 '17 at 10:23