File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Cloudinary/Classes/ios/Video Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -128,13 +128,22 @@ import AVKit
128
128
}
129
129
}
130
130
131
+ public func flushEvents( ) {
132
+ guard analytics else { return }
133
+ eventsManager. sendEvents ( )
134
+ }
135
+
136
+ public func flushEventsAndCloseSession( ) {
137
+ guard analytics else { return }
138
+ eventsManager. sendViewEndEvent ( providedData: providedData)
139
+ flushEvents ( )
140
+ }
141
+
131
142
deinit {
132
- if analytics {
133
- removeObserver ( self , forKeyPath: PlayerKeyPath . status. rawValue)
134
- removeObserver ( self , forKeyPath: PlayerKeyPath . timeControlStatus. rawValue)
135
- eventsManager. sendViewEndEvent ( providedData: providedData)
136
- eventsManager. sendEvents ( )
137
- }
143
+ guard analytics else { return }
144
+ removeObserver ( self , forKeyPath: PlayerKeyPath . status. rawValue)
145
+ removeObserver ( self , forKeyPath: PlayerKeyPath . timeControlStatus. rawValue)
146
+ flushEventsAndCloseSession ( )
138
147
}
139
148
140
149
func setAnalyticsObservers( ) {
You can’t perform that action at this time.
0 commit comments