I am creating demo with OpenTok
library. It is created and working fine so far.
Now I want to implement hold / pause feature in video call. But I can't find direct method to put call on hold or we can say pause video call in between.
Can we put video call on hold ? If yes, then how ?
Has anyone idea about that ?
I have refered this link : Putting a video call on hold with OpenTok But it is for .js
Update : 1
I have created properties for required Objects :
var otSession: OTSession!
var otPublisher: OTPublisher!
var otSubscriber: OTSubscriber!
And did required code for connecting session and put delegate methods.
Now on button click I want to pause video call, for that :
@IBAction func pauseVideo(_ sender: UIButton) {
if otPublisher != nil {
sender.isSelected = !sender.isSelected
otPublisher?.publishVideo = !(otPublisher?.publishVideo)!
}
if sender.isSelected {
self.lblPause.text = "Call paused..!!"
self.lblPause.isHidden = false
otSubscriber.view?.isHidden = true
otSubscriber.view?.backgroundColor = UIColor.black
} else {
self.lblPause.isHidden = true
otSubscriber.view?.isHidden = false
otSubscriber.view?.backgroundColor = UIColor.white
}
}
It's working fine, But now on the other hand how they know that on first end video call put on hold ?
If one end it is on hold, then other side as well we have to hide video view and make it black. Other end may be admin panel or mobile app.