react-native-theoplayer 8.12.0 → 8.13.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 +14 -0
- package/android/build.gradle +10 -0
- package/android/src/main/java/com/theoplayer/PlayerEventEmitter.kt +8 -4
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +15 -4
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerViewManager.kt +1 -1
- package/android/src/main/java/com/theoplayer/presentation/PresentationManager.kt +7 -2
- package/android/src/main/java/com/theoplayer/util/ViewResolver.kt +10 -13
- package/ios/ads/THEOplayerRCTAdsAPI+DAI.swift +5 -0
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js +4 -12
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/commonjs/manifest.json +1 -1
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js +4 -12
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js.map +1 -1
- package/lib/module/manifest.json +1 -1
- package/lib/typescript/internal/adapter/web/WebPresentationModeManager.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/internal/adapter/web/WebPresentationModeManager.ts +4 -12
- package/src/manifest.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ 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.13.0] - 25-01-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added support for New Architecture's through the Interop Layer. More info on the [React Native developer pages](https://reactnative.dev/architecture/landing-page).
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Fixed an issue on Web where picture-in-picture presentation mode would sometimes fail.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Upgraded the example app to use react-native-tvos@0.76.5-0.
|
|
21
|
+
|
|
8
22
|
## [8.12.0] - 25-01-09
|
|
9
23
|
|
|
10
24
|
### Fixed
|
package/android/build.gradle
CHANGED
|
@@ -25,6 +25,14 @@ static def versionString(version) {
|
|
|
25
25
|
return "${version == '+' ? 'latest' : version}"
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
def isNewArchitectureEnabled() {
|
|
29
|
+
// To opt-in for the New Architecture, you can either:
|
|
30
|
+
// - Set `newArchEnabled` to true inside the `gradle.properties` file
|
|
31
|
+
// - Invoke gradle with `-newArchEnabled=true`
|
|
32
|
+
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
|
|
33
|
+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
// Extensions
|
|
29
37
|
def enabledGoogleIMA = safeExtGet("THEOplayer_extensionGoogleIMA", 'false').toBoolean()
|
|
30
38
|
def enabledGoogleDAI = safeExtGet("THEOplayer_extensionGoogleDAI", 'false').toBoolean()
|
|
@@ -69,6 +77,8 @@ android {
|
|
|
69
77
|
buildConfigField "boolean", "EXTENSION_MEDIASESSION", "${enabledMediaSession}"
|
|
70
78
|
buildConfigField "boolean", "EXTENSION_MEDIA3", "${enabledMedia3}"
|
|
71
79
|
|
|
80
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
81
|
+
|
|
72
82
|
consumerProguardFiles 'proguard-rules.pro'
|
|
73
83
|
}
|
|
74
84
|
|
|
@@ -8,7 +8,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
8
8
|
import com.facebook.react.bridge.WritableMap
|
|
9
9
|
import com.facebook.react.bridge.WritableNativeMap
|
|
10
10
|
import com.facebook.react.uimanager.UIManagerHelper
|
|
11
|
-
import com.facebook.react.uimanager.common.
|
|
11
|
+
import com.facebook.react.uimanager.common.UIManagerType
|
|
12
12
|
import com.theoplayer.ads.AdEventAdapter
|
|
13
13
|
import com.theoplayer.ads.AdEventAdapter.AdEventEmitter
|
|
14
14
|
import com.theoplayer.android.api.THEOplayerGlobal
|
|
@@ -47,7 +47,6 @@ import com.theoplayer.track.*
|
|
|
47
47
|
import com.theoplayer.util.PayloadBuilder
|
|
48
48
|
import kotlin.math.floor
|
|
49
49
|
|
|
50
|
-
|
|
51
50
|
private val TAG = PlayerEventEmitter::class.java.name
|
|
52
51
|
|
|
53
52
|
private const val EVENT_PLAYER_READY = "onNativePlayerReady"
|
|
@@ -613,8 +612,13 @@ class PlayerEventEmitter internal constructor(
|
|
|
613
612
|
} catch (ignore: RuntimeException) {
|
|
614
613
|
}
|
|
615
614
|
}
|
|
616
|
-
|
|
617
|
-
|
|
615
|
+
UIManagerHelper.getUIManager(
|
|
616
|
+
reactContext,
|
|
617
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
618
|
+
UIManagerType.FABRIC
|
|
619
|
+
} else {
|
|
620
|
+
UIManagerType.DEFAULT
|
|
621
|
+
})?.receiveEvent(UIManagerHelper.getSurfaceId(playerView), viewId, type, event)
|
|
618
622
|
}
|
|
619
623
|
|
|
620
624
|
private fun attachListeners(player: Player) {
|
|
@@ -26,6 +26,7 @@ class ReactTHEOplayerView(private val reactContext: ThemedReactContext) :
|
|
|
26
26
|
var presentationManager: PresentationManager? = null
|
|
27
27
|
var playerContext: ReactTHEOplayerContext? = null
|
|
28
28
|
private var isInitialized: Boolean = false
|
|
29
|
+
private var config: PlayerConfigAdapter? = null
|
|
29
30
|
|
|
30
31
|
val adsApi: AdsApiWrapper
|
|
31
32
|
|
|
@@ -40,7 +41,7 @@ class ReactTHEOplayerView(private val reactContext: ThemedReactContext) :
|
|
|
40
41
|
adsApi = AdsApiWrapper()
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
fun initialize(
|
|
44
|
+
fun initialize(config: PlayerConfigAdapter) {
|
|
44
45
|
if (BuildConfig.LOG_VIEW_EVENTS) {
|
|
45
46
|
Log.d(TAG, "Initialize view")
|
|
46
47
|
}
|
|
@@ -48,10 +49,15 @@ class ReactTHEOplayerView(private val reactContext: ThemedReactContext) :
|
|
|
48
49
|
Log.w(TAG, "Already initialized view")
|
|
49
50
|
return
|
|
50
51
|
}
|
|
52
|
+
this.config = config
|
|
53
|
+
if (!isAttachedToWindow) {
|
|
54
|
+
// The view is not attached to the window yet, postpone the initialization.
|
|
55
|
+
return
|
|
56
|
+
}
|
|
51
57
|
isInitialized = true
|
|
52
58
|
playerContext = ReactTHEOplayerContext.create(
|
|
53
59
|
reactContext,
|
|
54
|
-
|
|
60
|
+
config
|
|
55
61
|
)
|
|
56
62
|
playerContext?.apply {
|
|
57
63
|
adsApi.initialize(player, imaIntegration, daiIntegration)
|
|
@@ -59,17 +65,22 @@ class ReactTHEOplayerView(private val reactContext: ThemedReactContext) :
|
|
|
59
65
|
playerView.layoutParams = layoutParams
|
|
60
66
|
(playerView.parent as? ViewGroup)?.removeView(playerView)
|
|
61
67
|
addView(playerView, 0, layoutParams)
|
|
62
|
-
|
|
63
68
|
presentationManager = PresentationManager(
|
|
64
69
|
this,
|
|
65
70
|
reactContext,
|
|
66
71
|
eventEmitter
|
|
67
72
|
)
|
|
68
|
-
|
|
69
73
|
eventEmitter.preparePlayer(player)
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
|
|
77
|
+
override fun onAttachedToWindow() {
|
|
78
|
+
super.onAttachedToWindow()
|
|
79
|
+
if (!isInitialized) {
|
|
80
|
+
config?.let { initialize(it) }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
73
84
|
override fun setId(id: Int) {
|
|
74
85
|
super.setId(id)
|
|
75
86
|
eventEmitter.setViewId(id)
|
|
@@ -31,7 +31,7 @@ class ReactTHEOplayerViewManager : ViewGroupManager<ReactTHEOplayerView>() {
|
|
|
31
31
|
|
|
32
32
|
@ReactProp(name = PROP_CONFIG)
|
|
33
33
|
fun setConfig(videoView: ReactTHEOplayerView, config: ReadableMap?) {
|
|
34
|
-
videoView.initialize(config)
|
|
34
|
+
videoView.initialize(PlayerConfigAdapter(config))
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> {
|
|
@@ -16,6 +16,7 @@ import androidx.core.view.WindowInsetsCompat
|
|
|
16
16
|
import androidx.core.view.WindowInsetsControllerCompat
|
|
17
17
|
import androidx.lifecycle.Lifecycle
|
|
18
18
|
import com.facebook.react.ReactRootView
|
|
19
|
+
import com.facebook.react.runtime.ReactSurfaceView
|
|
19
20
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
20
21
|
import com.facebook.react.views.view.ReactViewGroup
|
|
21
22
|
import com.theoplayer.BuildConfig
|
|
@@ -211,7 +212,7 @@ class PresentationManager(
|
|
|
211
212
|
// Get the player's ReactViewGroup parent, which contains THEOplayerView and its children (typically the UI).
|
|
212
213
|
val reactPlayerGroup: ReactViewGroup? = getClosestParentOfType(this.viewCtx.playerView)
|
|
213
214
|
|
|
214
|
-
// Get ReactNative's root node or the render
|
|
215
|
+
// Get ReactNative's root node or the render hierarchy
|
|
215
216
|
val root: ReactRootView? = getClosestParentOfType(reactPlayerGroup)
|
|
216
217
|
|
|
217
218
|
if (fullscreen) {
|
|
@@ -223,7 +224,11 @@ class PresentationManager(
|
|
|
223
224
|
if (!BuildConfig.REPARENT_ON_FULLSCREEN) {
|
|
224
225
|
return
|
|
225
226
|
}
|
|
226
|
-
playerGroupParentNode = (
|
|
227
|
+
playerGroupParentNode = if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
228
|
+
reactPlayerGroup?.parent as? ReactSurfaceView?
|
|
229
|
+
} else {
|
|
230
|
+
reactPlayerGroup?.parent as? ReactViewGroup?
|
|
231
|
+
}?.also { parent ->
|
|
227
232
|
playerGroupChildIndex = parent.indexOfChild(reactPlayerGroup)
|
|
228
233
|
// Re-parent the playerViewGroup to the root node
|
|
229
234
|
parent.removeView(reactPlayerGroup)
|
|
@@ -3,31 +3,28 @@ package com.theoplayer.util
|
|
|
3
3
|
import android.util.Log
|
|
4
4
|
import android.view.View
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.uimanager.
|
|
6
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
7
7
|
|
|
8
8
|
private const val TAG = "ViewResolver"
|
|
9
9
|
private const val INVALID_TAG = -1
|
|
10
10
|
|
|
11
11
|
@Suppress("UNCHECKED_CAST")
|
|
12
12
|
class ViewResolver(private val reactContext: ReactApplicationContext) {
|
|
13
|
-
private var uiManager: UIManagerModule? = null
|
|
14
|
-
|
|
15
13
|
fun <T: View> resolveViewByTag(tag: Int, onResolved: (view: T?) -> Unit) {
|
|
16
14
|
if (tag == INVALID_TAG) {
|
|
17
15
|
// Don't bother trying to resolve an invalid tag.
|
|
18
16
|
onResolved(null)
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
onResolved(it.resolveView(tag) as? T?)
|
|
26
|
-
} catch (e: Exception) {
|
|
27
|
-
// The View instance could not be resolved: log but do not forward exception.
|
|
28
|
-
Log.e(TAG, "Failed to resolve View tag $tag: $e")
|
|
29
|
-
onResolved(null)
|
|
18
|
+
try {
|
|
19
|
+
reactContext.runOnUiQueueThread {
|
|
20
|
+
UIManagerHelper.getUIManagerForReactTag(reactContext, tag)?.let {
|
|
21
|
+
onResolved(it.resolveView(tag) as? T?)
|
|
22
|
+
}
|
|
30
23
|
}
|
|
24
|
+
} catch (e: Exception) {
|
|
25
|
+
// The ReactTHEOplayerView instance could not be resolved: log but do not forward exception.
|
|
26
|
+
Log.e(TAG, "Failed to resolve ReactTHEOplayerView tag $tag: $e")
|
|
27
|
+
onResolved(null)
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
}
|
|
@@ -79,6 +79,11 @@ extension THEOplayerRCTAdsAPI {
|
|
|
79
79
|
resolve(false)
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
@objc(daiSetSnapback:enabled:)
|
|
83
|
+
func daiSetSnapback(_ node: NSNumber, enabled: Bool) -> Void {
|
|
84
|
+
if DEBUG_ADS_API { print(ERROR_MESSAGE_ADS_UNSUPPORTED_FEATURE) }
|
|
85
|
+
}
|
|
86
|
+
|
|
82
87
|
@objc(daiContentTimeForStreamTime:time:resolver:rejecter:)
|
|
83
88
|
func daiContentTimeForStreamTime(_ node: NSNumber, timeValue: NSNumber, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
84
89
|
if DEBUG_ADS_API { print(ERROR_MESSAGE_ADS_UNSUPPORTED_FEATURE) }
|
|
@@ -14,6 +14,7 @@ class WebPresentationModeManager {
|
|
|
14
14
|
constructor(player, eventForwarder) {
|
|
15
15
|
this._player = player;
|
|
16
16
|
this._eventForwarder = eventForwarder;
|
|
17
|
+
this._player.presentation.addEventListener('presentationmodechange', this.updatePresentationMode);
|
|
17
18
|
}
|
|
18
19
|
get presentationMode() {
|
|
19
20
|
return this._presentationMode;
|
|
@@ -34,7 +35,7 @@ class WebPresentationModeManager {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
} else if (presentationMode === _reactNativeTheoplayer.PresentationMode.pip) {
|
|
37
|
-
|
|
38
|
+
this._player.presentation.requestMode('native-picture-in-picture');
|
|
38
39
|
} else {
|
|
39
40
|
if (this._presentationMode === _reactNativeTheoplayer.PresentationMode.fullscreen) {
|
|
40
41
|
const promise = document[_FullscreenAPI.fullscreenAPI.exitFullscreen_]();
|
|
@@ -51,7 +52,7 @@ class WebPresentationModeManager {
|
|
|
51
52
|
if (presentationMode === _reactNativeTheoplayer.PresentationMode.fullscreen) {
|
|
52
53
|
this._element?.webkitEnterFullscreen?.();
|
|
53
54
|
} else if (presentationMode === _reactNativeTheoplayer.PresentationMode.pip) {
|
|
54
|
-
this.
|
|
55
|
+
this._player.presentation.requestMode('native-picture-in-picture');
|
|
55
56
|
} else {
|
|
56
57
|
this._element?.webkitSetPresentationMode?.(_reactNativeTheoplayer.PresentationMode.inline);
|
|
57
58
|
}
|
|
@@ -68,15 +69,6 @@ class WebPresentationModeManager {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
// listen for pip updates on element
|
|
72
|
-
if (this._element !== undefined) {
|
|
73
|
-
this._element.onenterpictureinpicture = () => {
|
|
74
|
-
this.updatePresentationMode();
|
|
75
|
-
};
|
|
76
|
-
this._element.onleavepictureinpicture = () => {
|
|
77
|
-
this.updatePresentationMode();
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
72
|
// listen for fullscreen updates on document
|
|
81
73
|
if (_FullscreenAPI.fullscreenAPI !== undefined) {
|
|
82
74
|
document.addEventListener(_FullscreenAPI.fullscreenAPI.fullscreenchange_, this.updatePresentationMode);
|
|
@@ -88,7 +80,7 @@ class WebPresentationModeManager {
|
|
|
88
80
|
let newPresentationMode = _reactNativeTheoplayer.PresentationMode.inline;
|
|
89
81
|
if (_FullscreenAPI.fullscreenAPI !== undefined && document[_FullscreenAPI.fullscreenAPI.fullscreenElement_] !== null) {
|
|
90
82
|
newPresentationMode = _reactNativeTheoplayer.PresentationMode.fullscreen;
|
|
91
|
-
} else if (
|
|
83
|
+
} else if (this._player.presentation.currentMode === 'native-picture-in-picture') {
|
|
92
84
|
newPresentationMode = _reactNativeTheoplayer.PresentationMode.pip;
|
|
93
85
|
}
|
|
94
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeTheoplayer","require","_PlayerEvents","_FullscreenAPI","_CommonUtils","WebPresentationModeManager","_presentationMode","PresentationMode","inline","_element","undefined","constructor","player","eventForwarder","_player","_eventForwarder","presentationMode","prepareForPresentationModeChanges","fullscreenAPI","fullscreen","appElement","document","getElementById","promise","requestFullscreen_","then","noOp","pip","
|
|
1
|
+
{"version":3,"names":["_reactNativeTheoplayer","require","_PlayerEvents","_FullscreenAPI","_CommonUtils","WebPresentationModeManager","_presentationMode","PresentationMode","inline","_element","undefined","constructor","player","eventForwarder","_player","_eventForwarder","presentation","addEventListener","updatePresentationMode","presentationMode","prepareForPresentationModeChanges","fullscreenAPI","fullscreen","appElement","document","getElementById","promise","requestFullscreen_","then","noOp","pip","requestMode","exitFullscreen_","exitPictureInPicture","webkitEnterFullscreen","webkitSetPresentationMode","elements","element","children","Array","from","tagName","videoElement","src","srcObject","fullscreenchange_","fullscreenerror_","newPresentationMode","fullscreenElement_","currentMode","previousPresentationMode","dispatchEvent","DefaultPresentationModeChangeEvent","exports"],"sourceRoot":"../../../../../src","sources":["internal/adapter/web/WebPresentationModeManager.ts"],"mappings":";;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEO,MAAMI,0BAA0B,CAAC;EAE9BC,iBAAiB,GAAqBC,uCAAgB,CAACC,MAAM;EAC7DC,QAAQ,GAAiCC,SAAS;EAG1DC,WAAWA,CAACC,MAAwB,EAAEC,cAAsD,EAAE;IAC5F,IAAI,CAACC,OAAO,GAAGF,MAAM;IACrB,IAAI,CAACG,eAAe,GAAGF,cAAc;IACrC,IAAI,CAACC,OAAO,CAACE,YAAY,CAACC,gBAAgB,CAAC,wBAAwB,EAAE,IAAI,CAACC,sBAAsB,CAAC;EACnG;EAEA,IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAACb,iBAAiB;EAC/B;EAEA,IAAIa,gBAAgBA,CAACA,gBAAkC,EAAE;IACvD,IAAIA,gBAAgB,KAAK,IAAI,CAACb,iBAAiB,EAAE;MAC/C;IACF;IAEA,IAAI,CAACc,iCAAiC,CAAC,CAAC;IAExC,IAAIC,4BAAa,KAAKX,S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,CAAC5C,iBAAiB;IACvD,IAAIyC,mBAAmB,KAAKG,wBAAwB,EAAE;MACpD,IAAI,CAAC5C,iBAAiB,GAAGyC,mBAAmB;MAC5C,IAAI,CAAChC,eAAe,CAACoC,aAAa,CAAC,IAAIC,gDAAkC,CAAC,IAAI,CAAC9C,iBAAiB,EAAE4C,wBAAwB,CAAC,CAAC;IAC9H;EACF,CAAC;AACH;AAACG,OAAA,CAAAhD,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"8.
|
|
1
|
+
{"version":"8.13.0","buildDate":"2025-01-15T19:38:29.644Z"}
|
|
@@ -8,6 +8,7 @@ export class WebPresentationModeManager {
|
|
|
8
8
|
constructor(player, eventForwarder) {
|
|
9
9
|
this._player = player;
|
|
10
10
|
this._eventForwarder = eventForwarder;
|
|
11
|
+
this._player.presentation.addEventListener('presentationmodechange', this.updatePresentationMode);
|
|
11
12
|
}
|
|
12
13
|
get presentationMode() {
|
|
13
14
|
return this._presentationMode;
|
|
@@ -28,7 +29,7 @@ export class WebPresentationModeManager {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
} else if (presentationMode === PresentationMode.pip) {
|
|
31
|
-
|
|
32
|
+
this._player.presentation.requestMode('native-picture-in-picture');
|
|
32
33
|
} else {
|
|
33
34
|
if (this._presentationMode === PresentationMode.fullscreen) {
|
|
34
35
|
const promise = document[fullscreenAPI.exitFullscreen_]();
|
|
@@ -45,7 +46,7 @@ export class WebPresentationModeManager {
|
|
|
45
46
|
if (presentationMode === PresentationMode.fullscreen) {
|
|
46
47
|
this._element?.webkitEnterFullscreen?.();
|
|
47
48
|
} else if (presentationMode === PresentationMode.pip) {
|
|
48
|
-
this.
|
|
49
|
+
this._player.presentation.requestMode('native-picture-in-picture');
|
|
49
50
|
} else {
|
|
50
51
|
this._element?.webkitSetPresentationMode?.(PresentationMode.inline);
|
|
51
52
|
}
|
|
@@ -62,15 +63,6 @@ export class WebPresentationModeManager {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
// listen for pip updates on element
|
|
66
|
-
if (this._element !== undefined) {
|
|
67
|
-
this._element.onenterpictureinpicture = () => {
|
|
68
|
-
this.updatePresentationMode();
|
|
69
|
-
};
|
|
70
|
-
this._element.onleavepictureinpicture = () => {
|
|
71
|
-
this.updatePresentationMode();
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
66
|
// listen for fullscreen updates on document
|
|
75
67
|
if (fullscreenAPI !== undefined) {
|
|
76
68
|
document.addEventListener(fullscreenAPI.fullscreenchange_, this.updatePresentationMode);
|
|
@@ -82,7 +74,7 @@ export class WebPresentationModeManager {
|
|
|
82
74
|
let newPresentationMode = PresentationMode.inline;
|
|
83
75
|
if (fullscreenAPI !== undefined && document[fullscreenAPI.fullscreenElement_] !== null) {
|
|
84
76
|
newPresentationMode = PresentationMode.fullscreen;
|
|
85
|
-
} else if (
|
|
77
|
+
} else if (this._player.presentation.currentMode === 'native-picture-in-picture') {
|
|
86
78
|
newPresentationMode = PresentationMode.pip;
|
|
87
79
|
}
|
|
88
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PresentationMode","DefaultPresentationModeChangeEvent","fullscreenAPI","noOp","WebPresentationModeManager","_presentationMode","inline","_element","undefined","constructor","player","eventForwarder","_player","_eventForwarder","presentationMode","prepareForPresentationModeChanges","fullscreen","appElement","document","getElementById","promise","requestFullscreen_","then","pip","
|
|
1
|
+
{"version":3,"names":["PresentationMode","DefaultPresentationModeChangeEvent","fullscreenAPI","noOp","WebPresentationModeManager","_presentationMode","inline","_element","undefined","constructor","player","eventForwarder","_player","_eventForwarder","presentation","addEventListener","updatePresentationMode","presentationMode","prepareForPresentationModeChanges","fullscreen","appElement","document","getElementById","promise","requestFullscreen_","then","pip","requestMode","exitFullscreen_","exitPictureInPicture","webkitEnterFullscreen","webkitSetPresentationMode","elements","element","children","Array","from","tagName","videoElement","src","srcObject","fullscreenchange_","fullscreenerror_","newPresentationMode","fullscreenElement_","currentMode","previousPresentationMode","dispatchEvent"],"sourceRoot":"../../../../../src","sources":["internal/adapter/web/WebPresentationModeManager.ts"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,kCAAkC,QAAQ,uBAAuB;AAE1E,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,IAAI,QAAQ,yBAAyB;AAE9C,OAAO,MAAMC,0BAA0B,CAAC;EAE9BC,iBAAiB,GAAqBL,gBAAgB,CAACM,MAAM;EAC7DC,QAAQ,GAAiCC,SAAS;EAG1DC,WAAWA,CAACC,MAAwB,EAAEC,cAAsD,EAAE;IAC5F,IAAI,CAACC,OAAO,GAAGF,MAAM;IACrB,IAAI,CAACG,eAAe,GAAGF,cAAc;IACrC,IAAI,CAACC,OAAO,CAACE,YAAY,CAACC,gBAAgB,CAAC,wBAAwB,EAAE,IAAI,CAACC,sBAAsB,CAAC;EACnG;EAEA,IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAACZ,iBAAiB;EAC/B;EAEA,IAAIY,gBAAgBA,CAACA,gBAAkC,EAAE;IACvD,IAAIA,gBAAgB,KAAK,IAAI,CAACZ,iBAAiB,EAAE;MAC/C;IACF;IAEA,IAAI,CAACa,iCAAiC,CAAC,CAAC;IAExC,IAAIhB,aAAa,KAAKM,SAAS,EAAE;MAC/B;MACA,IAAIS,gBAAgB,KAAKjB,gBAAgB,CAACmB,UAAU,EAAE;QACpD,MAAMC,UAAU,GAAGC,QAAQ,CAACC,cAAc,CAAC,KAAK,CAAC,IAAID,QAAQ,CAACC,cAAc,CAAC,MAAM,CAAC;QACpF,IAAIF,UAAU,KAAK,IAAI,EAAE;UACvB,MAAMG,OAAO,GAAGH,UAAU,CAAClB,aAAa,CAACsB,kBAAkB,CAAC,CAAC,CAAC;UAC9D,IAAID,OAAO,IAAIA,OAAO,CAACE,IAAI,EAAE;YAC3BF,OAAO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ate":"2025-01-15T19:38:29.644Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebPresentationModeManager.d.ts","sourceRoot":"","sources":["../../../../../src/internal/adapter/web/WebPresentationModeManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAI9E,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAA6C;IACtE,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,eAAe,CAAyC;gBAEpD,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,sBAAsB,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"WebPresentationModeManager.d.ts","sourceRoot":"","sources":["../../../../../src/internal/adapter/web/WebPresentationModeManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAI9E,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAA6C;IACtE,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,eAAe,CAAyC;gBAEpD,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,sBAAsB,CAAC,cAAc,CAAC;IAM5F,IAAI,gBAAgB,IAAI,gBAAgB,CAEvC;IAED,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,gBAAgB,EAwCtD;IAED,OAAO,CAAC,iCAAiC;IAkBzC,OAAO,CAAC,sBAAsB,CAe5B;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-theoplayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"description": "A THEOplayer video component for react-native.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@eslint/js": "^9.13.0",
|
|
60
|
-
"@react-native/eslint-config": "^0.
|
|
60
|
+
"@react-native/eslint-config": "^0.76.5",
|
|
61
61
|
"@types/react": "^18.3.12",
|
|
62
62
|
"eslint": "^8.57.1",
|
|
63
63
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"pod-install": "^0.1.39",
|
|
67
67
|
"prettier": "^3.3.3",
|
|
68
68
|
"react": "^18.3.1",
|
|
69
|
-
"react-native": "^0.
|
|
69
|
+
"react-native": "^0.76.5",
|
|
70
70
|
"react-native-builder-bob": "^0.23.2",
|
|
71
|
-
"theoplayer": "^8.
|
|
71
|
+
"theoplayer": "^8.9.0",
|
|
72
72
|
"typedoc": "^0.25.13",
|
|
73
73
|
"typedoc-plugin-external-resolver": "^1.0.3",
|
|
74
74
|
"typedoc-plugin-mdn-links": "^3.3.4",
|
|
@@ -15,6 +15,7 @@ export class WebPresentationModeManager {
|
|
|
15
15
|
constructor(player: ChromelessPlayer, eventForwarder: DefaultEventDispatcher<PlayerEventMap>) {
|
|
16
16
|
this._player = player;
|
|
17
17
|
this._eventForwarder = eventForwarder;
|
|
18
|
+
this._player.presentation.addEventListener('presentationmodechange', this.updatePresentationMode);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
get presentationMode(): PresentationMode {
|
|
@@ -39,7 +40,7 @@ export class WebPresentationModeManager {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
} else if (presentationMode === PresentationMode.pip) {
|
|
42
|
-
|
|
43
|
+
this._player.presentation.requestMode('native-picture-in-picture');
|
|
43
44
|
} else {
|
|
44
45
|
if (this._presentationMode === PresentationMode.fullscreen) {
|
|
45
46
|
const promise = document[fullscreenAPI.exitFullscreen_]();
|
|
@@ -56,7 +57,7 @@ export class WebPresentationModeManager {
|
|
|
56
57
|
if (presentationMode === PresentationMode.fullscreen) {
|
|
57
58
|
this._element?.webkitEnterFullscreen?.();
|
|
58
59
|
} else if (presentationMode === PresentationMode.pip) {
|
|
59
|
-
this.
|
|
60
|
+
this._player.presentation.requestMode('native-picture-in-picture');
|
|
60
61
|
} else {
|
|
61
62
|
this._element?.webkitSetPresentationMode?.(PresentationMode.inline);
|
|
62
63
|
}
|
|
@@ -74,15 +75,6 @@ export class WebPresentationModeManager {
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
// listen for pip updates on element
|
|
78
|
-
if (this._element !== undefined) {
|
|
79
|
-
this._element.onenterpictureinpicture = () => {
|
|
80
|
-
this.updatePresentationMode();
|
|
81
|
-
};
|
|
82
|
-
this._element.onleavepictureinpicture = () => {
|
|
83
|
-
this.updatePresentationMode();
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
78
|
// listen for fullscreen updates on document
|
|
87
79
|
if (fullscreenAPI !== undefined) {
|
|
88
80
|
document.addEventListener(fullscreenAPI.fullscreenchange_, this.updatePresentationMode);
|
|
@@ -95,7 +87,7 @@ export class WebPresentationModeManager {
|
|
|
95
87
|
let newPresentationMode: PresentationMode = PresentationMode.inline;
|
|
96
88
|
if (fullscreenAPI !== undefined && document[fullscreenAPI.fullscreenElement_] !== null) {
|
|
97
89
|
newPresentationMode = PresentationMode.fullscreen;
|
|
98
|
-
} else if (
|
|
90
|
+
} else if (this._player.presentation.currentMode === 'native-picture-in-picture') {
|
|
99
91
|
newPresentationMode = PresentationMode.pip;
|
|
100
92
|
}
|
|
101
93
|
|
package/src/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"8.
|
|
1
|
+
{"version":"8.13.0","buildDate":"2025-01-15T19:38:29.644Z"}
|