amazon-ivs-react-native-player 1.1.0 → 1.2.0
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/amazon-ivs-react-native-player.podspec +1 -1
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsView.kt +0 -2
- package/ios/AmazonIvsManager.m +4 -0
- package/ios/AmazonIvsView.swift +0 -30
- package/package.json +1 -1
- package/NOTICE +0 -1
- package/ios/.gitignore +0 -1
package/ios/AmazonIvsManager.m
CHANGED
|
@@ -33,4 +33,8 @@ RCT_EXPORT_VIEW_PROPERTY(onTextMetadataCue, RCTDirectEventBlock)
|
|
|
33
33
|
RCT_EXPORT_VIEW_PROPERTY(onProgress, RCTDirectEventBlock)
|
|
34
34
|
RCT_EXPORT_VIEW_PROPERTY(onError, RCTDirectEventBlock)
|
|
35
35
|
RCT_EXPORT_VIEW_PROPERTY(onTimePoint, RCTDirectEventBlock)
|
|
36
|
+
+ (BOOL)requiresMainQueueSetup
|
|
37
|
+
{
|
|
38
|
+
return YES;
|
|
39
|
+
}
|
|
36
40
|
@end
|
package/ios/AmazonIvsView.swift
CHANGED
|
@@ -55,7 +55,6 @@ class AmazonIvsView: UIView, IVSPlayer.Delegate {
|
|
|
55
55
|
self.addProgressObserver()
|
|
56
56
|
self.addPlayerObserver()
|
|
57
57
|
self.addTimePointObserver()
|
|
58
|
-
self.addApplicationLifecycleObservers()
|
|
59
58
|
|
|
60
59
|
player.delegate = self
|
|
61
60
|
self.playerView.player = player
|
|
@@ -65,7 +64,6 @@ class AmazonIvsView: UIView, IVSPlayer.Delegate {
|
|
|
65
64
|
self.removeProgressObserver()
|
|
66
65
|
self.removePlayerObserver()
|
|
67
66
|
self.removeTimePointObserver()
|
|
68
|
-
self.removeApplicationLifecycleObservers()
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
func load(urlString: String) {
|
|
@@ -263,34 +261,6 @@ class AmazonIvsView: UIView, IVSPlayer.Delegate {
|
|
|
263
261
|
}
|
|
264
262
|
}
|
|
265
263
|
|
|
266
|
-
private var didPauseOnBackground = false
|
|
267
|
-
|
|
268
|
-
@objc private func applicationDidEnterBackground(notification: Notification) {
|
|
269
|
-
if player.state == .playing || player.state == .buffering {
|
|
270
|
-
didPauseOnBackground = true
|
|
271
|
-
pause()
|
|
272
|
-
} else {
|
|
273
|
-
didPauseOnBackground = false
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
@objc private func applicationDidBecomeActive(notification: Notification) {
|
|
278
|
-
if didPauseOnBackground && player.error == nil {
|
|
279
|
-
play()
|
|
280
|
-
didPauseOnBackground = false
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
private func addApplicationLifecycleObservers() {
|
|
285
|
-
NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground(notification:)), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
|
286
|
-
NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive(notification:)), name: UIApplication.didBecomeActiveNotification, object: nil)
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
private func removeApplicationLifecycleObservers() {
|
|
290
|
-
NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil)
|
|
291
|
-
NotificationCenter.default.removeObserver(self, name: UIApplication.willEnterForegroundNotification, object: nil)
|
|
292
|
-
}
|
|
293
|
-
|
|
294
264
|
private func mapPlayerState(state: IVSPlayer.State) -> String {
|
|
295
265
|
switch state {
|
|
296
266
|
case IVSPlayer.State.playing: return "Playing"
|
package/package.json
CHANGED
package/NOTICE
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
package/ios/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
AmazonIvsManager+Framework.swift
|