capacitor-plugin-playlist 0.9.1 → 0.9.2
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.
- package/ios/Plugin/Plugin.swift +17 -2
- package/package.json +1 -1
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -198,11 +198,26 @@ public class PlaylistPlugin: CAPPlugin, StatusUpdater {
|
|
|
198
198
|
call.resolve(["position": position])
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
public override func
|
|
201
|
+
public override func load() {
|
|
202
|
+
NotificationCenter.default.addObserver(
|
|
203
|
+
self,
|
|
204
|
+
selector: #selector(applicationWillResignActive),
|
|
205
|
+
name: UIApplication.willResignActiveNotification,
|
|
206
|
+
object: nil
|
|
207
|
+
)
|
|
208
|
+
NotificationCenter.default.addObserver(
|
|
209
|
+
self,
|
|
210
|
+
selector: #selector(applicationDidBecomeActive),
|
|
211
|
+
name: UIApplication.didBecomeActiveNotification,
|
|
212
|
+
object: nil
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@objc private func applicationWillResignActive() {
|
|
202
217
|
audioPlayerImpl.setWebViewActive(false)
|
|
203
218
|
}
|
|
204
219
|
|
|
205
|
-
|
|
220
|
+
@objc private func applicationDidBecomeActive() {
|
|
206
221
|
audioPlayerImpl.setWebViewActive(true)
|
|
207
222
|
audioPlayerImpl.emitPlaybackSnapshot()
|
|
208
223
|
}
|