react-native-theoplayer 2.6.0 → 2.8.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/CHANGELOG.md +37 -0
- package/android/build.gradle +1 -1
- package/android/local/com/theoplayer/android-connector/mediasession/5.2.0-local/mediasession-5.2.0-local.aar +0 -0
- package/android/local/com/theoplayer/android-connector/mediasession/{4.12.0-local/mediasession-4.12.0-local.pom → 5.2.0-local/mediasession-5.2.0-local.pom} +1 -1
- package/android/local/com/theoplayer/android-connector/mediasession/maven-metadata-local.xml +4 -4
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/theoplayer/PlayerEventEmitter.kt +1 -1
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +36 -20
- package/android/src/main/java/com/theoplayer/media/CustomMediaButtonReceiver.kt +25 -0
- package/android/src/main/java/com/theoplayer/{audio → media}/MediaNotificationBuilder.kt +1 -1
- package/android/src/main/java/com/theoplayer/{audio → media}/MediaPlaybackService.kt +8 -3
- package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +12 -0
- package/android/src/main/java/com/theoplayer/track/TrackListAdapter.kt +17 -13
- package/android/src/main/java/com/theoplayer/util/ViewResolver.kt +9 -1
- package/ios/THEOplayerRCTDebug.swift +3 -3
- package/ios/THEOplayerRCTMainEventHandler.swift +59 -59
- package/ios/THEOplayerRCTMediaTrackEventHandler.swift +18 -18
- package/ios/THEOplayerRCTNetworkUtils.swift +1 -1
- package/ios/THEOplayerRCTPlayerAPI.swift +14 -14
- package/ios/THEOplayerRCTPrintUtils.swift +16 -0
- package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +6 -6
- package/ios/THEOplayerRCTTextTrackEventHandler.swift +21 -21
- package/ios/THEOplayerRCTView.swift +29 -29
- package/ios/ads/THEOplayerRCTAdsAPI+DAI.swift +6 -6
- package/ios/ads/THEOplayerRCTAdsAPI.swift +13 -13
- package/ios/ads/THEOplayerRCTAdsEventHandler.swift +27 -27
- package/ios/ads/THEOplayerRCTSourceDescriptionBuilder+Ads.swift +5 -5
- package/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift +16 -15
- package/ios/backgroundAudio/THEOplayerRCTRemoteCommandsManager.swift +16 -16
- package/ios/casting/THEOplayerRCTCastAPI+Airplay.swift +6 -6
- package/ios/casting/THEOplayerRCTCastAPI+Chromecast.swift +10 -10
- package/ios/casting/THEOplayerRCTCastAPI.swift +1 -1
- package/ios/casting/THEOplayerRCTCastEventHandler.swift +11 -11
- package/ios/contentprotection/THEOplayerRCTContentProtectionAPI.swift +1 -1
- package/ios/pip/THEOplayerRCTPipControlsManager.swift +1 -1
- package/lib/commonjs/api/source/dash/DashPlaybackConfiguration.js.map +1 -1
- package/lib/commonjs/api/track/TextTrack.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js +58 -10
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/web/FullscreenAPI.js +41 -0
- package/lib/commonjs/internal/adapter/web/FullscreenAPI.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js +45 -39
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/commonjs/internal/utils/CommonUtils.js +10 -0
- package/lib/commonjs/internal/utils/CommonUtils.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.web.js +4 -11
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.web.js.map +1 -1
- package/lib/module/api/source/dash/DashPlaybackConfiguration.js.map +1 -1
- package/lib/module/api/track/TextTrack.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerAdapter.js +59 -11
- package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/module/internal/adapter/web/FullscreenAPI.js +34 -0
- package/lib/module/internal/adapter/web/FullscreenAPI.js.map +1 -0
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js +45 -39
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/module/internal/utils/CommonUtils.js +4 -0
- package/lib/module/internal/utils/CommonUtils.js.map +1 -0
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.web.js +3 -2
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.web.js.map +1 -1
- package/lib/typescript/api/source/dash/DashPlaybackConfiguration.d.ts +52 -0
- package/lib/typescript/api/track/TextTrack.d.ts +2 -2
- package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts +3 -0
- package/lib/typescript/internal/adapter/web/FullscreenAPI.d.ts +9 -0
- package/lib/typescript/internal/utils/CommonUtils.d.ts +1 -0
- package/lib/typescript/ui/components/seekbar/thumbnail/Urlpolyfill.web.d.ts +8 -1
- package/package.json +1 -1
- package/src/api/source/dash/DashPlaybackConfiguration.ts +56 -0
- package/src/api/track/TextTrack.ts +2 -2
- package/src/internal/adapter/THEOplayerAdapter.ts +63 -10
- package/src/internal/adapter/web/FullscreenAPI.ts +59 -0
- package/src/internal/adapter/web/WebPresentationModeManager.ts +29 -22
- package/src/internal/utils/CommonUtils.ts +3 -0
- package/src/ui/components/seekbar/thumbnail/Urlpolyfill.web.ts +3 -2
- package/android/local/com/theoplayer/android-connector/mediasession/4.12.0-local/mediasession-4.12.0-local.aar +0 -0
- package/lib/commonjs/web/platform/BrowserDetection.js +0 -34
- package/lib/commonjs/web/platform/BrowserDetection.js.map +0 -1
- package/lib/module/web/platform/BrowserDetection.js +0 -27
- package/lib/module/web/platform/BrowserDetection.js.map +0 -1
- package/lib/typescript/web/platform/BrowserDetection.d.ts +0 -23
- package/src/web/platform/BrowserDetection.ts +0 -38
|
@@ -47,7 +47,7 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
47
47
|
if let ads = theView.ads() {
|
|
48
48
|
ads.skip()
|
|
49
49
|
} else {
|
|
50
|
-
if DEBUG_ADS_API {
|
|
50
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Could not skip ad (ads module unavailable).") }
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -60,14 +60,14 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
60
60
|
ads.requestPlaying { playing, error in
|
|
61
61
|
if let err = error {
|
|
62
62
|
reject(ERROR_CODE_ADS_GET_PLAYING_STATE_FAILED, err.localizedDescription, error)
|
|
63
|
-
if DEBUG_ADS_API {
|
|
63
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Retrieving ad playing state failed: \(err.localizedDescription)") }
|
|
64
64
|
} else {
|
|
65
65
|
resolve(playing)
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
} else {
|
|
69
69
|
reject(ERROR_CODE_ADS_ACCESS_FAILURE, ERROR_MESSAGE_ADS_ACCESS_FAILURE, nil)
|
|
70
|
-
if DEBUG_ADS_API {
|
|
70
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Could not skip ad (ads module unavailable).") }
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -80,17 +80,17 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
80
80
|
ads.requestCurrentAdBreak { adBreak, error in
|
|
81
81
|
if let err = error {
|
|
82
82
|
reject(ERROR_CODE_ADS_GET_CURRENT_ADBREAK_FAILED, err.localizedDescription, error)
|
|
83
|
-
if DEBUG_ADS_API {
|
|
83
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Retrieving current adbreak failed: \(err.localizedDescription)") }
|
|
84
84
|
} else if let currentAdBreak = adBreak {
|
|
85
85
|
resolve(THEOplayerRCTAdAggregator.aggregateAdBreak(adBreak:currentAdBreak))
|
|
86
86
|
} else {
|
|
87
87
|
reject(ERROR_CODE_ADS_GET_CURRENT_ADBREAK_UNDEFINED, ERROR_MESSAGE_ADS_GET_CURRENT_ADBREAK_UNDEFINED, nil)
|
|
88
|
-
if DEBUG_ADS_API {
|
|
88
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Retrieving current adbreak failed: could not load adbreak.") }
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
} else {
|
|
92
92
|
reject(ERROR_CODE_ADS_ACCESS_FAILURE, ERROR_MESSAGE_ADS_ACCESS_FAILURE, nil)
|
|
93
|
-
if DEBUG_ADS_API {
|
|
93
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Could not retrieve current adbreak (ads module unavailable).") }
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -103,7 +103,7 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
103
103
|
ads.requestCurrentAds { adsArray, error in
|
|
104
104
|
if let err = error {
|
|
105
105
|
reject(ERROR_CODE_ADS_GET_CURRENT_ADS_FAILED, err.localizedDescription, error)
|
|
106
|
-
if DEBUG_ADS_API {
|
|
106
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Retrieving current ads failed: \(err.localizedDescription)") }
|
|
107
107
|
} else if let currentAdsArray = adsArray {
|
|
108
108
|
var currentAds: [[String:Any]] = []
|
|
109
109
|
for ad in currentAdsArray {
|
|
@@ -112,12 +112,12 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
112
112
|
resolve(currentAds)
|
|
113
113
|
} else {
|
|
114
114
|
reject(ERROR_CODE_ADS_GET_CURRENT_ADS_UNDEFINED, ERROR_MESSAGE_ADS_GET_CURRENT_ADS_UNDEFINED, nil)
|
|
115
|
-
if DEBUG_ADS_API {
|
|
115
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Retrieving current ads failed: could not load ads.") }
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
} else {
|
|
119
119
|
reject(ERROR_CODE_ADS_ACCESS_FAILURE, ERROR_MESSAGE_ADS_ACCESS_FAILURE, nil)
|
|
120
|
-
if DEBUG_ADS_API {
|
|
120
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Could not retrieve current ad (ads module unavailable).") }
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -130,7 +130,7 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
130
130
|
ads.requestScheduledAdBreaks { adBreaksArray, error in
|
|
131
131
|
if let err = error {
|
|
132
132
|
reject(ERROR_CODE_ADS_GET_SCHEDULED_ADBREAKS_FAILED, err.localizedDescription, error)
|
|
133
|
-
if DEBUG_ADS_API {
|
|
133
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Retrieving scheduled adbreaks failed: \(err.localizedDescription)") }
|
|
134
134
|
} else if let currentAdBreaksArray = adBreaksArray {
|
|
135
135
|
var currentAdBreaks: [[String:Any]] = []
|
|
136
136
|
for adbreak in currentAdBreaksArray {
|
|
@@ -139,12 +139,12 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
139
139
|
resolve(currentAdBreaks)
|
|
140
140
|
} else {
|
|
141
141
|
reject(ERROR_CODE_ADS_GET_SCHEDULED_ADBREAKS_UNDEFINED, ERROR_MESSAGE_ADS_GET_SCHEDULED_ADBREAKS_UNDEFINED, nil)
|
|
142
|
-
if DEBUG_ADS_API {
|
|
142
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Retrieving current adbreaks failed: could not load adbreaks.") }
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
} else {
|
|
146
146
|
reject(ERROR_CODE_ADS_ACCESS_FAILURE, ERROR_MESSAGE_ADS_ACCESS_FAILURE, nil)
|
|
147
|
-
if DEBUG_ADS_API {
|
|
147
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Could not retrieve current ad (ads module unavailable).") }
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
@@ -158,7 +158,7 @@ class THEOplayerRCTAdsAPI: NSObject, RCTBridgeModule {
|
|
|
158
158
|
let adDescription = THEOplayerRCTSourceDescriptionBuilder.buildSingleAdDescription(adData) {
|
|
159
159
|
ads.schedule(adDescription: adDescription)
|
|
160
160
|
} else {
|
|
161
|
-
if DEBUG_ADS_API {
|
|
161
|
+
if DEBUG_ADS_API { PrintUtils.printLog(logText: "[NATIVE] Could not schedule new ad.") }
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -57,7 +57,7 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
57
57
|
#if (GOOGLE_IMA || GOOGLE_DAI) || canImport(THEOplayerGoogleIMAIntegration)
|
|
58
58
|
// AD_BEGIN
|
|
59
59
|
self.adBeginListener = player.ads.addEventListener(type: AdsEventTypes.AD_BEGIN) { [weak self] event in
|
|
60
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
60
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_BEGIN event from THEOplayer Ads") }
|
|
61
61
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
62
62
|
let ad = event.ad {
|
|
63
63
|
forwardedAdEvent([
|
|
@@ -66,11 +66,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
66
66
|
])
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
if DEBUG_EVENTHANDLER {
|
|
69
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdBegin listener attached to THEOplayer.ads") }
|
|
70
70
|
|
|
71
71
|
// AD_END
|
|
72
72
|
self.adEndListener = player.ads.addEventListener(type: AdsEventTypes.AD_END) { [weak self] event in
|
|
73
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
73
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_END event from THEOplayer Ads") }
|
|
74
74
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
75
75
|
let ad = event.ad {
|
|
76
76
|
forwardedAdEvent([
|
|
@@ -79,11 +79,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
79
79
|
])
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
if DEBUG_EVENTHANDLER {
|
|
82
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdEnd listener attached to THEOplayer.ads") }
|
|
83
83
|
|
|
84
84
|
// AD_BREAK_BEGIN
|
|
85
85
|
self.adBreakBeginListener = player.ads.addEventListener(type: AdsEventTypes.AD_BREAK_BEGIN) { [weak self] event in
|
|
86
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
86
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_BREAK_BEGIN event from THEOplayer Ads") }
|
|
87
87
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
88
88
|
let adBreak = event.ad {
|
|
89
89
|
forwardedAdEvent([
|
|
@@ -92,11 +92,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
92
92
|
])
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
if DEBUG_EVENTHANDLER {
|
|
95
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdBreakBegin listener attached to THEOplayer.ads") }
|
|
96
96
|
|
|
97
97
|
// AD_BREAK_END
|
|
98
98
|
self.adBreakEndListener = player.ads.addEventListener(type: AdsEventTypes.AD_BREAK_END) { [weak self] event in
|
|
99
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
99
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_BREAK_END event from THEOplayer Ads") }
|
|
100
100
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
101
101
|
let adBreak = event.ad {
|
|
102
102
|
forwardedAdEvent([
|
|
@@ -105,11 +105,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
105
105
|
])
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
if DEBUG_EVENTHANDLER {
|
|
108
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdBreakEnd listener attached to THEOplayer.ads") }
|
|
109
109
|
|
|
110
110
|
// AD_ERROR
|
|
111
111
|
self.adErrorListener = player.ads.addEventListener(type: AdsEventTypes.AD_ERROR) { [weak self] event in
|
|
112
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
112
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_ERROR event from THEOplayer Ads") }
|
|
113
113
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
114
114
|
let ad = event.ad {
|
|
115
115
|
forwardedAdEvent([
|
|
@@ -118,11 +118,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
118
118
|
])
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
if DEBUG_EVENTHANDLER {
|
|
121
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdError listener attached to THEOplayer.ads") }
|
|
122
122
|
|
|
123
123
|
// AD_FIRST_QUARTILE
|
|
124
124
|
self.adFirstQuartileListener = player.ads.addEventListener(type: AdsEventTypes.AD_FIRST_QUARTILE) { [weak self] event in
|
|
125
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
125
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_FIRST_QUARTILE event from THEOplayer Ads") }
|
|
126
126
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
127
127
|
let ad = event.ad {
|
|
128
128
|
forwardedAdEvent([
|
|
@@ -131,11 +131,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
131
131
|
])
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
if DEBUG_EVENTHANDLER {
|
|
134
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdFirstQuartile listener attached to THEOplayer.ads") }
|
|
135
135
|
|
|
136
136
|
// AD_MIDPOINT
|
|
137
137
|
self.adMidpointListener = player.ads.addEventListener(type: AdsEventTypes.AD_MIDPOINT) { [weak self] event in
|
|
138
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
138
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_MIDPOINT event from THEOplayer Ads") }
|
|
139
139
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
140
140
|
let ad = event.ad {
|
|
141
141
|
forwardedAdEvent([
|
|
@@ -144,11 +144,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
144
144
|
])
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
if DEBUG_EVENTHANDLER {
|
|
147
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdMidpoint listener attached to THEOplayer.ads") }
|
|
148
148
|
|
|
149
149
|
// AD_THIRD_QUARTILE
|
|
150
150
|
self.adThirdQuartileListener = player.ads.addEventListener(type: AdsEventTypes.AD_THIRD_QUARTILE) { [weak self] event in
|
|
151
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
151
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_THIRD_QUARTILE event from THEOplayer Ads") }
|
|
152
152
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
153
153
|
let ad = event.ad {
|
|
154
154
|
forwardedAdEvent([
|
|
@@ -157,11 +157,11 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
157
157
|
])
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
if DEBUG_EVENTHANDLER {
|
|
160
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdThirdQuartile listener attached to THEOplayer.ads") }
|
|
161
161
|
|
|
162
162
|
// AD_LOADED
|
|
163
163
|
self.adLoadedListener = player.ads.addEventListener(type: AdsEventTypes.AD_LOADED) { [weak self] event in
|
|
164
|
-
if DEBUG_THEOPLAYER_EVENTS {
|
|
164
|
+
if DEBUG_THEOPLAYER_EVENTS { PrintUtils.printLog(logText: "[NATIVE] Received AD_LOADED event from THEOplayer Ads") }
|
|
165
165
|
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
166
166
|
let ad = event.ad {
|
|
167
167
|
forwardedAdEvent([
|
|
@@ -170,7 +170,7 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
170
170
|
])
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
if DEBUG_EVENTHANDLER {
|
|
173
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdThirdQuartile listener attached to THEOplayer.ads") }
|
|
174
174
|
#endif
|
|
175
175
|
|
|
176
176
|
}
|
|
@@ -184,55 +184,55 @@ class THEOplayerRCTAdsEventHandler {
|
|
|
184
184
|
// AD_BEGIN
|
|
185
185
|
if let adBeginListener = self.adBeginListener {
|
|
186
186
|
player.ads.removeEventListener(type: AdsEventTypes.AD_BEGIN, listener: adBeginListener)
|
|
187
|
-
if DEBUG_EVENTHANDLER {
|
|
187
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdBegin listener dettached from THEOplayer.ads") }
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// AD_END
|
|
191
191
|
if let adEndListener = self.adEndListener {
|
|
192
192
|
player.ads.removeEventListener(type: AdsEventTypes.AD_END, listener: adEndListener)
|
|
193
|
-
if DEBUG_EVENTHANDLER {
|
|
193
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdEnd listener dettached from THEOplayer.ads") }
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
// AD_BREAK_BEGIN
|
|
197
197
|
if let adBreakBeginListener = self.adBreakBeginListener {
|
|
198
198
|
player.ads.removeEventListener(type: AdsEventTypes.AD_BREAK_BEGIN, listener: adBreakBeginListener)
|
|
199
|
-
if DEBUG_EVENTHANDLER {
|
|
199
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdBreakBegin listener dettached from THEOplayer.ads") }
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
// AD_BREAK_END
|
|
203
203
|
if let adBreakEndListener = self.adBreakEndListener {
|
|
204
204
|
player.ads.removeEventListener(type: AdsEventTypes.AD_BREAK_END, listener: adBreakEndListener)
|
|
205
|
-
if DEBUG_EVENTHANDLER {
|
|
205
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdBreakEnd listener dettached from THEOplayer.ads") }
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
// AD_ERROR
|
|
209
209
|
if let adErrorListener = self.adErrorListener {
|
|
210
210
|
player.ads.removeEventListener(type: AdsEventTypes.AD_ERROR, listener: adErrorListener)
|
|
211
|
-
if DEBUG_EVENTHANDLER {
|
|
211
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] AdError listener dettached from THEOplayer.ads") }
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
// AD_FIRST_QUARTILE
|
|
215
215
|
if let adFirstQuartileListener = self.adFirstQuartileListener {
|
|
216
216
|
player.ads.removeEventListener(type: AdsEventTypes.AD_FIRST_QUARTILE, listener: adFirstQuartileListener)
|
|
217
|
-
if DEBUG_EVENTHANDLER {
|
|
217
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] adFirstQuartileListener listener dettached from THEOplayer.ads") }
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
// AD_MIDPOINT
|
|
221
221
|
if let adMidpointListener = self.adMidpointListener {
|
|
222
222
|
player.ads.removeEventListener(type: AdsEventTypes.AD_MIDPOINT, listener: adMidpointListener)
|
|
223
|
-
if DEBUG_EVENTHANDLER {
|
|
223
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] adMidpointListener listener dettached from THEOplayer.ads") }
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
// AD_THIRD_QUARTILE
|
|
227
227
|
if let adThirdQuartileListener = self.adThirdQuartileListener {
|
|
228
228
|
player.ads.removeEventListener(type: AdsEventTypes.AD_THIRD_QUARTILE, listener: adThirdQuartileListener)
|
|
229
|
-
if DEBUG_EVENTHANDLER {
|
|
229
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] adThirdQuartileListener listener dettached from THEOplayer.ads") }
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
// AD_LOADED
|
|
233
233
|
if let adLoadedListener = self.adLoadedListener {
|
|
234
234
|
player.ads.removeEventListener(type: AdsEventTypes.AD_LOADED, listener: adLoadedListener)
|
|
235
|
-
if DEBUG_EVENTHANDLER {
|
|
235
|
+
if DEBUG_EVENTHANDLER { PrintUtils.printLog(logText: "[NATIVE] adLoadedListener listener dettached from THEOplayer.ads") }
|
|
236
236
|
}
|
|
237
237
|
#endif
|
|
238
238
|
|
|
@@ -25,7 +25,7 @@ extension THEOplayerRCTSourceDescriptionBuilder {
|
|
|
25
25
|
adsDescriptions?.append(adDescription)
|
|
26
26
|
} else {
|
|
27
27
|
if DEBUG_SOURCE_DESCRIPTION_BUIDER {
|
|
28
|
-
|
|
28
|
+
PrintUtils.printLog(logText: "[NATIVE] Could not create THEOplayer GoogleImaAdDescription from adsData array")
|
|
29
29
|
}
|
|
30
30
|
return nil
|
|
31
31
|
}
|
|
@@ -37,7 +37,7 @@ extension THEOplayerRCTSourceDescriptionBuilder {
|
|
|
37
37
|
adsDescriptions?.append(adDescription)
|
|
38
38
|
} else {
|
|
39
39
|
if DEBUG_SOURCE_DESCRIPTION_BUIDER {
|
|
40
|
-
|
|
40
|
+
PrintUtils.printLog(logText: "[NATIVE] Could not create THEOplayer GoogleImaAdDescription from adsData")
|
|
41
41
|
}
|
|
42
42
|
return nil
|
|
43
43
|
}
|
|
@@ -67,10 +67,10 @@ extension THEOplayerRCTSourceDescriptionBuilder {
|
|
|
67
67
|
if let src = srcString {
|
|
68
68
|
return GoogleImaAdDescription(src: src, timeOffset: timeOffset)
|
|
69
69
|
} else {
|
|
70
|
-
if DEBUG_SOURCE_DESCRIPTION_BUIDER {
|
|
70
|
+
if DEBUG_SOURCE_DESCRIPTION_BUIDER { PrintUtils.printLog(logText: "[NATIVE] AdDescription requires 'src' property in 'ads' description.") }
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
if DEBUG_SOURCE_DESCRIPTION_BUIDER {
|
|
73
|
+
if DEBUG_SOURCE_DESCRIPTION_BUIDER { PrintUtils.printLog(logText: "[NATIVE] We currently require and only support the 'google-ima' integration in the 'ads' description.") }
|
|
74
74
|
#endif
|
|
75
75
|
|
|
76
76
|
return nil
|
|
@@ -110,7 +110,7 @@ extension THEOplayerRCTSourceDescriptionBuilder {
|
|
|
110
110
|
}
|
|
111
111
|
default:
|
|
112
112
|
if DEBUG_SOURCE_DESCRIPTION_BUIDER {
|
|
113
|
-
|
|
113
|
+
PrintUtils.printLog(logText: "[NATIVE] THEOplayer ssai 'availabilityType' must be 'live' or 'vod'")
|
|
114
114
|
}
|
|
115
115
|
return nil
|
|
116
116
|
}
|
|
@@ -34,7 +34,7 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
34
34
|
func updateNowPlaying() {
|
|
35
35
|
// Reset any existing playing info
|
|
36
36
|
self.nowPlayingInfo = [:]
|
|
37
|
-
|
|
37
|
+
self.clearNowPlayingOnInfoCenter()
|
|
38
38
|
|
|
39
39
|
// Gather new playing info
|
|
40
40
|
if let player = self.player,
|
|
@@ -130,7 +130,7 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
130
130
|
private func updatePlaybackState() {
|
|
131
131
|
if #available(iOS 13.0, tvOS 13.0, *) {
|
|
132
132
|
if let player = self.player {
|
|
133
|
-
|
|
133
|
+
self.processPlaybackStateToInfoCenter(paused: player.paused)
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -144,9 +144,9 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
144
144
|
self?.nowPlayingInfo[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: displayIcon.size) { size in
|
|
145
145
|
return displayIcon
|
|
146
146
|
}
|
|
147
|
-
if DEBUG_NOWINFO {
|
|
147
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] Artwork updated in nowPlayingInfo.") }
|
|
148
148
|
} else {
|
|
149
|
-
if DEBUG_NOWINFO {
|
|
149
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] Failed to update artwork in nowPlayingInfo.") }
|
|
150
150
|
}
|
|
151
151
|
completion?()
|
|
152
152
|
}
|
|
@@ -166,6 +166,7 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
166
166
|
if let welf = self,
|
|
167
167
|
let currentTime = time {
|
|
168
168
|
welf.nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = NSNumber(value: currentTime)
|
|
169
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] CurrentTime updated in nowPlayingInfo.") }
|
|
169
170
|
DispatchQueue.main.async {
|
|
170
171
|
completion?()
|
|
171
172
|
}
|
|
@@ -187,8 +188,8 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
187
188
|
welf.nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = duration.isInfinite
|
|
188
189
|
if (!duration.isInfinite) {
|
|
189
190
|
welf.nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = duration
|
|
190
|
-
|
|
191
|
-
|
|
191
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] DURATION_CHANGE: Updating duration on NowPlayingInfoCenter...") }
|
|
192
|
+
welf.processNowPlayingToInfoCenter()
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
}
|
|
@@ -198,8 +199,8 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
198
199
|
self?.updatePlaybackState()
|
|
199
200
|
self?.updateCurrentTime { [weak self] in
|
|
200
201
|
if let welf = self {
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] PLAYING: Updating playbackState and time on NowPlayingInfoCenter...") }
|
|
203
|
+
welf.processNowPlayingToInfoCenter()
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
206
|
}
|
|
@@ -209,8 +210,8 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
209
210
|
self?.updatePlaybackState()
|
|
210
211
|
self?.updateCurrentTime { [weak self] in
|
|
211
212
|
if let welf = self {
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] PAUSED: Updating PlaybackState and time on NowPlayingInfoCenter...") }
|
|
214
|
+
welf.processNowPlayingToInfoCenter()
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
217
|
}
|
|
@@ -221,8 +222,8 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
221
222
|
if let welf = self,
|
|
222
223
|
let wplayer = player {
|
|
223
224
|
welf.nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = NSNumber(value: wplayer.playbackRate)
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] RATE_CHANGE: Updating playbackRate on NowPlayingInfoCenter...") }
|
|
226
|
+
welf.processNowPlayingToInfoCenter()
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
|
|
@@ -230,16 +231,16 @@ class THEOplayerRCTNowPlayingManager {
|
|
|
230
231
|
self.seekedListener = player.addEventListener(type: PlayerEventTypes.SEEKED) { [weak self] event in
|
|
231
232
|
self?.updateCurrentTime { [weak self] in
|
|
232
233
|
if let welf = self {
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] SEEKED: Time updated on NowPlayingInfoCenter.") }
|
|
235
|
+
welf.processNowPlayingToInfoCenter()
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
// SOURCE_CHANGE
|
|
240
241
|
self.sourceChangeListener = player.addEventListener(type: PlayerEventTypes.SOURCE_CHANGE) { [weak self] event in
|
|
242
|
+
if DEBUG_NOWINFO { PrintUtils.printLog(logText: "[NATIVE] SOURCE_CHANGE: Full update on NowPlayingInfoCenter.") }
|
|
241
243
|
self?.updateNowPlaying()
|
|
242
|
-
if DEBUG_NOWINFO { print("[NATIVE] SOURCE_CHANGE: Full update on NowPlayingInfoCenter.") }
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
|
|
@@ -67,7 +67,7 @@ class THEOplayerRCTRemoteCommandsManager: NSObject {
|
|
|
67
67
|
commandCenter.skipBackwardCommand.preferredIntervals = [NSNumber(value: DEFAULT_SKIP_INTERVAL)]
|
|
68
68
|
commandCenter.skipBackwardCommand.addTarget(self, action: #selector(onSkipBackwardCommand(_:)))
|
|
69
69
|
|
|
70
|
-
if DEBUG_REMOTECOMMANDS {
|
|
70
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Remote commands initialised.") }
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
func updateRemoteCommands() {
|
|
@@ -79,17 +79,17 @@ class THEOplayerRCTRemoteCommandsManager: NSObject {
|
|
|
79
79
|
commandCenter.changePlaybackPositionCommand.isEnabled = !isLive && !self.inAd && self.backgroundaudioConfig.enabled
|
|
80
80
|
commandCenter.skipForwardCommand.isEnabled = !isLive && !self.inAd && self.backgroundaudioConfig.enabled
|
|
81
81
|
commandCenter.skipBackwardCommand.isEnabled = !isLive && !self.inAd && self.backgroundaudioConfig.enabled
|
|
82
|
-
if DEBUG_REMOTECOMMANDS {
|
|
82
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Remote commands updated for \(self.isLive ? "LIVE" : "VOD") (\(self.inAd ? "AD IS PLAYING" : "NO AD PLAYING"), \(self.backgroundaudioConfig.enabled ? "BGAUDIO ENABLED" : "BGAUDIO DISABLED") ).") }
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
@objc private func onPlayCommand(_ event: MPRemoteCommandEvent) -> MPRemoteCommandHandlerStatus {
|
|
86
86
|
if let player = self.player,
|
|
87
87
|
player.paused {
|
|
88
88
|
player.play()
|
|
89
|
-
if DEBUG_REMOTECOMMANDS {
|
|
89
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Play command triggered.") }
|
|
90
90
|
return .success
|
|
91
91
|
}
|
|
92
|
-
if DEBUG_REMOTECOMMANDS {
|
|
92
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Play command Failed.") }
|
|
93
93
|
return .commandFailed
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -97,10 +97,10 @@ class THEOplayerRCTRemoteCommandsManager: NSObject {
|
|
|
97
97
|
if let player = self.player,
|
|
98
98
|
!player.paused {
|
|
99
99
|
player.pause()
|
|
100
|
-
if DEBUG_REMOTECOMMANDS {
|
|
100
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Pause command triggered.") }
|
|
101
101
|
return .success
|
|
102
102
|
}
|
|
103
|
-
if DEBUG_REMOTECOMMANDS {
|
|
103
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Pause command Failed.") }
|
|
104
104
|
return .commandFailed
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -111,10 +111,10 @@ class THEOplayerRCTRemoteCommandsManager: NSObject {
|
|
|
111
111
|
} else {
|
|
112
112
|
player.pause()
|
|
113
113
|
}
|
|
114
|
-
if DEBUG_REMOTECOMMANDS {
|
|
114
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Toggle play/pause command triggered.") }
|
|
115
115
|
return .success
|
|
116
116
|
}
|
|
117
|
-
if DEBUG_REMOTECOMMANDS {
|
|
117
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Toggle play/pause command Failed.") }
|
|
118
118
|
return .commandFailed
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -123,20 +123,20 @@ class THEOplayerRCTRemoteCommandsManager: NSObject {
|
|
|
123
123
|
if !player.paused {
|
|
124
124
|
player.pause()
|
|
125
125
|
}
|
|
126
|
-
if DEBUG_REMOTECOMMANDS {
|
|
126
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Stop command triggered.") }
|
|
127
127
|
return .success
|
|
128
128
|
}
|
|
129
|
-
if DEBUG_REMOTECOMMANDS {
|
|
129
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Stop command Failed.") }
|
|
130
130
|
return .commandFailed
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
@objc private func onScrubCommand(_ event: MPChangePlaybackPositionCommandEvent) -> MPRemoteCommandHandlerStatus {
|
|
134
134
|
if let player = self.player {
|
|
135
135
|
player.setCurrentTime(event.positionTime)
|
|
136
|
-
if DEBUG_REMOTECOMMANDS {
|
|
136
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Scrub command triggered.") }
|
|
137
137
|
return .success
|
|
138
138
|
}
|
|
139
|
-
if DEBUG_REMOTECOMMANDS {
|
|
139
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Scrub command Failed.") }
|
|
140
140
|
return .commandFailed
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -147,10 +147,10 @@ class THEOplayerRCTRemoteCommandsManager: NSObject {
|
|
|
147
147
|
player.setCurrentTime(currentTime + event.interval)
|
|
148
148
|
}
|
|
149
149
|
})
|
|
150
|
-
if DEBUG_REMOTECOMMANDS {
|
|
150
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Skip forward command triggered.") }
|
|
151
151
|
return .success
|
|
152
152
|
}
|
|
153
|
-
if DEBUG_REMOTECOMMANDS {
|
|
153
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Skip forward command Failed.") }
|
|
154
154
|
return .commandFailed
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -161,10 +161,10 @@ class THEOplayerRCTRemoteCommandsManager: NSObject {
|
|
|
161
161
|
player.setCurrentTime(currentTime - event.interval)
|
|
162
162
|
}
|
|
163
163
|
})
|
|
164
|
-
if DEBUG_REMOTECOMMANDS {
|
|
164
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Skip backward command triggered.") }
|
|
165
165
|
return .success
|
|
166
166
|
}
|
|
167
|
-
if DEBUG_REMOTECOMMANDS {
|
|
167
|
+
if DEBUG_REMOTECOMMANDS { PrintUtils.printLog(logText: "[NATIVE] Skip backward command Failed.") }
|
|
168
168
|
return .commandFailed
|
|
169
169
|
}
|
|
170
170
|
|
|
@@ -19,7 +19,7 @@ extension THEOplayerRCTCastAPI {
|
|
|
19
19
|
resolve(airplay.casting)
|
|
20
20
|
} else {
|
|
21
21
|
reject(ERROR_CODE_AIRPLAY_ACCESS_FAILURE, ERROR_MESSAGE_AIRPLAY_ACCESS_FAILURE, nil)
|
|
22
|
-
if DEBUG_CAST_API {
|
|
22
|
+
if DEBUG_CAST_API { PrintUtils.printLog(logText: "[NATIVE] Could not retrieve current airplay casting status.") }
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -33,7 +33,7 @@ extension THEOplayerRCTCastAPI {
|
|
|
33
33
|
resolve(airplay.state._rawValue)
|
|
34
34
|
} else {
|
|
35
35
|
reject(ERROR_CODE_AIRPLAY_ACCESS_FAILURE, ERROR_MESSAGE_AIRPLAY_ACCESS_FAILURE, nil)
|
|
36
|
-
if DEBUG_CAST_API {
|
|
36
|
+
if DEBUG_CAST_API { PrintUtils.printLog(logText: "[NATIVE] Could not retrieve current airplay state.") }
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -44,10 +44,10 @@ extension THEOplayerRCTCastAPI {
|
|
|
44
44
|
let theView = self.bridge.uiManager.view(forReactTag: node) as! THEOplayerRCTView
|
|
45
45
|
if let cast = theView.cast(),
|
|
46
46
|
let airplay = cast.airPlay {
|
|
47
|
-
if DEBUG_CAST_API {
|
|
47
|
+
if DEBUG_CAST_API { PrintUtils.printLog(logText: "[NATIVE] Starting airplay session.") }
|
|
48
48
|
airplay.start()
|
|
49
49
|
} else {
|
|
50
|
-
if DEBUG_CAST_API {
|
|
50
|
+
if DEBUG_CAST_API { PrintUtils.printLog(logText: "[NATIVE] Could not start airplay session.") }
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -58,10 +58,10 @@ extension THEOplayerRCTCastAPI {
|
|
|
58
58
|
let theView = self.bridge.uiManager.view(forReactTag: node) as! THEOplayerRCTView
|
|
59
59
|
if let cast = theView.cast(),
|
|
60
60
|
let airplay = cast.airPlay {
|
|
61
|
-
if DEBUG_CAST_API {
|
|
61
|
+
if DEBUG_CAST_API { PrintUtils.printLog(logText: "[NATIVE] Stopping airplay session.") }
|
|
62
62
|
airplay.stop()
|
|
63
63
|
} else {
|
|
64
|
-
if DEBUG_CAST_API {
|
|
64
|
+
if DEBUG_CAST_API { PrintUtils.printLog(logText: "[NATIVE] Could not stop airplay session.") }
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|