@simba-dev/react-native-media-player 3.0.3 → 3.0.5
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 +2351 -0
- package/README.md +43 -12
- package/android/src/main/java/com/simba/player/PipManager.kt +26 -11
- package/android/src/main/java/com/simba/player/mpv/MpvBridgeModule.kt +99 -94
- package/package.json +2 -1
- package/src/bridge/MpvPlayerModule.ts +38 -7
- package/src/components/PlayerProvider.tsx +10 -38
- package/src/index.ts +6 -7
- package/src/types/config.ts +12 -1
- package/src/types/player.ts +13 -6
- package/tsconfig.json +1 -2
package/src/types/player.ts
CHANGED
|
@@ -141,11 +141,12 @@ export interface PlaylistEntry {
|
|
|
141
141
|
* `usePlayerProgress()` is separate from `usePlayer()` so consumers
|
|
142
142
|
* that only need position/duration don't re-render on every
|
|
143
143
|
* `onPropertyChanged('volume')` etc. The provider updates the
|
|
144
|
-
* progress context from the native mpv event stream — position
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
144
|
+
* progress context from the native mpv event stream — position arrives
|
|
145
|
+
* on the `time-pos` property event, coalesced natively at 250 ms (4 Hz),
|
|
146
|
+
* while duration arrives on the `duration` property event, which is NOT
|
|
147
|
+
* coalesced and is forwarded as it arrives — and `isBuffering` /
|
|
148
|
+
* `isSeeking` / `seekable` / `cacheRanges` / `cacheFill` each have their
|
|
149
|
+
* own dedicated event — plus a one-shot hydration read at mount.
|
|
149
150
|
*/
|
|
150
151
|
export interface PlayerProgress {
|
|
151
152
|
// ── V12 surface (preserved) ───────────────────────────────────────────
|
|
@@ -169,6 +170,11 @@ export interface PlayerProgress {
|
|
|
169
170
|
* native bridge converts, because it is the only layer that knows which
|
|
170
171
|
* unit a payload carried.
|
|
171
172
|
*
|
|
173
|
+
* The published boundaries are SNAPPED to the grid the scrub bar is
|
|
174
|
+
* drawn at — the timeline cut into `durationMs / 1000` cells, or a fixed
|
|
175
|
+
* one-second grid when the duration is unknown — so the values are a
|
|
176
|
+
* rounded grid, not raw mpv readings.
|
|
177
|
+
*
|
|
172
178
|
* Empty when the source exposes no time-space cache information. A byte
|
|
173
179
|
* offset is NOT a time and is never reported here: a range painted from
|
|
174
180
|
* byte offsets would claim that unbuffered data is buffered.
|
|
@@ -919,7 +925,7 @@ export function usePlayer(): UsePlayerResult {
|
|
|
919
925
|
* volume / track / chapter change.
|
|
920
926
|
*
|
|
921
927
|
* The provider updates the progress context only on:
|
|
922
|
-
* - the native mpv event stream (position, duration,
|
|
928
|
+
* - the native mpv event stream (position, duration, …)
|
|
923
929
|
* - `onBuffering` / `onSeeking` / `onSeekable` / `onCacheState` /
|
|
924
930
|
* `onCacheFill` events
|
|
925
931
|
* - a one-shot hydration read at mount
|
|
@@ -1473,6 +1479,7 @@ export function applyPlayerEvent(
|
|
|
1473
1479
|
case 'onPipPlayPause':
|
|
1474
1480
|
case 'onPipExpand':
|
|
1475
1481
|
case 'onPipClose':
|
|
1482
|
+
case 'onUserLeaveHint':
|
|
1476
1483
|
// No state-field mapping for these in the V13 surface (PiP state
|
|
1477
1484
|
// is owned by the activity; reconfig signals a video-parameter
|
|
1478
1485
|
// change that's already covered by onVideoParamsChanged).
|