react-native-video-provider 0.2.1 → 0.2.3
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/auvideo/AuVideoModule.kt +15 -10
- package/ios/AuVideo.mm +4 -4
- package/ios/AuVideoOrientation.swift +31 -14
- package/lib/module/NativeAuVideo.js.map +1 -1
- package/lib/module/components/FloatingPlayer.js +8 -11
- package/lib/module/components/FloatingPlayer.js.map +1 -1
- package/lib/module/components/MiniPlayer.js +10 -10
- package/lib/module/components/MiniPlayer.js.map +1 -1
- package/lib/module/components/SvgIcons.js +163 -0
- package/lib/module/components/SvgIcons.js.map +1 -0
- package/lib/module/components/VideoControls.js +83 -46
- package/lib/module/components/VideoControls.js.map +1 -1
- package/lib/module/components/icons.js +164 -0
- package/lib/module/components/icons.js.map +1 -0
- package/lib/module/core/VideoManager.js +15 -17
- package/lib/module/core/VideoManager.js.map +1 -1
- package/lib/typescript/src/NativeAuVideo.d.ts +8 -4
- package/lib/typescript/src/NativeAuVideo.d.ts.map +1 -1
- package/lib/typescript/src/components/MiniPlayer.d.ts.map +1 -1
- package/lib/typescript/src/components/SvgIcons.d.ts +8 -0
- package/lib/typescript/src/components/SvgIcons.d.ts.map +1 -0
- package/lib/typescript/src/components/VideoControls.d.ts.map +1 -1
- package/lib/typescript/src/components/icons.d.ts +13 -0
- package/lib/typescript/src/components/icons.d.ts.map +1 -0
- package/lib/typescript/src/core/VideoManager.d.ts +6 -5
- package/lib/typescript/src/core/VideoManager.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/NativeAuVideo.ts +8 -4
- package/src/components/FloatingPlayer.tsx +3 -7
- package/src/components/MiniPlayer.tsx +7 -6
- package/src/components/SvgIcons.tsx +169 -0
- package/src/components/VideoControls.tsx +71 -36
- package/src/components/icons.tsx +117 -0
- package/src/core/VideoManager.ts +18 -17
package/src/core/VideoManager.ts
CHANGED
|
@@ -77,8 +77,6 @@ export class VideoManager {
|
|
|
77
77
|
|
|
78
78
|
/** Per-player default for `enterFullscreen()` (VideoPlayer's prop). */
|
|
79
79
|
private fullscreenOrientationDefault: OrientationLock | null = null;
|
|
80
|
-
/** True while a fullscreen-scoped lock is applied, so exit restores it. */
|
|
81
|
-
private fullscreenLockApplied = false;
|
|
82
80
|
|
|
83
81
|
private constructor() {}
|
|
84
82
|
|
|
@@ -375,8 +373,11 @@ export class VideoManager {
|
|
|
375
373
|
/**
|
|
376
374
|
* Show the built-in fullscreen host. Rotation unlocks by default; pass an
|
|
377
375
|
* orientation (or set VideoPlayer's `fullscreenOrientation` prop) to force
|
|
378
|
-
* one for the fullscreen session only
|
|
379
|
-
*
|
|
376
|
+
* one for the fullscreen session only. That scoped orientation is the
|
|
377
|
+
* highest priority — it's applied in the SAME native call as entering
|
|
378
|
+
* fullscreen (never as a separate follow-up call), so there is no
|
|
379
|
+
* unlocked frame where the sensor could win before the lock takes effect.
|
|
380
|
+
* Restored on exit; the rest of the app never sees the lock.
|
|
380
381
|
*/
|
|
381
382
|
enterFullscreen(orientation?: OrientationLock): void {
|
|
382
383
|
if (this.store.getState().fullscreen) {
|
|
@@ -384,30 +385,31 @@ export class VideoManager {
|
|
|
384
385
|
}
|
|
385
386
|
this.set({ fullscreen: true, floating: false });
|
|
386
387
|
this.setMode('fullscreen');
|
|
387
|
-
NativeAuVideo.enterFullscreen();
|
|
388
388
|
// `enter` is often passed straight to onPress, so the argument may be a
|
|
389
389
|
// press event — only honor real orientation values.
|
|
390
390
|
const requested = ORIENTATION_LOCKS.includes(orientation as OrientationLock)
|
|
391
391
|
? (orientation as OrientationLock)
|
|
392
392
|
: this.fullscreenOrientationDefault;
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
393
|
+
// A scoped override wins outright; otherwise carry any standing
|
|
394
|
+
// setOrientation() lock through fullscreen unchanged (still higher
|
|
395
|
+
// priority than the sensor unlock — 'auto' just means neither applies).
|
|
396
|
+
const lock =
|
|
397
|
+
requested && requested !== 'auto'
|
|
398
|
+
? requested
|
|
399
|
+
: this.store.getState().orientationLock;
|
|
400
|
+
NativeAuVideo.enterFullscreen(lock);
|
|
397
401
|
this.events.emit('onEnterFullscreen', undefined);
|
|
398
402
|
}
|
|
399
403
|
|
|
400
|
-
/** Restore the
|
|
404
|
+
/** Restore the standing orientation lock (if any) and re-attach the previous surface. */
|
|
401
405
|
exitFullscreen(): void {
|
|
402
406
|
if (!this.store.getState().fullscreen) {
|
|
403
407
|
return;
|
|
404
408
|
}
|
|
405
|
-
if
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
NativeAuVideo.exitFullscreen();
|
|
409
|
+
// Always restore the standing lock (or 'auto' if none) — a
|
|
410
|
+
// fullscreen-scoped override was never written to state, so this
|
|
411
|
+
// naturally drops it without needing to track whether one was applied.
|
|
412
|
+
NativeAuVideo.exitFullscreen(this.store.getState().orientationLock);
|
|
411
413
|
this.set({ fullscreen: false });
|
|
412
414
|
this.events.emit('onExitFullscreen', undefined);
|
|
413
415
|
this.restoreInlineSurface();
|
|
@@ -482,7 +484,6 @@ export class VideoManager {
|
|
|
482
484
|
this.initialized = false;
|
|
483
485
|
this.lastInlineSurfaceId = null;
|
|
484
486
|
this.fullscreenOrientationDefault = null;
|
|
485
|
-
this.fullscreenLockApplied = false;
|
|
486
487
|
NativeAuVideo.setOrientation('auto');
|
|
487
488
|
NativeAuVideo.releasePlayer();
|
|
488
489
|
this.store.setState({ ...initialVideoState }, true);
|