suada-components 1.9.0 → 1.9.1

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 (96) hide show
  1. package/dist/{components/DailyMotion-B7yDPBbg.js → DailyMotion-B-Q4fBEb.js} +1 -1
  2. package/dist/{components/DailyMotion-BmnymjR1.esm.js → DailyMotion-BAvo3Toe.esm.js} +1 -1
  3. package/dist/{components/Facebook-D9Ak6ZJU.esm.js → Facebook-C8GOujDt.esm.js} +1 -1
  4. package/dist/{components/Facebook-42iqQU2G.js → Facebook-CASik-P5.js} +1 -1
  5. package/dist/{components/FilePlayer-wg9lyafD.esm.js → FilePlayer-BOZIvaDy.esm.js} +1 -1
  6. package/dist/{components/FilePlayer-CAnHK0Cd.js → FilePlayer-CQ80KWY2.js} +1 -1
  7. package/dist/{components/Kaltura-DPaEN-dq.esm.js → Kaltura-B12Xdl6X.esm.js} +1 -1
  8. package/dist/{components/Kaltura-Ct6kwbgP.js → Kaltura-nYc5k7UB.js} +1 -1
  9. package/dist/{components/Mixcloud-sBbcL5rG.js → Mixcloud-DGQnlDAK.js} +1 -1
  10. package/dist/{components/Mixcloud-BobSN3YI.esm.js → Mixcloud-JfeQIOki.esm.js} +1 -1
  11. package/dist/{components/Mux-B9YP-rFr.esm.js → Mux-BHWzpAR-.esm.js} +1 -1
  12. package/dist/{components/Mux-Cosy8sFO.js → Mux-CiKZc8gj.js} +1 -1
  13. package/dist/{components/Preview-XcTlhHT1.esm.js → Preview-DSovY9gr.esm.js} +1 -1
  14. package/dist/{components/Preview-DiVfo6aa.js → Preview-DvZKrgm5.js} +1 -1
  15. package/dist/{components/SoundCloud-CIWqB-QW.js → SoundCloud-Di7z3nmP.js} +1 -1
  16. package/dist/{components/SoundCloud-BTHoyFWT.esm.js → SoundCloud-j_R0lK8D.esm.js} +1 -1
  17. package/dist/{components/Streamable-DsfQCy3p.esm.js → Streamable-CRhXZIKP.esm.js} +1 -1
  18. package/dist/{components/Streamable-9anYiQtU.js → Streamable-CV1mgzRv.js} +1 -1
  19. package/dist/{components/Twitch-D1BOr8hj.esm.js → Twitch-6icfp-ZE.esm.js} +1 -1
  20. package/dist/{components/Twitch-Dud6e1Rv.js → Twitch-Dj66vkCD.js} +1 -1
  21. package/dist/{components/Vidyard-C1csjpQH.esm.js → Vidyard--KX47pZ0.esm.js} +1 -1
  22. package/dist/{components/Vidyard-BuOu85uS.js → Vidyard-B-qmApe9.js} +1 -1
  23. package/dist/{components/Vimeo-CHlHIswX.esm.js → Vimeo-Ba9C6utC.esm.js} +1 -1
  24. package/dist/{components/Vimeo-DrDJ5O9H.js → Vimeo-DePzl7Sn.js} +1 -1
  25. package/dist/{components/Wistia-fh9U2CA2.js → Wistia-CXYB3Yus.js} +1 -1
  26. package/dist/{components/Wistia-D-eYyONb.esm.js → Wistia-DWJcdcY2.esm.js} +1 -1
  27. package/dist/{components/YouTube-CmnnzZvk.esm.js → YouTube-DdBVPxzz.esm.js} +1 -1
  28. package/dist/{components/YouTube-DC2uZ14c.js → YouTube-vwMoW93C.js} +1 -1
  29. package/dist/components/CourseCard/CourseCard.styles.d.ts +1 -1
  30. package/dist/components/DailyMotion-Cr_8IZRR.js +180 -0
  31. package/dist/components/DailyMotion-D2n1NDDi.esm.js +178 -0
  32. package/dist/components/Facebook-CDrTA2_L.esm.js +179 -0
  33. package/dist/components/Facebook-YxZce26V.js +181 -0
  34. package/dist/components/FilePlayer-BzkVMbQ8.esm.js +408 -0
  35. package/dist/components/FilePlayer-DqqTufgX.js +410 -0
  36. package/dist/components/Kaltura-B0UZLr6g.esm.js +176 -0
  37. package/dist/components/Kaltura-krSxvIBr.js +178 -0
  38. package/dist/components/Mixcloud-BCT5e47d.js +166 -0
  39. package/dist/components/Mixcloud-D9qk3D6i.esm.js +164 -0
  40. package/dist/components/Mux-BZleoaJh.esm.js +264 -0
  41. package/dist/components/Mux-D_si09u2.js +266 -0
  42. package/dist/components/Preview-CmduMeEZ.js +175 -0
  43. package/dist/components/Preview-DQLbQ8_C.esm.js +173 -0
  44. package/dist/components/SoundCloud-BHgTfaW7.js +183 -0
  45. package/dist/components/SoundCloud-BgnX8kOF.esm.js +181 -0
  46. package/dist/components/Streamable-DTAzjVwd.js +176 -0
  47. package/dist/components/Streamable-DbRbUflP.esm.js +174 -0
  48. package/dist/components/Twitch-CXOhay4a.esm.js +168 -0
  49. package/dist/components/Twitch-CnEk-l9R.js +170 -0
  50. package/dist/components/VideoPlayer/PiPContext.d.ts +8 -0
  51. package/dist/components/VideoPlayer/PiPContext.js +149 -0
  52. package/dist/components/VideoPlayer/PiPContext.js.map +1 -0
  53. package/dist/components/VideoPlayer/PiPContext.types.d.ts +16 -0
  54. package/dist/components/VideoPlayer/PiPContext.types.js +2 -0
  55. package/dist/components/VideoPlayer/PiPContext.types.js.map +1 -0
  56. package/dist/components/VideoPlayer/usePiP.d.ts +2 -0
  57. package/dist/components/VideoPlayer/usePiP.js +10 -0
  58. package/dist/components/VideoPlayer/usePiP.js.map +1 -0
  59. package/dist/components/VideoPlayer/usePlayerControls.js +12 -40
  60. package/dist/components/VideoPlayer/usePlayerControls.js.map +1 -1
  61. package/dist/components/Vidyard-Cn_LcGwi.js +174 -0
  62. package/dist/components/Vidyard-YcZH6kkW.esm.js +172 -0
  63. package/dist/components/Vimeo-BUVxWt7t.js +215 -0
  64. package/dist/components/Vimeo-Cv0qx3aR.esm.js +213 -0
  65. package/dist/components/Wistia-COWrV8QC.js +190 -0
  66. package/dist/components/Wistia-PneZ48dn.esm.js +188 -0
  67. package/dist/components/YouTube-BUyvzJQw.esm.js +258 -0
  68. package/dist/components/YouTube-DeQdfkWm.js +260 -0
  69. package/dist/components/components/CourseCard/CourseCard.styles.d.ts +1 -1
  70. package/dist/components/components/VideoPlayer/PiPContext.d.ts +8 -0
  71. package/dist/components/components/VideoPlayer/PiPContext.types.d.ts +16 -0
  72. package/dist/components/components/VideoPlayer/usePiP.d.ts +2 -0
  73. package/dist/components/components/index.d.ts +2 -0
  74. package/dist/components/{index-DetZ05pw.js → index-Bs-XxxV4.js} +153 -304
  75. package/dist/components/{index-DKAGRUEW.esm.js → index-C4Mk2H3N.esm.js} +152 -305
  76. package/dist/components/index.d.ts +2 -0
  77. package/dist/components/index.esm.js +1 -1
  78. package/dist/components/index.js +2 -0
  79. package/dist/components/index.js.map +1 -1
  80. package/dist/icons/components/CourseCard/CourseCard.styles.d.ts +1 -1
  81. package/dist/icons/components/VideoPlayer/PiPContext.d.ts +8 -0
  82. package/dist/icons/components/VideoPlayer/PiPContext.types.d.ts +16 -0
  83. package/dist/icons/components/VideoPlayer/usePiP.d.ts +2 -0
  84. package/dist/icons/components/index.d.ts +2 -0
  85. package/dist/index-Bp-idbg5.esm.js +94907 -0
  86. package/dist/index-CSj9NYxJ.js +95129 -0
  87. package/dist/index.d.ts +2 -0
  88. package/dist/index.esm.js +3 -3
  89. package/dist/index.js +3 -0
  90. package/dist/index.js.map +1 -1
  91. package/package.json +1 -1
  92. package/dist/components/VideoPlayer/pipManager.d.ts +0 -60
  93. package/dist/components/VideoPlayer/pipManager.js +0 -272
  94. package/dist/components/VideoPlayer/pipManager.js.map +0 -1
  95. package/dist/components/components/VideoPlayer/pipManager.d.ts +0 -60
  96. package/dist/icons/components/VideoPlayer/pipManager.d.ts +0 -60
@@ -81375,7 +81375,7 @@ function requirePlayers () {
81375
81375
  canPlay: import_patterns.canPlay.youtube,
81376
81376
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81377
81377
  /* webpackChunkName: 'reactPlayerYouTube' */
81378
- './YouTube-DC2uZ14c.js'
81378
+ './YouTube-DeQdfkWm.js'
81379
81379
  ); }).then(function (n) { return n.YouTube; }))
81380
81380
  },
81381
81381
  {
@@ -81384,7 +81384,7 @@ function requirePlayers () {
81384
81384
  canPlay: import_patterns.canPlay.soundcloud,
81385
81385
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81386
81386
  /* webpackChunkName: 'reactPlayerSoundCloud' */
81387
- './SoundCloud-CIWqB-QW.js'
81387
+ './SoundCloud-BHgTfaW7.js'
81388
81388
  ); }).then(function (n) { return n.SoundCloud; }))
81389
81389
  },
81390
81390
  {
@@ -81393,7 +81393,7 @@ function requirePlayers () {
81393
81393
  canPlay: import_patterns.canPlay.vimeo,
81394
81394
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81395
81395
  /* webpackChunkName: 'reactPlayerVimeo' */
81396
- './Vimeo-DrDJ5O9H.js'
81396
+ './Vimeo-BUVxWt7t.js'
81397
81397
  ); }).then(function (n) { return n.Vimeo; }))
81398
81398
  },
81399
81399
  {
@@ -81402,7 +81402,7 @@ function requirePlayers () {
81402
81402
  canPlay: import_patterns.canPlay.mux,
81403
81403
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81404
81404
  /* webpackChunkName: 'reactPlayerMux' */
81405
- './Mux-Cosy8sFO.js'
81405
+ './Mux-D_si09u2.js'
81406
81406
  ); }).then(function (n) { return n.Mux; }))
81407
81407
  },
81408
81408
  {
@@ -81411,7 +81411,7 @@ function requirePlayers () {
81411
81411
  canPlay: import_patterns.canPlay.facebook,
81412
81412
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81413
81413
  /* webpackChunkName: 'reactPlayerFacebook' */
81414
- './Facebook-42iqQU2G.js'
81414
+ './Facebook-YxZce26V.js'
81415
81415
  ); }).then(function (n) { return n.Facebook; }))
81416
81416
  },
81417
81417
  {
@@ -81420,7 +81420,7 @@ function requirePlayers () {
81420
81420
  canPlay: import_patterns.canPlay.streamable,
81421
81421
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81422
81422
  /* webpackChunkName: 'reactPlayerStreamable' */
81423
- './Streamable-9anYiQtU.js'
81423
+ './Streamable-DTAzjVwd.js'
81424
81424
  ); }).then(function (n) { return n.Streamable; }))
81425
81425
  },
81426
81426
  {
@@ -81429,7 +81429,7 @@ function requirePlayers () {
81429
81429
  canPlay: import_patterns.canPlay.wistia,
81430
81430
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81431
81431
  /* webpackChunkName: 'reactPlayerWistia' */
81432
- './Wistia-fh9U2CA2.js'
81432
+ './Wistia-COWrV8QC.js'
81433
81433
  ); }).then(function (n) { return n.Wistia; }))
81434
81434
  },
81435
81435
  {
@@ -81438,7 +81438,7 @@ function requirePlayers () {
81438
81438
  canPlay: import_patterns.canPlay.twitch,
81439
81439
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81440
81440
  /* webpackChunkName: 'reactPlayerTwitch' */
81441
- './Twitch-Dud6e1Rv.js'
81441
+ './Twitch-CnEk-l9R.js'
81442
81442
  ); }).then(function (n) { return n.Twitch; }))
81443
81443
  },
81444
81444
  {
@@ -81447,7 +81447,7 @@ function requirePlayers () {
81447
81447
  canPlay: import_patterns.canPlay.dailymotion,
81448
81448
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81449
81449
  /* webpackChunkName: 'reactPlayerDailyMotion' */
81450
- './DailyMotion-B7yDPBbg.js'
81450
+ './DailyMotion-Cr_8IZRR.js'
81451
81451
  ); }).then(function (n) { return n.DailyMotion; }))
81452
81452
  },
81453
81453
  {
@@ -81456,7 +81456,7 @@ function requirePlayers () {
81456
81456
  canPlay: import_patterns.canPlay.mixcloud,
81457
81457
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81458
81458
  /* webpackChunkName: 'reactPlayerMixcloud' */
81459
- './Mixcloud-sBbcL5rG.js'
81459
+ './Mixcloud-BCT5e47d.js'
81460
81460
  ); }).then(function (n) { return n.Mixcloud; }))
81461
81461
  },
81462
81462
  {
@@ -81465,7 +81465,7 @@ function requirePlayers () {
81465
81465
  canPlay: import_patterns.canPlay.vidyard,
81466
81466
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81467
81467
  /* webpackChunkName: 'reactPlayerVidyard' */
81468
- './Vidyard-BuOu85uS.js'
81468
+ './Vidyard-Cn_LcGwi.js'
81469
81469
  ); }).then(function (n) { return n.Vidyard; }))
81470
81470
  },
81471
81471
  {
@@ -81474,7 +81474,7 @@ function requirePlayers () {
81474
81474
  canPlay: import_patterns.canPlay.kaltura,
81475
81475
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81476
81476
  /* webpackChunkName: 'reactPlayerKaltura' */
81477
- './Kaltura-Ct6kwbgP.js'
81477
+ './Kaltura-krSxvIBr.js'
81478
81478
  ); }).then(function (n) { return n.Kaltura; }))
81479
81479
  },
81480
81480
  {
@@ -81486,7 +81486,7 @@ function requirePlayers () {
81486
81486
  },
81487
81487
  lazyPlayer: (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
81488
81488
  /* webpackChunkName: 'reactPlayerFilePlayer' */
81489
- './FilePlayer-CAnHK0Cd.js'
81489
+ './FilePlayer-DqqTufgX.js'
81490
81490
  ); }).then(function (n) { return n.FilePlayer; }))
81491
81491
  }
81492
81492
  ];
@@ -82307,7 +82307,7 @@ function requireReactPlayer () {
82307
82307
  var import_Player = __toESM(/*@__PURE__*/ requirePlayer());
82308
82308
  const Preview = (0, import_utils.lazy)(() => Promise.resolve().then(function () { return require(
82309
82309
  /* webpackChunkName: 'reactPlayerPreview' */
82310
- './Preview-DiVfo6aa.js'
82310
+ './Preview-CmduMeEZ.js'
82311
82311
  ); }).then(function (n) { return n.Preview; }));
82312
82312
  const IS_BROWSER = typeof window !== "undefined" && window.document && typeof document !== "undefined";
82313
82313
  const IS_GLOBAL = typeof commonjsGlobal !== "undefined" && commonjsGlobal.window && commonjsGlobal.window.document;
@@ -88758,247 +88758,6 @@ var useEventListener = function useEventListener(eventName, handler, element, sh
88758
88758
  }, [eventName, element, shouldRun]);
88759
88759
  };
88760
88760
 
88761
- /**
88762
- * Global Picture-in-Picture Manager
88763
- * This module manages PiP state across component unmounts and route changes
88764
- */
88765
- var PictureInPictureManager = /** @class */function () {
88766
- function PictureInPictureManager() {
88767
- this.videoElement = null;
88768
- this.pipContainer = null;
88769
- this.currentVideoState = null;
88770
- this.onStateChange = null;
88771
- // Listen for PiP events globally
88772
- document.addEventListener('leavepictureinpicture', this.handlePiPExit.bind(this));
88773
- document.addEventListener('enterpictureinpicture', this.handlePiPEnter.bind(this));
88774
- }
88775
- /**
88776
- * Register a video element for PiP management
88777
- */
88778
- PictureInPictureManager.prototype.registerVideo = function (videoElement, url, onStateChange) {
88779
- this.videoElement = videoElement;
88780
- this.onStateChange = onStateChange || null;
88781
- // Store current video state
88782
- this.currentVideoState = {
88783
- url: url,
88784
- currentTime: videoElement.currentTime,
88785
- isPlaying: !videoElement.paused,
88786
- volume: videoElement.volume,
88787
- playbackRate: videoElement.playbackRate
88788
- };
88789
- // Add listeners to track state changes
88790
- videoElement.addEventListener('timeupdate', this.handleTimeUpdate.bind(this));
88791
- videoElement.addEventListener('play', this.handlePlayStateChange.bind(this));
88792
- videoElement.addEventListener('pause', this.handlePlayStateChange.bind(this));
88793
- videoElement.addEventListener('volumechange', this.handleVolumeChange.bind(this));
88794
- videoElement.addEventListener('ratechange', this.handleRateChange.bind(this));
88795
- };
88796
- /**
88797
- * Unregister the current video element
88798
- */
88799
- PictureInPictureManager.prototype.unregisterVideo = function () {
88800
- if (this.videoElement) {
88801
- this.videoElement.removeEventListener('timeupdate', this.handleTimeUpdate.bind(this));
88802
- this.videoElement.removeEventListener('play', this.handlePlayStateChange.bind(this));
88803
- this.videoElement.removeEventListener('pause', this.handlePlayStateChange.bind(this));
88804
- this.videoElement.removeEventListener('volumechange', this.handleVolumeChange.bind(this));
88805
- this.videoElement.removeEventListener('ratechange', this.handleRateChange.bind(this));
88806
- }
88807
- this.videoElement = null;
88808
- this.onStateChange = null;
88809
- };
88810
- /**
88811
- * Create a persistent video element for PiP
88812
- */
88813
- PictureInPictureManager.prototype.createPersistentVideo = function (originalVideo) {
88814
- var persistentVideo = originalVideo.cloneNode(true);
88815
- // Copy all relevant properties
88816
- persistentVideo.src = originalVideo.src;
88817
- persistentVideo.currentTime = originalVideo.currentTime;
88818
- persistentVideo.volume = originalVideo.volume;
88819
- persistentVideo.playbackRate = originalVideo.playbackRate;
88820
- persistentVideo.muted = originalVideo.muted;
88821
- // Set properties for PiP
88822
- persistentVideo.style.position = 'fixed';
88823
- persistentVideo.style.top = '-9999px';
88824
- persistentVideo.style.left = '-9999px';
88825
- persistentVideo.style.width = '1px';
88826
- persistentVideo.style.height = '1px';
88827
- persistentVideo.style.opacity = '0';
88828
- persistentVideo.style.pointerEvents = 'none';
88829
- return persistentVideo;
88830
- };
88831
- /**
88832
- * Enter picture-in-picture mode with persistence
88833
- */
88834
- PictureInPictureManager.prototype.enterPiP = function () {
88835
- return __awaiter(this, void 0, void 0, function () {
88836
- var persistentVideo_1, error_1;
88837
- return __generator(this, function (_a) {
88838
- switch (_a.label) {
88839
- case 0:
88840
- if (!this.videoElement || !document.pictureInPictureEnabled) {
88841
- return [2 /*return*/];
88842
- }
88843
- _a.label = 1;
88844
- case 1:
88845
- _a.trys.push([1, 6,, 7]);
88846
- if (!document.pictureInPictureElement) return [3 /*break*/, 3];
88847
- return [4 /*yield*/, document.exitPictureInPicture()];
88848
- case 2:
88849
- _a.sent();
88850
- _a.label = 3;
88851
- case 3:
88852
- // Create a container if it doesn't exist
88853
- if (!this.pipContainer) {
88854
- this.pipContainer = document.createElement('div');
88855
- this.pipContainer.id = 'suada-pip-container';
88856
- this.pipContainer.style.position = 'fixed';
88857
- this.pipContainer.style.top = '-9999px';
88858
- this.pipContainer.style.left = '-9999px';
88859
- this.pipContainer.style.width = '1px';
88860
- this.pipContainer.style.height = '1px';
88861
- this.pipContainer.style.zIndex = '-1';
88862
- document.body.appendChild(this.pipContainer);
88863
- }
88864
- persistentVideo_1 = this.createPersistentVideo(this.videoElement);
88865
- this.pipContainer.appendChild(persistentVideo_1);
88866
- // Wait for video to load
88867
- return [4 /*yield*/, new Promise(function (resolve) {
88868
- if (persistentVideo_1.readyState >= 2) {
88869
- resolve();
88870
- } else {
88871
- persistentVideo_1.addEventListener('loadedmetadata', function () {
88872
- return resolve();
88873
- }, {
88874
- once: true
88875
- });
88876
- }
88877
- })
88878
- // Enter PiP mode
88879
- ];
88880
- case 4:
88881
- // Wait for video to load
88882
- _a.sent();
88883
- // Enter PiP mode
88884
- return [4 /*yield*/, persistentVideo_1.requestPictureInPicture()
88885
- // Update the reference to the persistent video
88886
- ];
88887
- case 5:
88888
- // Enter PiP mode
88889
- _a.sent();
88890
- // Update the reference to the persistent video
88891
- this.videoElement = persistentVideo_1;
88892
- return [3 /*break*/, 7];
88893
- case 6:
88894
- error_1 = _a.sent();
88895
- console.error('Failed to enter picture-in-picture:', error_1);
88896
- return [3 /*break*/, 7];
88897
- case 7:
88898
- return [2 /*return*/];
88899
- }
88900
- });
88901
- });
88902
- };
88903
- /**
88904
- * Exit picture-in-picture mode
88905
- */
88906
- PictureInPictureManager.prototype.exitPiP = function () {
88907
- return __awaiter(this, void 0, void 0, function () {
88908
- var error_2;
88909
- return __generator(this, function (_a) {
88910
- switch (_a.label) {
88911
- case 0:
88912
- _a.trys.push([0, 3,, 4]);
88913
- if (!document.pictureInPictureElement) return [3 /*break*/, 2];
88914
- return [4 /*yield*/, document.exitPictureInPicture()];
88915
- case 1:
88916
- _a.sent();
88917
- _a.label = 2;
88918
- case 2:
88919
- return [3 /*break*/, 4];
88920
- case 3:
88921
- error_2 = _a.sent();
88922
- console.error('Failed to exit picture-in-picture:', error_2);
88923
- return [3 /*break*/, 4];
88924
- case 4:
88925
- return [2 /*return*/];
88926
- }
88927
- });
88928
- });
88929
- };
88930
- /**
88931
- * Check if currently in PiP mode
88932
- */
88933
- PictureInPictureManager.prototype.isPiPActive = function () {
88934
- return !!document.pictureInPictureElement;
88935
- };
88936
- /**
88937
- * Get current video state
88938
- */
88939
- PictureInPictureManager.prototype.getCurrentState = function () {
88940
- return this.currentVideoState;
88941
- };
88942
- /**
88943
- * Restore video state to a new video element
88944
- */
88945
- PictureInPictureManager.prototype.restoreStateToVideo = function (videoElement) {
88946
- if (!this.currentVideoState) return;
88947
- videoElement.currentTime = this.currentVideoState.currentTime;
88948
- videoElement.volume = this.currentVideoState.volume;
88949
- videoElement.playbackRate = this.currentVideoState.playbackRate;
88950
- if (this.currentVideoState.isPlaying) {
88951
- videoElement.play()["catch"](console.error);
88952
- }
88953
- };
88954
- PictureInPictureManager.prototype.handleTimeUpdate = function () {
88955
- if (this.videoElement && this.currentVideoState) {
88956
- this.currentVideoState.currentTime = this.videoElement.currentTime;
88957
- this.notifyStateChange();
88958
- }
88959
- };
88960
- PictureInPictureManager.prototype.handlePlayStateChange = function () {
88961
- if (this.videoElement && this.currentVideoState) {
88962
- this.currentVideoState.isPlaying = !this.videoElement.paused;
88963
- this.notifyStateChange();
88964
- }
88965
- };
88966
- PictureInPictureManager.prototype.handleVolumeChange = function () {
88967
- if (this.videoElement && this.currentVideoState) {
88968
- this.currentVideoState.volume = this.videoElement.volume;
88969
- this.notifyStateChange();
88970
- }
88971
- };
88972
- PictureInPictureManager.prototype.handleRateChange = function () {
88973
- if (this.videoElement && this.currentVideoState) {
88974
- this.currentVideoState.playbackRate = this.videoElement.playbackRate;
88975
- this.notifyStateChange();
88976
- }
88977
- };
88978
- PictureInPictureManager.prototype.handlePiPEnter = function () {
88979
- console.log('Entered picture-in-picture mode');
88980
- };
88981
- PictureInPictureManager.prototype.handlePiPExit = function () {
88982
- console.log('Exited picture-in-picture mode');
88983
- this.cleanup();
88984
- };
88985
- PictureInPictureManager.prototype.notifyStateChange = function () {
88986
- if (this.onStateChange && this.currentVideoState) {
88987
- this.onStateChange(this.currentVideoState);
88988
- }
88989
- };
88990
- PictureInPictureManager.prototype.cleanup = function () {
88991
- // Clean up the persistent container
88992
- if (this.pipContainer && this.pipContainer.parentNode) {
88993
- this.pipContainer.parentNode.removeChild(this.pipContainer);
88994
- this.pipContainer = null;
88995
- }
88996
- };
88997
- return PictureInPictureManager;
88998
- }();
88999
- // Create a singleton instance
89000
- var pipManager = new PictureInPictureManager();
89001
-
89002
88761
  var count = 0;
89003
88762
  var defaultVideoState = {
89004
88763
  muted: false,
@@ -89083,8 +88842,6 @@ function usePlayerControls(_a) {
89083
88842
  };
89084
88843
  var handlePiPLeave = function handlePiPLeave() {
89085
88844
  setIsPiPActive(false);
89086
- // Also cleanup the PiP manager when PiP exits
89087
- pipManager.unregisterVideo();
89088
88845
  };
89089
88846
  document.addEventListener('fullscreenchange', handleFullscreenChange);
89090
88847
  document.addEventListener('enterpictureinpicture', handlePiPEnter);
@@ -89108,33 +88865,19 @@ function usePlayerControls(_a) {
89108
88865
  }, [url]); // Re-run when URL changes to ensure proper cleanup and setup
89109
88866
  React.useEffect(function () {
89110
88867
  setStartPlayed(false);
89111
- // Check if there's an active PiP session and restore state
89112
- if (pipManager.isPiPActive()) {
89113
- var savedState_1 = pipManager.getCurrentState();
89114
- if (savedState_1 && savedState_1.url === url) {
89115
- setIsPiPActive(true);
89116
- // Restore video state from PiP manager
89117
- setVideoState(function (prev) {
89118
- var _a;
89119
- return __assign(__assign({}, prev), {
89120
- volume: savedState_1.volume,
89121
- playbackRate: savedState_1.playbackRate,
89122
- played: savedState_1.currentTime / (((_a = videoPlayerRef.current) === null || _a === void 0 ? void 0 : _a.getDuration()) || 1)
89123
- });
89124
- });
89125
- setIsPlaying(savedState_1.isPlaying);
89126
- }
89127
- }
89128
- }, [url, setIsPlaying]);
88868
+ }, [url]);
89129
88869
  // Cleanup effect to handle component unmounting while in PiP mode
89130
88870
  React.useEffect(function () {
88871
+ var currentVideoPlayerRef = videoPlayerRef.current;
89131
88872
  return function () {
89132
- // Unregister from PiP manager when component unmounts
89133
- pipManager.unregisterVideo();
89134
88873
  // Check if we're in PiP mode when component unmounts
89135
88874
  if (document.pictureInPictureElement) {
89136
- // The PiP manager will handle keeping the video alive
89137
- console.log('Component unmounting while in Picture-in-Picture mode - PiP will persist');
88875
+ // Try to keep the video element alive by cloning it
88876
+ var videoElement = currentVideoPlayerRef === null || currentVideoPlayerRef === void 0 ? void 0 : currentVideoPlayerRef.getInternalPlayer();
88877
+ if (videoElement && videoElement instanceof HTMLVideoElement) {
88878
+ // Create a warning for the user that PiP will exit
88879
+ console.log('Component unmounting while in Picture-in-Picture mode');
88880
+ }
89138
88881
  }
89139
88882
  };
89140
88883
  }, []);
@@ -89308,18 +89051,9 @@ function usePlayerControls(_a) {
89308
89051
  if (videoPlayerRef.current && !startPlayed) {
89309
89052
  videoPlayerRef.current.seekTo(startTime);
89310
89053
  setStartPlayed(true);
89311
- // Register video with PiP manager when it's ready
89312
- var videoElement = videoPlayerRef.current.getInternalPlayer();
89313
- if (videoElement && videoElement instanceof HTMLVideoElement) {
89314
- // Restore state if there was a previous PiP session
89315
- var savedState = pipManager.getCurrentState();
89316
- if (savedState && savedState.url === url && pipManager.isPiPActive()) {
89317
- pipManager.restoreStateToVideo(videoElement);
89318
- }
89319
- }
89320
89054
  }
89321
89055
  setLoading(false);
89322
- }, [startTime, startPlayed, setLoading, url]);
89056
+ }, [startTime, startPlayed, setLoading]);
89323
89057
  var handleFullScreen = function handleFullScreen() {
89324
89058
  var playerContainer = playerContainerRef.current;
89325
89059
  if (!playerContainer) {
@@ -89342,33 +89076,21 @@ function usePlayerControls(_a) {
89342
89076
  return;
89343
89077
  }
89344
89078
  if (document.pictureInPictureElement) {
89345
- pipManager.exitPiP()["catch"](function (error) {
89079
+ document.exitPictureInPicture()["catch"](function (error) {
89346
89080
  console.error('Failed to exit picture-in-picture:', error);
89347
89081
  });
89348
89082
  } else {
89349
- // Register the video with the PiP manager
89350
- pipManager.registerVideo(videoElement, url, function (state) {
89351
- // Update local state when PiP video state changes
89352
- setVideoState(function (prev) {
89353
- return __assign(__assign({}, prev), {
89354
- played: state.currentTime / duration,
89355
- volume: state.volume,
89356
- playbackRate: state.playbackRate
89357
- });
89358
- });
89359
- setIsPlaying(state.isPlaying);
89360
- });
89361
89083
  // Ensure the video is playing before entering PiP mode
89362
89084
  if (videoElement.paused && isPlaying) {
89363
89085
  videoElement.play().then(function () {
89364
- pipManager.enterPiP()["catch"](function (error) {
89086
+ videoElement.requestPictureInPicture()["catch"](function (error) {
89365
89087
  console.error('Failed to enter picture-in-picture:', error);
89366
89088
  });
89367
89089
  })["catch"](function (error) {
89368
89090
  console.error('Failed to play video before PiP:', error);
89369
89091
  });
89370
89092
  } else {
89371
- pipManager.enterPiP()["catch"](function (error) {
89093
+ videoElement.requestPictureInPicture()["catch"](function (error) {
89372
89094
  console.error('Failed to enter picture-in-picture:', error);
89373
89095
  });
89374
89096
  }
@@ -89746,6 +89468,131 @@ var VideoPlayer = function VideoPlayer(_a) {
89746
89468
  });
89747
89469
  };
89748
89470
 
89471
+ var PiPContext = /*#__PURE__*/React.createContext(undefined);
89472
+ var PiPProvider = function PiPProvider(_a) {
89473
+ var children = _a.children;
89474
+ var _b = React.useState(false),
89475
+ isPiPActive = _b[0],
89476
+ setIsPiPActive = _b[1];
89477
+ var _c = React.useState(null),
89478
+ pipVideoState = _c[0],
89479
+ setPipVideoState = _c[1];
89480
+ var videoElementRef = React.useRef(null);
89481
+ var updateVideoState = React.useCallback(function (state) {
89482
+ setPipVideoState(function (prev) {
89483
+ return prev ? __assign(__assign({}, prev), state) : null;
89484
+ });
89485
+ }, []);
89486
+ var registerVideoElement = React.useCallback(function (element) {
89487
+ videoElementRef.current = element;
89488
+ }, []);
89489
+ var unregisterVideoElement = React.useCallback(function () {
89490
+ videoElementRef.current = null;
89491
+ }, []);
89492
+ var enterPiP = React.useCallback(function (videoElement, videoState) {
89493
+ return __awaiter(void 0, void 0, void 0, function () {
89494
+ var error_1;
89495
+ return __generator(this, function (_a) {
89496
+ switch (_a.label) {
89497
+ case 0:
89498
+ if (!document.pictureInPictureEnabled) {
89499
+ console.warn('Picture-in-Picture is not supported in this browser');
89500
+ return [2 /*return*/, false];
89501
+ }
89502
+ if (document.pictureInPictureElement) {
89503
+ console.warn('Another video is already in Picture-in-Picture mode');
89504
+ return [2 /*return*/, false];
89505
+ }
89506
+ _a.label = 1;
89507
+ case 1:
89508
+ _a.trys.push([1, 5,, 6]);
89509
+ // Store video state
89510
+ setPipVideoState(videoState);
89511
+ videoElementRef.current = videoElement;
89512
+ if (!(videoElement.paused && videoState.isPlaying)) return [3 /*break*/, 3];
89513
+ return [4 /*yield*/, videoElement.play()];
89514
+ case 2:
89515
+ _a.sent();
89516
+ _a.label = 3;
89517
+ case 3:
89518
+ return [4 /*yield*/, videoElement.requestPictureInPicture()];
89519
+ case 4:
89520
+ _a.sent();
89521
+ return [2 /*return*/, true];
89522
+ case 5:
89523
+ error_1 = _a.sent();
89524
+ console.error('Failed to enter picture-in-picture:', error_1);
89525
+ return [2 /*return*/, false];
89526
+ case 6:
89527
+ return [2 /*return*/];
89528
+ }
89529
+ });
89530
+ });
89531
+ }, []);
89532
+ var exitPiP = React.useCallback(function () {
89533
+ return __awaiter(void 0, void 0, void 0, function () {
89534
+ var error_2;
89535
+ return __generator(this, function (_a) {
89536
+ switch (_a.label) {
89537
+ case 0:
89538
+ _a.trys.push([0, 3,, 4]);
89539
+ if (!document.pictureInPictureElement) return [3 /*break*/, 2];
89540
+ return [4 /*yield*/, document.exitPictureInPicture()];
89541
+ case 1:
89542
+ _a.sent();
89543
+ _a.label = 2;
89544
+ case 2:
89545
+ return [2 /*return*/, true];
89546
+ case 3:
89547
+ error_2 = _a.sent();
89548
+ console.error('Failed to exit picture-in-picture:', error_2);
89549
+ return [2 /*return*/, false];
89550
+ case 4:
89551
+ return [2 /*return*/];
89552
+ }
89553
+ });
89554
+ });
89555
+ }, []);
89556
+ // Listen for PiP events
89557
+ React.useEffect(function () {
89558
+ var handlePiPEnter = function handlePiPEnter() {
89559
+ setIsPiPActive(true);
89560
+ };
89561
+ var handlePiPLeave = function handlePiPLeave() {
89562
+ setIsPiPActive(false);
89563
+ // Keep the video state for potential restoration
89564
+ // but don't clear it immediately
89565
+ };
89566
+ document.addEventListener('enterpictureinpicture', handlePiPEnter);
89567
+ document.addEventListener('leavepictureinpicture', handlePiPLeave);
89568
+ return function () {
89569
+ document.removeEventListener('enterpictureinpicture', handlePiPEnter);
89570
+ document.removeEventListener('leavepictureinpicture', handlePiPLeave);
89571
+ };
89572
+ }, []);
89573
+ var value = {
89574
+ isPiPActive: isPiPActive,
89575
+ pipVideoState: pipVideoState,
89576
+ enterPiP: enterPiP,
89577
+ exitPiP: exitPiP,
89578
+ updateVideoState: updateVideoState,
89579
+ registerVideoElement: registerVideoElement,
89580
+ unregisterVideoElement: unregisterVideoElement
89581
+ };
89582
+ return jsxRuntimeExports.jsx(PiPContext.Provider, {
89583
+ value: value,
89584
+ children: children
89585
+ });
89586
+ };
89587
+
89588
+ var usePiP = function usePiP() {
89589
+ var context = React.useContext(PiPContext);
89590
+ if (context === undefined) {
89591
+ throw new Error('usePiP must be used within a PiPProvider');
89592
+ }
89593
+ return context;
89594
+ };
89595
+
89749
89596
  var Whiteboard = dt.div(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n background-color: #ffffff;\n padding: 20px;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 75vh;\n border: 1px solid #e7e9ed;\n border-radius: 4px;\n flex-direction: column;\n padding: 40px;\n"], ["\n background-color: #ffffff;\n padding: 20px;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 75vh;\n border: 1px solid #e7e9ed;\n border-radius: 4px;\n flex-direction: column;\n padding: 40px;\n"])));
89750
89597
  var CenteredText = dt.div(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n font-weight: 800;\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: 20px;\n font-family: 'Open Sans', sans-serif;\n text-align: center;\n gap: 8px;\n margin-top: ", ";\n\n h1 {\n font-size: 18px;\n font-weight: 800;\n }\n\n h4 {\n color: #68707a;\n font-size: 16px;\n font-weight: 500;\n }\n"], ["\n font-weight: 800;\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: 20px;\n font-family: 'Open Sans', sans-serif;\n text-align: center;\n gap: 8px;\n margin-top: ", ";\n\n h1 {\n font-size: 18px;\n font-weight: 800;\n }\n\n h4 {\n color: #68707a;\n font-size: 16px;\n font-weight: 500;\n }\n"])), function (_a) {
89751
89598
  var marginTop = _a.marginTop;
@@ -95093,6 +94940,7 @@ exports.Loader = Loader;
95093
94940
  exports.NavigationBar = NavigationBar;
95094
94941
  exports.Pagination = Pagination;
95095
94942
  exports.PhoneCountryCode = PhoneCountryCode;
94943
+ exports.PiPProvider = PiPProvider;
95096
94944
  exports.RadioButton = RadioButton;
95097
94945
  exports.RangeSlider = RangeSlider;
95098
94946
  exports.SearchInput = SearchInput;
@@ -95110,3 +94958,4 @@ exports.activeTabClassName = activeTabClassName;
95110
94958
  exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
95111
94959
  exports.requirePatterns = requirePatterns;
95112
94960
  exports.requireUtils = requireUtils;
94961
+ exports.usePiP = usePiP;