@simba-dev/react-native-media-player 1.10.0 → 1.12.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/android/src/main/java/com/simba/player/IMpvConfigProvider.kt +6 -6
- package/android/src/main/java/com/simba/player/IPipModeChangeEmitter.kt +10 -16
- package/android/src/main/java/com/simba/player/MediaPlaybackService.kt +410 -103
- package/android/src/main/java/com/simba/player/PlaybackHost.kt +152 -0
- package/android/src/main/java/com/simba/player/PlayerActivity.kt +149 -438
- package/android/src/main/java/com/simba/player/mpv/MpvBridgeModule.kt +385 -14
- package/package.json +1 -1
- package/src/bridge/MpvPlayerModule.ts +68 -1
- package/src/bridge/NativeMpvPlayer.ts +30 -0
- package/src/hooks/__tests__/useResumeThumbnail.test.ts +154 -0
- package/src/hooks/useResumeThumbnail.ts +153 -0
- package/src/index.ts +12 -0
- package/android/src/main/java/com/simba/player/IMpvNativePtrProvider.kt +0 -30
|
@@ -6,8 +6,7 @@ package com.simba.player
|
|
|
6
6
|
* JS) without crossing the Gradle module boundary into the consumer
|
|
7
7
|
* app's bridge code.
|
|
8
8
|
*
|
|
9
|
-
* Pattern mirrors [
|
|
10
|
-
* [IPipModeChangeEmitter] (Phase 10): the consumer app's
|
|
9
|
+
* Pattern mirrors [IPipModeChangeEmitter] (Phase 10): the consumer app's
|
|
11
10
|
* `MpvBridgeModule` implements this contract; module code looks it up
|
|
12
11
|
* via `reactContext.getNativeModule("MpvPlayerModule") as?
|
|
13
12
|
* IMpvConfigProvider` and casts. The cast is safe because we control
|
|
@@ -19,10 +18,11 @@ package com.simba.player
|
|
|
19
18
|
* Future phases (22-25) extend the lookup to read theme + pip + audio
|
|
20
19
|
* settings and apply them.
|
|
21
20
|
*
|
|
22
|
-
* Why
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
21
|
+
* Why this survives V20 Phase A while its sibling did not: this contract
|
|
22
|
+
* carries data pushed *by React*, so it genuinely needs the React
|
|
23
|
+
* context to reach. The native-pointer contract it used to mirror did
|
|
24
|
+
* not — it carried a process-global, so V20 replaced it with
|
|
25
|
+
* `PlaybackHost`, and it was deleted rather than left as fiction.
|
|
26
26
|
*/
|
|
27
27
|
interface IMpvConfigProvider {
|
|
28
28
|
/**
|
|
@@ -2,16 +2,13 @@ package com.simba.player
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Module-side contract that lets `PlayerActivity` (in the module)
|
|
5
|
-
emit PiP mode-change events to JS without holding a direct reference
|
|
6
|
-
to `MpvBridgeModule
|
|
7
|
-
`com.simba.player.mpv` package — Gradle forbids the module from
|
|
8
|
-
importing the app).
|
|
5
|
+
* emit PiP mode-change events to JS without holding a direct reference
|
|
6
|
+
* to `MpvBridgeModule`.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* control both sides of the boundary.
|
|
8
|
+
* The consumer app's bridge module implements this contract; module code
|
|
9
|
+
* looks it up via `reactContext.getNativeModule("MpvPlayerModule") as?
|
|
10
|
+
* IPipModeChangeEmitter` and casts. The cast is safe because we control
|
|
11
|
+
* both sides.
|
|
15
12
|
*
|
|
16
13
|
* Phase 10 deliverable: `PlayerActivity.onPictureInPictureModeChanged`
|
|
17
14
|
* looks up the bridge module and calls [emitPictureInPictureModeChanged]
|
|
@@ -19,13 +16,10 @@ package com.simba.player
|
|
|
19
16
|
* (where `MainActivity.onPictureInPictureModeChanged` called
|
|
20
17
|
* `MpvBridgeModule.onPictureInPictureModeChanged(isInPip)` directly).
|
|
21
18
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* separate means each is independently mockable in tests and each
|
|
27
|
-
* fails loudly at the cast site if the bridge module ever drops one
|
|
28
|
-
* capability while keeping the other.
|
|
19
|
+
* Unlike the native-pointer contract this once mirrored, this one
|
|
20
|
+
* genuinely needs the React context - it exists to deliver an event
|
|
21
|
+
* *to JS*. That is why it survives V20 Phase A while that one was
|
|
22
|
+
* deleted and replaced by `PlaybackHost`.
|
|
29
23
|
*/
|
|
30
24
|
interface IPipModeChangeEmitter {
|
|
31
25
|
/**
|