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.
Files changed (34) hide show
  1. package/android/src/main/java/com/auvideo/AuVideoModule.kt +15 -10
  2. package/ios/AuVideo.mm +4 -4
  3. package/ios/AuVideoOrientation.swift +31 -14
  4. package/lib/module/NativeAuVideo.js.map +1 -1
  5. package/lib/module/components/FloatingPlayer.js +8 -11
  6. package/lib/module/components/FloatingPlayer.js.map +1 -1
  7. package/lib/module/components/MiniPlayer.js +10 -10
  8. package/lib/module/components/MiniPlayer.js.map +1 -1
  9. package/lib/module/components/SvgIcons.js +163 -0
  10. package/lib/module/components/SvgIcons.js.map +1 -0
  11. package/lib/module/components/VideoControls.js +83 -46
  12. package/lib/module/components/VideoControls.js.map +1 -1
  13. package/lib/module/components/icons.js +164 -0
  14. package/lib/module/components/icons.js.map +1 -0
  15. package/lib/module/core/VideoManager.js +15 -17
  16. package/lib/module/core/VideoManager.js.map +1 -1
  17. package/lib/typescript/src/NativeAuVideo.d.ts +8 -4
  18. package/lib/typescript/src/NativeAuVideo.d.ts.map +1 -1
  19. package/lib/typescript/src/components/MiniPlayer.d.ts.map +1 -1
  20. package/lib/typescript/src/components/SvgIcons.d.ts +8 -0
  21. package/lib/typescript/src/components/SvgIcons.d.ts.map +1 -0
  22. package/lib/typescript/src/components/VideoControls.d.ts.map +1 -1
  23. package/lib/typescript/src/components/icons.d.ts +13 -0
  24. package/lib/typescript/src/components/icons.d.ts.map +1 -0
  25. package/lib/typescript/src/core/VideoManager.d.ts +6 -5
  26. package/lib/typescript/src/core/VideoManager.d.ts.map +1 -1
  27. package/package.json +4 -2
  28. package/src/NativeAuVideo.ts +8 -4
  29. package/src/components/FloatingPlayer.tsx +3 -7
  30. package/src/components/MiniPlayer.tsx +7 -6
  31. package/src/components/SvgIcons.tsx +169 -0
  32. package/src/components/VideoControls.tsx +71 -36
  33. package/src/components/icons.tsx +117 -0
  34. package/src/core/VideoManager.ts +18 -17
@@ -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 it is restored on exit, so the
379
- * rest of the app never sees the lock.
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
- if (requested && requested !== 'auto') {
394
- this.fullscreenLockApplied = true;
395
- NativeAuVideo.setOrientation(requested);
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 previous orientation lock and re-attach the previous surface. */
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 (this.fullscreenLockApplied) {
406
- this.fullscreenLockApplied = false;
407
- // Drop the fullscreen-only lock, restoring any explicit setOrientation.
408
- NativeAuVideo.setOrientation(this.store.getState().orientationLock);
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);