react-native-theoplayer 8.17.0 → 8.18.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 +17 -0
- package/README.md +2 -1
- package/android/build.gradle +2 -1
- package/android/src/main/java/com/theoplayer/cmcd/CmcdTransmissionMode.kt +8 -0
- package/android/src/main/java/com/theoplayer/player/PlayerModule.kt +13 -0
- package/android/src/main/java/com/theoplayer/presentation/FullscreenLayoutObserver.kt +39 -0
- package/android/src/main/java/com/theoplayer/presentation/PipUtils.kt +8 -14
- package/android/src/main/java/com/theoplayer/presentation/PresentationManager.kt +103 -34
- package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +32 -5
- package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +9 -1
- package/lib/commonjs/api/player/THEOplayer.js.map +1 -1
- package/lib/commonjs/api/source/SourceDescription.js.map +1 -1
- package/lib/commonjs/api/source/barrel.js +15 -4
- package/lib/commonjs/api/source/barrel.js.map +1 -1
- package/lib/commonjs/api/source/cmcd/CmcdConfiguration.js +18 -0
- package/lib/commonjs/api/source/cmcd/CmcdConfiguration.js.map +1 -0
- package/lib/commonjs/api/source/cmcd/barrel.js +17 -0
- package/lib/commonjs/api/source/cmcd/barrel.js.map +1 -0
- package/lib/commonjs/internal/THEOplayerView.js +12 -2
- package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js +5 -0
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js +30 -0
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/theoads/THEOAdsNativeAdapter.js +31 -0
- package/lib/commonjs/internal/adapter/theoads/THEOAdsNativeAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/theoads/THEOAdsWebAdapter.js +2 -2
- package/lib/commonjs/internal/adapter/theoads/THEOAdsWebAdapter.js.map +1 -1
- package/lib/commonjs/internal/utils/Dimensions.js +7 -15
- package/lib/commonjs/internal/utils/Dimensions.js.map +1 -1
- package/lib/commonjs/manifest.json +1 -1
- package/lib/module/api/player/THEOplayer.js.map +1 -1
- package/lib/module/api/source/SourceDescription.js.map +1 -1
- package/lib/module/api/source/barrel.js +1 -0
- package/lib/module/api/source/barrel.js.map +1 -1
- package/lib/module/api/source/cmcd/CmcdConfiguration.js +13 -0
- package/lib/module/api/source/cmcd/CmcdConfiguration.js.map +1 -0
- package/lib/module/api/source/cmcd/barrel.js +2 -0
- package/lib/module/api/source/cmcd/barrel.js.map +1 -0
- package/lib/module/internal/THEOplayerView.js +12 -2
- package/lib/module/internal/THEOplayerView.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerAdapter.js +5 -0
- package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js +31 -1
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
- package/lib/module/internal/adapter/theoads/THEOAdsNativeAdapter.js +24 -0
- package/lib/module/internal/adapter/theoads/THEOAdsNativeAdapter.js.map +1 -0
- package/lib/module/internal/adapter/theoads/THEOAdsWebAdapter.js +2 -2
- package/lib/module/internal/adapter/theoads/THEOAdsWebAdapter.js.map +1 -1
- package/lib/module/internal/utils/Dimensions.js +8 -16
- package/lib/module/internal/utils/Dimensions.js.map +1 -1
- package/lib/module/manifest.json +1 -1
- package/lib/typescript/api/player/THEOplayer.d.ts +5 -0
- package/lib/typescript/api/player/THEOplayer.d.ts.map +1 -1
- package/lib/typescript/api/source/SourceDescription.d.ts +6 -0
- package/lib/typescript/api/source/SourceDescription.d.ts.map +1 -1
- package/lib/typescript/api/source/barrel.d.ts +1 -0
- package/lib/typescript/api/source/barrel.d.ts.map +1 -1
- package/lib/typescript/api/source/cmcd/CmcdConfiguration.d.ts +79 -0
- package/lib/typescript/api/source/cmcd/CmcdConfiguration.d.ts.map +1 -0
- package/lib/typescript/api/source/cmcd/barrel.d.ts +2 -0
- package/lib/typescript/api/source/cmcd/barrel.d.ts.map +1 -0
- package/lib/typescript/api/theoads/TheoAdsAPI.d.ts +2 -2
- package/lib/typescript/api/theoads/TheoAdsAPI.d.ts.map +1 -1
- package/lib/typescript/internal/THEOplayerView.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts +3 -1
- package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts +3 -3
- package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/theoads/THEOAdsNativeAdapter.d.ts +9 -0
- package/lib/typescript/internal/adapter/theoads/THEOAdsNativeAdapter.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/theoads/THEOAdsWebAdapter.d.ts +3 -4
- package/lib/typescript/internal/adapter/theoads/THEOAdsWebAdapter.d.ts.map +1 -1
- package/lib/typescript/internal/utils/Dimensions.d.ts +1 -1
- package/lib/typescript/internal/utils/Dimensions.d.ts.map +1 -1
- package/package.json +2 -1
- package/react-native-theoplayer.podspec +7 -7
- package/src/api/player/THEOplayer.ts +6 -0
- package/src/api/source/SourceDescription.ts +7 -0
- package/src/api/source/barrel.ts +1 -0
- package/src/api/source/cmcd/CmcdConfiguration.ts +84 -0
- package/src/api/source/cmcd/barrel.ts +1 -0
- package/src/api/theoads/TheoAdsAPI.ts +2 -2
- package/src/internal/THEOplayerView.tsx +10 -2
- package/src/internal/adapter/THEOplayerAdapter.ts +8 -0
- package/src/internal/adapter/THEOplayerWebAdapter.ts +41 -4
- package/src/internal/adapter/theoads/THEOAdsNativeAdapter.ts +26 -0
- package/src/internal/adapter/theoads/THEOAdsWebAdapter.ts +5 -6
- package/src/internal/utils/Dimensions.ts +8 -16
- package/src/manifest.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [8.18.0] - 25-04-02
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- No longer showing poster after setting the source when the player has been configured to use autoplay. With autoplay enabled, displaying the poster will only result in a brief flash of the image.
|
|
13
|
+
- Changed the fullscreen screen dimension calculation on Android, taking into account edgeToEdge layouts.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Exposed THEOads API through the Player API.
|
|
18
|
+
- Added support for Common Media Client Data (CMCD) on all platforms. More info on the [documentation](./doc/cmcd.md) page.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Fixed an issue on Android where the transition to a PiP window would not focus on the player window.
|
|
23
|
+
|
|
8
24
|
## [8.17.0] - 25-03-20
|
|
9
25
|
|
|
10
26
|
### Fixed
|
|
@@ -34,6 +50,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
34
50
|
- Fixed an issue on Android, where the player would sometimes not initialise correctly in case New Architecture was not being used, resulting in a black screen.
|
|
35
51
|
- Fixed an issue on iOS Safari browsers, where the `presentationmodechange` event would not be dispatched when entering or exiting fullscreen.
|
|
36
52
|
|
|
53
|
+
|
|
37
54
|
## [8.15.0] - 25-02-12
|
|
38
55
|
|
|
39
56
|
### Changed
|
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ please reach out to us for support.
|
|
|
105
105
|
</tr>
|
|
106
106
|
<tr>
|
|
107
107
|
<td><strong>Advertising Integration</strong></td>
|
|
108
|
-
<td colspan="3">Google IMA, Google DAI</td>
|
|
108
|
+
<td colspan="3">Google IMA, Google DAI, THEOads</td>
|
|
109
109
|
</tr>
|
|
110
110
|
<tr>
|
|
111
111
|
<td><strong>Cast Integration</strong></td>
|
|
@@ -178,6 +178,7 @@ This section gives an overview of features, limitations and known issues:
|
|
|
178
178
|
- [Audio Control Management](./doc/audio-control.md)
|
|
179
179
|
- [Background playback and notifications](./doc/background.md)
|
|
180
180
|
- [Casting with Chromecast and Airplay](./doc/cast.md)
|
|
181
|
+
- [Common Media Client Data (CMCD)](./doc/cmcd.md)
|
|
181
182
|
- [Digital Rights Management (DRM)](./doc/drm.md)
|
|
182
183
|
- [Fullscreen presentation](./doc/fullscreen.md)
|
|
183
184
|
- [Media Caching](./doc/media-caching.md)
|
package/android/build.gradle
CHANGED
|
@@ -59,8 +59,9 @@ android {
|
|
|
59
59
|
def TimeUpdateRate = "com.theoplayer.TimeUpdateRate"
|
|
60
60
|
buildConfigField TimeUpdateRate, "TIMEUPDATE_RATE", safeExtGet('THEOplayer_timeUpdateRate', "${TimeUpdateRate}.UNLIMITED")
|
|
61
61
|
|
|
62
|
-
// Optionally re-parent player view on fullscreen event
|
|
62
|
+
// Optionally re-parent player view on fullscreen or PiP event
|
|
63
63
|
buildConfigField "boolean", "REPARENT_ON_FULLSCREEN", "${safeExtGet('THEOplayer_reparent_on_fullscreen', 'true')}"
|
|
64
|
+
buildConfigField "boolean", "REPARENT_ON_PIP", "${safeExtGet('THEOplayer_reparent_on_PiP', 'false')}"
|
|
64
65
|
|
|
65
66
|
// Optionally log events to logcat
|
|
66
67
|
buildConfigField "boolean", "LOG_PLAYER_EVENTS", "${safeExtGet('THEOplayer_logPlayerEvents', 'false')}"
|
|
@@ -263,4 +263,17 @@ class PlayerModule(context: ReactApplicationContext) : ReactContextBaseJavaModul
|
|
|
263
263
|
)
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
+
|
|
267
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
268
|
+
fun getUsableScreenDimensions(): WritableMap {
|
|
269
|
+
// Pass the dimensions of the top-most View in the view hierarchy.
|
|
270
|
+
val topView = reactApplicationContext.currentActivity?.window?.decorView?.rootView
|
|
271
|
+
reactApplicationContext.resources.displayMetrics.also {
|
|
272
|
+
val density = it.density
|
|
273
|
+
return Arguments.createMap().apply {
|
|
274
|
+
putDouble("width", (topView?.width ?: 0) / density.toDouble())
|
|
275
|
+
putDouble("height", (topView?.height ?: 0) / density.toDouble())
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
266
279
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
package com.theoplayer.presentation
|
|
2
|
+
|
|
3
|
+
import android.util.Log
|
|
4
|
+
import android.view.ViewTreeObserver
|
|
5
|
+
import com.facebook.react.views.view.ReactViewGroup
|
|
6
|
+
|
|
7
|
+
private val TAG = "FSLayoutObserver"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* FullScreenLayoutObserver makes sure that the React Native view does not get the layout
|
|
11
|
+
* defined in React-Native during fullscreen presentation mode. We want to enforce fullscreen
|
|
12
|
+
* position & size.
|
|
13
|
+
*/
|
|
14
|
+
class FullScreenLayoutObserver {
|
|
15
|
+
private var globalLayoutListener: ViewTreeObserver.OnGlobalLayoutListener? = null
|
|
16
|
+
private var attached: ReactViewGroup? = null
|
|
17
|
+
|
|
18
|
+
fun attach(viewGroup: ReactViewGroup?) {
|
|
19
|
+
if (attached != null) {
|
|
20
|
+
Log.w(TAG, "A previously attached ViewGroup was not properly detached.")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
viewGroup?.let {
|
|
24
|
+
globalLayoutListener = ViewTreeObserver.OnGlobalLayoutListener {
|
|
25
|
+
it.post {
|
|
26
|
+
it.layout(0, 0, viewGroup.width, viewGroup.height)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
it.viewTreeObserver.addOnGlobalLayoutListener(globalLayoutListener)
|
|
30
|
+
attached = viewGroup
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fun remove() {
|
|
35
|
+
attached?.viewTreeObserver?.removeOnGlobalLayoutListener(globalLayoutListener)
|
|
36
|
+
attached = null
|
|
37
|
+
globalLayoutListener = null
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -12,9 +12,6 @@ import android.graphics.Rect
|
|
|
12
12
|
import android.graphics.drawable.Icon
|
|
13
13
|
import android.os.Build
|
|
14
14
|
import android.util.Rational
|
|
15
|
-
import android.view.SurfaceView
|
|
16
|
-
import android.view.TextureView
|
|
17
|
-
import android.view.View
|
|
18
15
|
import android.view.ViewGroup
|
|
19
16
|
import androidx.annotation.RequiresApi
|
|
20
17
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
@@ -108,7 +105,8 @@ class PipUtils(
|
|
|
108
105
|
}
|
|
109
106
|
try {
|
|
110
107
|
reactContext.currentActivity?.unregisterReceiver(broadcastReceiver)
|
|
111
|
-
} catch (ignore: IllegalArgumentException) { /*ignore*/
|
|
108
|
+
} catch (ignore: IllegalArgumentException) { /*ignore*/
|
|
109
|
+
}
|
|
112
110
|
enabled = false
|
|
113
111
|
}
|
|
114
112
|
|
|
@@ -189,17 +187,13 @@ class PipUtils(
|
|
|
189
187
|
}
|
|
190
188
|
|
|
191
189
|
private fun getContentViewRect(view: ViewGroup): Rect? {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
child.getGlobalVisibleRect(visibleRect)
|
|
199
|
-
return visibleRect
|
|
190
|
+
return view.findViewById<ViewGroup>(com.theoplayer.android.R.id.theo_content_player_container)
|
|
191
|
+
?.getChildAt(0) // AspectRatioView
|
|
192
|
+
?.run {
|
|
193
|
+
Rect().apply {
|
|
194
|
+
getGlobalVisibleRect(this)
|
|
195
|
+
}
|
|
200
196
|
}
|
|
201
|
-
}
|
|
202
|
-
return null
|
|
203
197
|
}
|
|
204
198
|
|
|
205
199
|
@RequiresApi(Build.VERSION_CODES.O)
|
|
@@ -14,9 +14,9 @@ import android.view.ViewParent
|
|
|
14
14
|
import androidx.activity.ComponentActivity
|
|
15
15
|
import androidx.core.view.WindowInsetsCompat
|
|
16
16
|
import androidx.core.view.WindowInsetsControllerCompat
|
|
17
|
+
import androidx.core.view.children
|
|
17
18
|
import androidx.lifecycle.Lifecycle
|
|
18
19
|
import com.facebook.react.ReactRootView
|
|
19
|
-
import com.facebook.react.runtime.ReactSurfaceView
|
|
20
20
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
21
21
|
import com.facebook.react.views.view.ReactViewGroup
|
|
22
22
|
import com.theoplayer.BuildConfig
|
|
@@ -35,9 +35,11 @@ class PresentationManager(
|
|
|
35
35
|
private var supportsPip = false
|
|
36
36
|
private var onUserLeaveHintReceiver: BroadcastReceiver? = null
|
|
37
37
|
private var onPictureInPictureModeChanged: BroadcastReceiver? = null
|
|
38
|
-
private var playerGroupParentNode: ViewGroup? = null
|
|
39
|
-
private var playerGroupChildIndex: Int? = null
|
|
40
38
|
private val pipUtils: PipUtils = PipUtils(viewCtx, reactContext)
|
|
39
|
+
private val fullScreenLayoutObserver = FullScreenLayoutObserver()
|
|
40
|
+
private val playerGroupRestoreOptions by lazy {
|
|
41
|
+
PlayerGroupRestoreOptions()
|
|
42
|
+
}
|
|
41
43
|
|
|
42
44
|
var currentPresentationMode: PresentationMode = PresentationMode.INLINE
|
|
43
45
|
private set
|
|
@@ -99,6 +101,7 @@ class PresentationManager(
|
|
|
99
101
|
try {
|
|
100
102
|
reactContext.currentActivity?.unregisterReceiver(onUserLeaveHintReceiver)
|
|
101
103
|
reactContext.currentActivity?.unregisterReceiver(onPictureInPictureModeChanged)
|
|
104
|
+
fullScreenLayoutObserver.remove()
|
|
102
105
|
pipUtils.destroy()
|
|
103
106
|
} catch (ignore: Exception) {
|
|
104
107
|
}
|
|
@@ -146,6 +149,9 @@ class PresentationManager(
|
|
|
146
149
|
try {
|
|
147
150
|
pipUtils.enable()
|
|
148
151
|
reactContext.currentActivity?.enterPictureInPictureMode(pipUtils.getPipParams())
|
|
152
|
+
if (BuildConfig.REPARENT_ON_PIP) {
|
|
153
|
+
reparentPlayerToRoot()
|
|
154
|
+
}
|
|
149
155
|
} catch (_: Exception) {
|
|
150
156
|
onPipError()
|
|
151
157
|
}
|
|
@@ -169,6 +175,9 @@ class PresentationManager(
|
|
|
169
175
|
} else {
|
|
170
176
|
PresentationModeChangePipContext.RESTORED
|
|
171
177
|
}
|
|
178
|
+
if (BuildConfig.REPARENT_ON_PIP) {
|
|
179
|
+
reparentPlayerToOriginal()
|
|
180
|
+
}
|
|
172
181
|
updatePresentationMode(PresentationMode.INLINE, PresentationModeChangeContext(pipCtx))
|
|
173
182
|
pipUtils.disable()
|
|
174
183
|
}
|
|
@@ -209,30 +218,23 @@ class PresentationManager(
|
|
|
209
218
|
val activity = reactContext.currentActivity ?: return
|
|
210
219
|
val window = activity.window
|
|
211
220
|
|
|
212
|
-
// Get the player's ReactViewGroup parent, which contains THEOplayerView and its children (typically the UI).
|
|
213
|
-
val reactPlayerGroup: ReactViewGroup? = getClosestParentOfType(this.viewCtx.playerView)
|
|
214
|
-
|
|
215
|
-
// Get ReactNative's root node or the render hierarchy
|
|
216
|
-
val root: ReactRootView? = getClosestParentOfType(reactPlayerGroup)
|
|
217
|
-
|
|
218
221
|
if (fullscreen) {
|
|
222
|
+
// Hide system bars for immersive mode.
|
|
223
|
+
// {@link https://developer.android.com/develop/ui/views/layout/immersive}
|
|
219
224
|
WindowInsetsControllerCompat(window, window.decorView).apply {
|
|
225
|
+
// Reveal hidden system bars on any system gestures.
|
|
220
226
|
systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
|
221
|
-
|
|
222
|
-
|
|
227
|
+
// Hide all system bars.
|
|
228
|
+
hide(WindowInsetsCompat.Type.systemBars())
|
|
229
|
+
}
|
|
223
230
|
|
|
224
|
-
|
|
225
|
-
|
|
231
|
+
// Delay the event making sure it does not arrive before animations ended.
|
|
232
|
+
viewCtx.playerView.postOnAnimation {
|
|
233
|
+
updatePresentationMode(PresentationMode.FULLSCREEN)
|
|
226
234
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
reactPlayerGroup?.parent as? ReactViewGroup?
|
|
231
|
-
}?.also { parent ->
|
|
232
|
-
playerGroupChildIndex = parent.indexOfChild(reactPlayerGroup)
|
|
233
|
-
// Re-parent the playerViewGroup to the root node
|
|
234
|
-
parent.removeView(reactPlayerGroup)
|
|
235
|
-
root?.addView(reactPlayerGroup)
|
|
235
|
+
|
|
236
|
+
if (BuildConfig.REPARENT_ON_FULLSCREEN) {
|
|
237
|
+
reparentPlayerToRoot()
|
|
236
238
|
}
|
|
237
239
|
} else {
|
|
238
240
|
WindowInsetsControllerCompat(window, window.decorView).show(
|
|
@@ -240,18 +242,54 @@ class PresentationManager(
|
|
|
240
242
|
)
|
|
241
243
|
updatePresentationMode(PresentationMode.INLINE)
|
|
242
244
|
|
|
243
|
-
if (
|
|
244
|
-
|
|
245
|
+
if (BuildConfig.REPARENT_ON_FULLSCREEN) {
|
|
246
|
+
reparentPlayerToOriginal()
|
|
245
247
|
}
|
|
246
|
-
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// region Re-parent playerViewGroup logic
|
|
252
|
+
private val reactPlayerGroup: ReactViewGroup?
|
|
253
|
+
get() = viewCtx.playerView.getClosestParentOfType()
|
|
254
|
+
|
|
255
|
+
private val rootView: ReactRootView?
|
|
256
|
+
get() {
|
|
257
|
+
val activity = reactContext.currentActivity ?: return null
|
|
258
|
+
// Try to search in parents and as a fallback option from root to bottom using depth-first order
|
|
259
|
+
return reactPlayerGroup?.getClosestParentOfType()
|
|
260
|
+
?: (activity.window.decorView.rootView as? ViewGroup)
|
|
261
|
+
?.getClosestParentOfType(false)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
private fun reparentPlayerToRoot() {
|
|
265
|
+
reactPlayerGroup?.let { playerGroup ->
|
|
266
|
+
playerGroupRestoreOptions.parentNode = (playerGroup.parent as? ViewGroup)?.also { parent ->
|
|
267
|
+
playerGroupRestoreOptions.childIndex = parent.indexOfChild(playerGroup)
|
|
268
|
+
|
|
269
|
+
// Re-parent the playerViewGroup to the root node
|
|
270
|
+
parent.removeView(playerGroup)
|
|
271
|
+
rootView?.addView(playerGroup)
|
|
272
|
+
|
|
273
|
+
// Attach an observer that overrides the react-native lay-out and forces fullscreen.
|
|
274
|
+
fullScreenLayoutObserver.attach(playerGroup)
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
private fun reparentPlayerToOriginal() {
|
|
280
|
+
rootView?.run {
|
|
281
|
+
reactPlayerGroup?.let { playerGroup ->
|
|
282
|
+
// Remove forced layout observer
|
|
283
|
+
fullScreenLayoutObserver.remove()
|
|
284
|
+
|
|
247
285
|
// Re-parent the playerViewGroup from the root node to its original parent
|
|
248
|
-
removeView(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
playerGroupChildIndex = null
|
|
286
|
+
removeView(playerGroup)
|
|
287
|
+
playerGroupRestoreOptions.parentNode?.addView(playerGroup, playerGroupRestoreOptions.childIndex ?: 0)
|
|
288
|
+
playerGroupRestoreOptions.reset()
|
|
252
289
|
}
|
|
253
290
|
}
|
|
254
291
|
}
|
|
292
|
+
// endregion
|
|
255
293
|
|
|
256
294
|
private fun updatePresentationMode(
|
|
257
295
|
presentationMode: PresentationMode,
|
|
@@ -279,10 +317,41 @@ class PresentationManager(
|
|
|
279
317
|
}
|
|
280
318
|
}
|
|
281
319
|
|
|
282
|
-
inline fun <reified T : View> getClosestParentOfType(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
parent = parent
|
|
320
|
+
inline fun <reified T : View> ViewGroup.getClosestParentOfType(upward: Boolean = true): T? {
|
|
321
|
+
if (upward) {
|
|
322
|
+
// Search in the parent views of `this` view up to the root
|
|
323
|
+
var parent: ViewParent? = parent
|
|
324
|
+
while (parent != null && parent !is T) {
|
|
325
|
+
parent = parent.parent
|
|
326
|
+
}
|
|
327
|
+
return parent as? T
|
|
328
|
+
} else {
|
|
329
|
+
// Search in the children collection.
|
|
330
|
+
val viewStack = ArrayDeque(children.toList())
|
|
331
|
+
// Use Stack/LIFO instead of recursion
|
|
332
|
+
while (viewStack.isNotEmpty()) {
|
|
333
|
+
when (val view = viewStack.removeAt(0)) {
|
|
334
|
+
is T -> {
|
|
335
|
+
return view
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
is ViewGroup -> {
|
|
339
|
+
// Filling LIFO with all children of the ViewGroup: depth-first order
|
|
340
|
+
viewStack.addAll(0, view.children.toList())
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// Found nothing
|
|
345
|
+
return null
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
private class PlayerGroupRestoreOptions {
|
|
350
|
+
var childIndex: Int? = null
|
|
351
|
+
var parentNode: ViewGroup? = null
|
|
352
|
+
|
|
353
|
+
fun reset() {
|
|
354
|
+
parentNode = null
|
|
355
|
+
childIndex = null
|
|
286
356
|
}
|
|
287
|
-
return parent as? T
|
|
288
357
|
}
|
|
@@ -19,10 +19,12 @@ import com.theoplayer.android.api.player.track.texttrack.TextTrackKind
|
|
|
19
19
|
import com.theoplayer.android.api.source.metadata.ChromecastMetadataImage
|
|
20
20
|
import com.theoplayer.BuildConfig
|
|
21
21
|
import com.theoplayer.android.api.ads.theoads.TheoAdsLayoutOverride
|
|
22
|
+
import com.theoplayer.android.api.cmcd.CMCDTransmissionMode
|
|
22
23
|
import com.theoplayer.android.api.error.ErrorCode
|
|
23
24
|
import com.theoplayer.android.api.source.AdIntegration
|
|
24
25
|
import com.theoplayer.android.api.source.dash.DashPlaybackConfiguration
|
|
25
26
|
import com.theoplayer.android.api.theolive.TheoLiveSource
|
|
27
|
+
import com.theoplayer.cmcd.CmcdTransmissionMode
|
|
26
28
|
import com.theoplayer.drm.ContentProtectionAdapter
|
|
27
29
|
import com.theoplayer.latency.parseLatencyConfiguration
|
|
28
30
|
import com.theoplayer.util.BridgeUtils
|
|
@@ -75,6 +77,9 @@ private const val PROP_SSAI_INTEGRATION_GOOGLE_DAI = "google-dai"
|
|
|
75
77
|
|
|
76
78
|
private const val INTEGRATION_THEOLIVE = "theolive"
|
|
77
79
|
|
|
80
|
+
private const val PROP_CMCD = "cmcd"
|
|
81
|
+
private const val CMCD_TRANSMISSION_MODE = "transmissionMode"
|
|
82
|
+
|
|
78
83
|
class SourceAdapter {
|
|
79
84
|
private val gson = Gson()
|
|
80
85
|
|
|
@@ -95,6 +100,12 @@ class SourceAdapter {
|
|
|
95
100
|
try {
|
|
96
101
|
val jsonSourceObject = JSONObject(gson.toJson(source.toHashMap()))
|
|
97
102
|
|
|
103
|
+
// CMCD
|
|
104
|
+
var cmcdTransmissionMode: CMCDTransmissionMode? = null
|
|
105
|
+
if (jsonSourceObject.has(PROP_CMCD)) {
|
|
106
|
+
cmcdTransmissionMode = parseCmcdTransmissionMode(jsonSourceObject.getJSONObject(PROP_CMCD));
|
|
107
|
+
}
|
|
108
|
+
|
|
98
109
|
// typed sources
|
|
99
110
|
val typedSources = ArrayList<TypedSource>()
|
|
100
111
|
|
|
@@ -102,11 +113,11 @@ class SourceAdapter {
|
|
|
102
113
|
val jsonSources = jsonSourceObject.optJSONArray(PROP_SOURCES)
|
|
103
114
|
if (jsonSources != null) {
|
|
104
115
|
for (i in 0 until jsonSources.length()) {
|
|
105
|
-
typedSources.add(parseTypedSource(jsonSources[i] as JSONObject))
|
|
116
|
+
typedSources.add(parseTypedSource(jsonSources[i] as JSONObject, cmcdTransmissionMode))
|
|
106
117
|
}
|
|
107
118
|
} else {
|
|
108
119
|
val jsonSource = jsonSourceObject.optJSONObject(PROP_SOURCES) ?: return null
|
|
109
|
-
typedSources.add(parseTypedSource(jsonSource))
|
|
120
|
+
typedSources.add(parseTypedSource(jsonSource, cmcdTransmissionMode))
|
|
110
121
|
}
|
|
111
122
|
|
|
112
123
|
// poster
|
|
@@ -167,16 +178,16 @@ class SourceAdapter {
|
|
|
167
178
|
}
|
|
168
179
|
|
|
169
180
|
@Throws(THEOplayerException::class)
|
|
170
|
-
private fun parseTypedSource(jsonTypedSource: JSONObject): TypedSource {
|
|
181
|
+
private fun parseTypedSource(jsonTypedSource: JSONObject, cmcdTransmissionMode: CMCDTransmissionMode? = null): TypedSource {
|
|
171
182
|
// Some integrations do not support the Builder pattern
|
|
172
183
|
return when (jsonTypedSource.optString(PROP_INTEGRATION)) {
|
|
173
184
|
INTEGRATION_THEOLIVE -> parseTheoLiveSource(jsonTypedSource)
|
|
174
|
-
else -> parseTypedSourceFromBuilder(jsonTypedSource)
|
|
185
|
+
else -> parseTypedSourceFromBuilder(jsonTypedSource, cmcdTransmissionMode)
|
|
175
186
|
}
|
|
176
187
|
}
|
|
177
188
|
|
|
178
189
|
@Throws(THEOplayerException::class)
|
|
179
|
-
private fun parseTypedSourceFromBuilder(jsonTypedSource: JSONObject): TypedSource {
|
|
190
|
+
private fun parseTypedSourceFromBuilder(jsonTypedSource: JSONObject, cmcdTransmissionMode: CMCDTransmissionMode? = null): TypedSource {
|
|
180
191
|
try {
|
|
181
192
|
var tsBuilder = TypedSource.Builder(jsonTypedSource.optString(PROP_SRC))
|
|
182
193
|
val sourceType = parseSourceType(jsonTypedSource)
|
|
@@ -216,6 +227,9 @@ class SourceAdapter {
|
|
|
216
227
|
tsBuilder.drm(drmConfig)
|
|
217
228
|
}
|
|
218
229
|
}
|
|
230
|
+
if (cmcdTransmissionMode != null) {
|
|
231
|
+
tsBuilder.cmcdTransmissionMode(cmcdTransmissionMode)
|
|
232
|
+
}
|
|
219
233
|
return tsBuilder.build()
|
|
220
234
|
} catch (e: THEOplayerException) {
|
|
221
235
|
// Rethrow THEOplayerException
|
|
@@ -431,4 +445,17 @@ class SourceAdapter {
|
|
|
431
445
|
|
|
432
446
|
return BridgeUtils.fromJSONObjectToBridge(json)
|
|
433
447
|
}
|
|
448
|
+
|
|
449
|
+
private fun parseCmcdTransmissionMode(cmcdConfiguration : JSONObject) : CMCDTransmissionMode {
|
|
450
|
+
try {
|
|
451
|
+
val transmissionMode = cmcdConfiguration.optInt(CMCD_TRANSMISSION_MODE)
|
|
452
|
+
if (transmissionMode === CmcdTransmissionMode.QUERY_ARGUMENT.ordinal) {
|
|
453
|
+
return CMCDTransmissionMode.QUERY_ARGUMENT
|
|
454
|
+
}
|
|
455
|
+
return CMCDTransmissionMode.HTTP_HEADER
|
|
456
|
+
} catch (e: JSONException) {
|
|
457
|
+
e.printStackTrace()
|
|
458
|
+
return CMCDTransmissionMode.HTTP_HEADER
|
|
459
|
+
}
|
|
460
|
+
}
|
|
434
461
|
}
|
|
@@ -59,6 +59,7 @@ let SD_PROP_OVERRIDE_AD_SRC: String = "overrideAdSrc"
|
|
|
59
59
|
let SD_PROP_USE_ID3: String = "useId3"
|
|
60
60
|
let SD_PROP_RETRIEVE_POD_ID_URI: String = "retrievePodIdURI"
|
|
61
61
|
let SD_PROP_HLS_DATE_RANGE: String = "hlsDateRange"
|
|
62
|
+
let SD_PROP_CMCD: String = "cmcd"
|
|
62
63
|
|
|
63
64
|
let EXTENSION_HLS: String = ".m3u8"
|
|
64
65
|
let EXTENSION_MP4: String = ".mp4"
|
|
@@ -157,8 +158,15 @@ class THEOplayerRCTSourceDescriptionBuilder {
|
|
|
157
158
|
if let metadataData = sourceData[SD_PROP_METADATA] as? [String:Any] {
|
|
158
159
|
metadataDescription = THEOplayerRCTSourceDescriptionBuilder.buildMetaDataDescription(metadataData)
|
|
159
160
|
}
|
|
161
|
+
|
|
162
|
+
// 6. configure CMCD
|
|
163
|
+
if let cmcd = sourceData[SD_PROP_CMCD] as? [String:Any] {
|
|
164
|
+
typedSources.forEach { typedSource in
|
|
165
|
+
typedSource.cmcd = true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
160
168
|
|
|
161
|
-
//
|
|
169
|
+
// 7. construct the SourceDescription
|
|
162
170
|
let sourceDescription = SourceDescription(sources: typedSources,
|
|
163
171
|
textTracks: textTrackDescriptions,
|
|
164
172
|
ads: adsDescriptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AspectRatio","exports","RenderingTarget"],"sourceRoot":"../../../../src","sources":["api/player/THEOplayer.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["AspectRatio","exports","RenderingTarget"],"sourceRoot":"../../../../src","sources":["api/player/THEOplayer.ts"],"mappings":";;;;;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,IAUYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAMvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYE,eAAe,GAAAD,OAAA,CAAAC,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAO3B;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SourceIntegrationId","exports"],"sourceRoot":"../../../../src","sources":["api/source/SourceDescription.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["SourceIntegrationId","exports"],"sourceRoot":"../../../../src","sources":["api/source/SourceDescription.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOYA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAI/B;AACA;AACA;AACA;AACA;AAgEA;AACA;AACA;AACA;AACA;AAmDA;AACA;AACA;AACA;AACA;AA0FA;AACA;AACA;AACA;AACA;AA0DA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -25,7 +25,7 @@ Object.keys(_barrel2).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
-
var _barrel3 = require("./
|
|
28
|
+
var _barrel3 = require("./cmcd/barrel");
|
|
29
29
|
Object.keys(_barrel3).forEach(function (key) {
|
|
30
30
|
if (key === "default" || key === "__esModule") return;
|
|
31
31
|
if (key in exports && exports[key] === _barrel3[key]) return;
|
|
@@ -36,7 +36,7 @@ Object.keys(_barrel3).forEach(function (key) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
var _barrel4 = require("./
|
|
39
|
+
var _barrel4 = require("./drm/barrel");
|
|
40
40
|
Object.keys(_barrel4).forEach(function (key) {
|
|
41
41
|
if (key === "default" || key === "__esModule") return;
|
|
42
42
|
if (key in exports && exports[key] === _barrel4[key]) return;
|
|
@@ -47,7 +47,7 @@ Object.keys(_barrel4).forEach(function (key) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
var _barrel5 = require("./
|
|
50
|
+
var _barrel5 = require("./dash/barrel");
|
|
51
51
|
Object.keys(_barrel5).forEach(function (key) {
|
|
52
52
|
if (key === "default" || key === "__esModule") return;
|
|
53
53
|
if (key in exports && exports[key] === _barrel5[key]) return;
|
|
@@ -58,7 +58,7 @@ Object.keys(_barrel5).forEach(function (key) {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
-
var _barrel6 = require("./
|
|
61
|
+
var _barrel6 = require("./hls/barrel");
|
|
62
62
|
Object.keys(_barrel6).forEach(function (key) {
|
|
63
63
|
if (key === "default" || key === "__esModule") return;
|
|
64
64
|
if (key in exports && exports[key] === _barrel6[key]) return;
|
|
@@ -69,6 +69,17 @@ Object.keys(_barrel6).forEach(function (key) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
+
var _barrel7 = require("./metadata/barrel");
|
|
73
|
+
Object.keys(_barrel7).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _barrel7[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _barrel7[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
72
83
|
var _SourceDescription = require("./SourceDescription");
|
|
73
84
|
Object.keys(_SourceDescription).forEach(function (key) {
|
|
74
85
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_barrel","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_barrel2","_barrel3","_barrel4","_barrel5","_barrel6","_SourceDescription"],"sourceRoot":"../../../../src","sources":["api/source/barrel.ts"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,QAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,QAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,QAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,QAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,QAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,QAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,QAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,QAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,QAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,QAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,QAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,QAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,
|
|
1
|
+
{"version":3,"names":["_barrel","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_barrel2","_barrel3","_barrel4","_barrel5","_barrel6","_barrel7","_SourceDescription"],"sourceRoot":"../../../../src","sources":["api/source/barrel.ts"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,QAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,QAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,QAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,QAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,QAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,QAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,QAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,QAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,QAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,QAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,QAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,QAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,QAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,QAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,QAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,QAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,kBAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,kBAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,kBAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,kBAAA,CAAAX,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CmcdTransmissionMode = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* The configuration for transmitting information to Content Delivery Networks (CDNs)
|
|
9
|
+
* through Common Media Client Data (CMCD) (CTA-5004)
|
|
10
|
+
*/
|
|
11
|
+
let CmcdTransmissionMode = exports.CmcdTransmissionMode = /*#__PURE__*/function (CmcdTransmissionMode) {
|
|
12
|
+
CmcdTransmissionMode[CmcdTransmissionMode["HTTP_HEADER"] = 0] = "HTTP_HEADER";
|
|
13
|
+
CmcdTransmissionMode[CmcdTransmissionMode["QUERY_ARGUMENT"] = 1] = "QUERY_ARGUMENT";
|
|
14
|
+
CmcdTransmissionMode[CmcdTransmissionMode["JSON_OBJECT"] = 2] = "JSON_OBJECT";
|
|
15
|
+
CmcdTransmissionMode[CmcdTransmissionMode["SDK_DEFAULT"] = 3] = "SDK_DEFAULT";
|
|
16
|
+
return CmcdTransmissionMode;
|
|
17
|
+
}({});
|
|
18
|
+
//# sourceMappingURL=CmcdConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmcdTransmissionMode","exports"],"sourceRoot":"../../../../../src","sources":["api/source/cmcd/CmcdConfiguration.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAHA,IAyDYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _CmcdConfiguration = require("./CmcdConfiguration");
|
|
7
|
+
Object.keys(_CmcdConfiguration).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _CmcdConfiguration[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _CmcdConfiguration[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=barrel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_CmcdConfiguration","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../../src","sources":["api/source/cmcd/barrel.ts"],"mappings":";;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,kBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -77,7 +77,9 @@ class THEOplayerView extends _react.PureComponent {
|
|
|
77
77
|
this.reset();
|
|
78
78
|
this._facade.dispatchEvent(new _BaseEvent.BaseEvent(_reactNativeTheoplayer.PlayerEventType.SOURCE_CHANGE));
|
|
79
79
|
this._updatePoster();
|
|
80
|
-
this.
|
|
80
|
+
if (!this._facade.autoplay) {
|
|
81
|
+
this._showPoster();
|
|
82
|
+
}
|
|
81
83
|
};
|
|
82
84
|
_onLoadStart = () => {
|
|
83
85
|
this._facade.dispatchEvent(new _BaseEvent.BaseEvent(_reactNativeTheoplayer.PlayerEventType.LOAD_START));
|
|
@@ -199,8 +201,16 @@ class THEOplayerView extends _react.PureComponent {
|
|
|
199
201
|
}
|
|
200
202
|
};
|
|
201
203
|
_onPresentationModeChange = event => {
|
|
204
|
+
const presentationMode = event.nativeEvent.presentationMode;
|
|
202
205
|
this.setState({
|
|
203
|
-
presentationMode
|
|
206
|
+
presentationMode
|
|
207
|
+
}, () => {
|
|
208
|
+
// Re-measure screen size after transitioning to fullscreen.
|
|
209
|
+
if (presentationMode === _reactNativeTheoplayer.PresentationMode.fullscreen) {
|
|
210
|
+
this.setState({
|
|
211
|
+
screenSize: (0, _Dimensions.getFullscreenSize)()
|
|
212
|
+
});
|
|
213
|
+
}
|
|
204
214
|
});
|
|
205
215
|
this._facade.dispatchEvent(new _PlayerEvents.DefaultPresentationModeChangeEvent(event.nativeEvent.presentationMode, event.nativeEvent.previousPresentationMode, event.nativeEvent.context));
|
|
206
216
|
};
|