capacitor-plugin-vonage 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
|
|
14
14
|
s.ios.deployment_target = '13.0'
|
15
15
|
s.dependency 'Capacitor'
|
16
16
|
#s.dependency 'OpenTok','2.25.0'
|
17
|
-
s.dependency 'OTXCFramework','2.
|
17
|
+
s.dependency 'OTXCFramework','2.27.0'
|
18
18
|
s.swift_version = '5.1'
|
19
19
|
s.static_framework = true
|
20
20
|
end
|
@@ -104,16 +104,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
104
104
|
NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil)
|
105
105
|
NotificationCenter.default.addObserver(self, selector: #selector(setPatientOnlineStatus), name: NSNotification.Name ("PatientOnlineStatus"), object: nil)
|
106
106
|
NotificationCenter.default.addObserver(self,selector:#selector(endVideoCall(_:)),name: NSNotification.Name ("EndVideoCall"),object: nil)
|
107
|
-
|
108
|
-
//
|
109
|
-
// self.connectToAnOpenTokSession()
|
110
|
-
// })
|
111
|
-
// if(isVideoMute){
|
112
|
-
// subscriberImg.isHidden = true
|
113
|
-
// }else{
|
114
|
-
// subscriberImg.isHidden = false
|
115
|
-
// }
|
116
|
-
// turnOnAndOffVideo()
|
107
|
+
|
117
108
|
}
|
118
109
|
func showActivityIndicator() {
|
119
110
|
activityView = UIActivityIndicatorView(style: .large)
|
@@ -132,11 +123,14 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
132
123
|
print("viewDidDisappear")
|
133
124
|
super.viewDidDisappear(animated)
|
134
125
|
let userInfo = ["userInfo": ["isProvider": self.isProvider]]
|
135
|
-
|
136
|
-
|
137
|
-
|
126
|
+
if(!isCallEnded){
|
127
|
+
NotificationCenter.default.post(name: NSNotification.Name(NotificationNames.videoEnded),object: nil,userInfo: userInfo)
|
128
|
+
|
129
|
+
// NotificationCenter.default.removeObserver(self, name: NSNotification.Name("EndVideoCall"), object: nil)
|
130
|
+
|
131
|
+
NotificationCenter.default.post(name: NSNotification.Name("RemoveObservers"),object: nil,userInfo: userInfo)
|
132
|
+
}
|
138
133
|
NotificationCenter.default.removeObserver(self)
|
139
|
-
NotificationCenter.default.post(name: NSNotification.Name("RemoveObservers"),object: nil,userInfo: userInfo)
|
140
134
|
}
|
141
135
|
@objc func appMovedToBackground() {
|
142
136
|
print("App moved to background!")
|
@@ -177,11 +171,13 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
177
171
|
NotificationCenter.default.removeObserver(self, name: NSNotification.Name("EndVideoCall"), object: nil)
|
178
172
|
}
|
179
173
|
func startTimer(){
|
180
|
-
timer.
|
174
|
+
if(timer != nil && timer.isValid){
|
175
|
+
timer.invalidate()
|
176
|
+
}
|
181
177
|
timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(timerAction), userInfo: nil, repeats: true)
|
182
178
|
}
|
183
179
|
func stopTimer(){
|
184
|
-
if(timer.isValid){
|
180
|
+
if(timer != nil && timer.isValid){
|
185
181
|
timer.invalidate()
|
186
182
|
counter = 0
|
187
183
|
}
|
@@ -440,10 +436,11 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
440
436
|
let userInfo = ["userInfo": ["isProvider": isProvider]]
|
441
437
|
|
442
438
|
NotificationCenter.default.post(name: NSNotification.Name(NotificationNames.videoEnded),object: nil,userInfo: userInfo)
|
443
|
-
self.session?.disconnect(nil)
|
444
|
-
self.stopTimer()
|
445
|
-
self.dismiss(animated: true, completion: nil)
|
446
|
-
NotificationCenter.default.post(name: NSNotification.Name("RemoveObservers"),object: nil,userInfo: userInfo)
|
439
|
+
// self.session?.disconnect(nil)
|
440
|
+
// self.stopTimer()
|
441
|
+
// self.dismiss(animated: true, completion: nil)
|
442
|
+
// NotificationCenter.default.post(name: NSNotification.Name("RemoveObservers"),object: nil,userInfo: userInfo)
|
443
|
+
self.endVonageCall()
|
447
444
|
}
|
448
445
|
|
449
446
|
@objc func callBtnbuttonClicked() {
|
@@ -565,6 +562,9 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
565
562
|
return
|
566
563
|
}
|
567
564
|
|
565
|
+
if !stream.hasAudio {
|
566
|
+
print("Stream audio \(stream.hasAudio)")
|
567
|
+
}
|
568
568
|
self.subscriber = subscriber
|
569
569
|
var error: OTError?
|
570
570
|
session.subscribe(subscriber, error: &error)
|
@@ -685,12 +685,10 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
685
685
|
NotificationCenter.default.post(name: NSNotification.Name("RemoveObservers"),object: nil,userInfo: userInfo)
|
686
686
|
DispatchQueue.main.async {
|
687
687
|
print("video ended called")
|
688
|
-
self.session?.disconnect(nil)
|
689
|
-
|
690
688
|
// self.publisher?.publishVideo = false
|
691
689
|
self.publisher?.videoCapture?.stop()
|
692
690
|
// self.publisher?.publishAudio = false
|
693
|
-
|
691
|
+
self.session?.disconnect(nil)
|
694
692
|
self.cleanupSubscriber()
|
695
693
|
self.cleanupPublisher()
|
696
694
|
self.stopTimer()
|