suada-components 1.9.1 → 1.10.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/dist/{DailyMotion-B-Q4fBEb.js → DailyMotion-DacNkqsi.js} +1 -1
- package/dist/{DailyMotion-BAvo3Toe.esm.js → DailyMotion-gaY-1HqX.esm.js} +1 -1
- package/dist/{components/Facebook-CDrTA2_L.esm.js → Facebook-C_tH1Bi_.esm.js} +1 -1
- package/dist/{components/Facebook-YxZce26V.js → Facebook-D4wLMJkY.js} +1 -1
- package/dist/{FilePlayer-CQ80KWY2.js → FilePlayer-B4s5OcYq.js} +1 -1
- package/dist/{FilePlayer-BOZIvaDy.esm.js → FilePlayer-DqR2mvGK.esm.js} +1 -1
- package/dist/{Kaltura-B12Xdl6X.esm.js → Kaltura-C9QbmEfO.esm.js} +1 -1
- package/dist/{components/Kaltura-krSxvIBr.js → Kaltura-kCqUZWuf.js} +1 -1
- package/dist/{Mixcloud-DGQnlDAK.js → Mixcloud-2c71b3Nf.js} +1 -1
- package/dist/{Mixcloud-JfeQIOki.esm.js → Mixcloud-ib_DIXF1.esm.js} +1 -1
- package/dist/{Mux-CiKZc8gj.js → Mux-BsXgGo6C.js} +1 -1
- package/dist/{components/Mux-BZleoaJh.esm.js → Mux-CJ6kEh1R.esm.js} +1 -1
- package/dist/{Preview-DvZKrgm5.js → Preview-gEkhA4mX.js} +1 -1
- package/dist/{Preview-DSovY9gr.esm.js → Preview-kqr7fWet.esm.js} +1 -1
- package/dist/{SoundCloud-Di7z3nmP.js → SoundCloud-BWup2g--.js} +1 -1
- package/dist/{SoundCloud-j_R0lK8D.esm.js → SoundCloud-DJM0bsQG.esm.js} +1 -1
- package/dist/{Streamable-CRhXZIKP.esm.js → Streamable-CJltauTy.esm.js} +1 -1
- package/dist/{Streamable-CV1mgzRv.js → Streamable-UeTHV2nZ.js} +1 -1
- package/dist/{components/Twitch-CXOhay4a.esm.js → Twitch-C9qq_89Q.esm.js} +1 -1
- package/dist/{Twitch-Dj66vkCD.js → Twitch-_N8mEsiS.js} +1 -1
- package/dist/{components/Vidyard-Cn_LcGwi.js → Vidyard-CQuxB99Z.js} +1 -1
- package/dist/{components/Vidyard-YcZH6kkW.esm.js → Vidyard-gtcLQdYd.esm.js} +1 -1
- package/dist/{Vimeo-Ba9C6utC.esm.js → Vimeo-Dzp5eoLi.esm.js} +1 -1
- package/dist/{Vimeo-DePzl7Sn.js → Vimeo-nhXVoFTb.js} +1 -1
- package/dist/{components/Wistia-COWrV8QC.js → Wistia-C1DqA9IW.js} +1 -1
- package/dist/{components/Wistia-PneZ48dn.esm.js → Wistia-DV3BO3z9.esm.js} +1 -1
- package/dist/{components/YouTube-BUyvzJQw.esm.js → YouTube-BKwvJCnt.esm.js} +1 -1
- package/dist/{YouTube-vwMoW93C.js → YouTube-DDou5phH.js} +1 -1
- package/dist/components/{DailyMotion-Cr_8IZRR.js → DailyMotion-B8IJNjSc.js} +1 -1
- package/dist/components/{DailyMotion-D2n1NDDi.esm.js → DailyMotion-COg3zgIZ.esm.js} +1 -1
- package/dist/{Facebook-CASik-P5.js → components/Facebook-DJ7a3Bj8.js} +1 -1
- package/dist/{Facebook-C8GOujDt.esm.js → components/Facebook-NS80Vk6j.esm.js} +1 -1
- package/dist/components/{FilePlayer-BzkVMbQ8.esm.js → FilePlayer-D-fc3B0E.esm.js} +1 -1
- package/dist/components/{FilePlayer-DqqTufgX.js → FilePlayer-SyLt5qGX.js} +1 -1
- package/dist/{Kaltura-nYc5k7UB.js → components/Kaltura-BTFxSMxP.js} +1 -1
- package/dist/components/{Kaltura-B0UZLr6g.esm.js → Kaltura-CmFIWSef.esm.js} +1 -1
- package/dist/components/{Mixcloud-D9qk3D6i.esm.js → Mixcloud-CO5MsWUJ.esm.js} +1 -1
- package/dist/components/{Mixcloud-BCT5e47d.js → Mixcloud-DHAfVpcc.js} +1 -1
- package/dist/{Mux-BHWzpAR-.esm.js → components/Mux-C8-HithD.esm.js} +1 -1
- package/dist/components/{Mux-D_si09u2.js → Mux-bycDxP8G.js} +1 -1
- package/dist/components/{Preview-DQLbQ8_C.esm.js → Preview-Clg3y6sj.esm.js} +1 -1
- package/dist/components/{Preview-CmduMeEZ.js → Preview-CzpcknZI.js} +1 -1
- package/dist/components/{SoundCloud-BHgTfaW7.js → SoundCloud-Dz9DeIIM.js} +1 -1
- package/dist/components/{SoundCloud-BgnX8kOF.esm.js → SoundCloud-LfWEBVy1.esm.js} +1 -1
- package/dist/components/{Streamable-DbRbUflP.esm.js → Streamable-BpcVhi4M.esm.js} +1 -1
- package/dist/components/{Streamable-DTAzjVwd.js → Streamable-Cs_c-7jS.js} +1 -1
- package/dist/{Twitch-6icfp-ZE.esm.js → components/Twitch-BJ9aSIM2.esm.js} +1 -1
- package/dist/components/{Twitch-CnEk-l9R.js → Twitch-C9bksXF6.js} +1 -1
- package/dist/components/VideoPlayer/usePlayerControls.js +37 -27
- package/dist/components/VideoPlayer/usePlayerControls.js.map +1 -1
- package/dist/{Vidyard-B-qmApe9.js → components/Vidyard-CsUFSBXh.js} +1 -1
- package/dist/{Vidyard--KX47pZ0.esm.js → components/Vidyard-Dc8NHJ7p.esm.js} +1 -1
- package/dist/components/{Vimeo-Cv0qx3aR.esm.js → Vimeo-CwlScNtK.esm.js} +1 -1
- package/dist/components/{Vimeo-BUVxWt7t.js → Vimeo-D6C93592.js} +1 -1
- package/dist/{Wistia-CXYB3Yus.js → components/Wistia-Bxvdn3oO.js} +1 -1
- package/dist/{Wistia-DWJcdcY2.esm.js → components/Wistia-Cwl4fNWW.esm.js} +1 -1
- package/dist/components/{YouTube-DeQdfkWm.js → YouTube-BF85SRPF.js} +1 -1
- package/dist/{YouTube-DdBVPxzz.esm.js → components/YouTube-DKkYzN7-.esm.js} +1 -1
- package/dist/components/{index-Bs-XxxV4.js → index-C08W0lXg.js} +186 -173
- package/dist/components/{index-C4Mk2H3N.esm.js → index-F6zEoSWf.esm.js} +186 -173
- package/dist/components/index.esm.js +1 -1
- package/dist/{index-Bp-idbg5.esm.js → index-CcTTuhg8.esm.js} +186 -173
- package/dist/{index-CSj9NYxJ.js → index-Dq4qpx9F.js} +186 -173
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-
|
|
1
|
+
import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-F6zEoSWf.esm.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-
|
|
1
|
+
import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-F6zEoSWf.esm.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -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-
|
|
81378
|
+
'./YouTube-BF85SRPF.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-
|
|
81387
|
+
'./SoundCloud-Dz9DeIIM.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-
|
|
81396
|
+
'./Vimeo-D6C93592.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-
|
|
81405
|
+
'./Mux-bycDxP8G.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-
|
|
81414
|
+
'./Facebook-DJ7a3Bj8.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-
|
|
81423
|
+
'./Streamable-Cs_c-7jS.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-
|
|
81432
|
+
'./Wistia-Bxvdn3oO.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-
|
|
81441
|
+
'./Twitch-C9bksXF6.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-
|
|
81450
|
+
'./DailyMotion-B8IJNjSc.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-
|
|
81459
|
+
'./Mixcloud-DHAfVpcc.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-
|
|
81468
|
+
'./Vidyard-CsUFSBXh.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-
|
|
81477
|
+
'./Kaltura-BTFxSMxP.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-
|
|
81489
|
+
'./FilePlayer-SyLt5qGX.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-
|
|
82310
|
+
'./Preview-CzpcknZI.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,6 +88758,131 @@ var useEventListener = function useEventListener(eventName, handler, element, sh
|
|
|
88758
88758
|
}, [eventName, element, shouldRun]);
|
|
88759
88759
|
};
|
|
88760
88760
|
|
|
88761
|
+
var PiPContext = /*#__PURE__*/React.createContext(undefined);
|
|
88762
|
+
var PiPProvider = function PiPProvider(_a) {
|
|
88763
|
+
var children = _a.children;
|
|
88764
|
+
var _b = React.useState(false),
|
|
88765
|
+
isPiPActive = _b[0],
|
|
88766
|
+
setIsPiPActive = _b[1];
|
|
88767
|
+
var _c = React.useState(null),
|
|
88768
|
+
pipVideoState = _c[0],
|
|
88769
|
+
setPipVideoState = _c[1];
|
|
88770
|
+
var videoElementRef = React.useRef(null);
|
|
88771
|
+
var updateVideoState = React.useCallback(function (state) {
|
|
88772
|
+
setPipVideoState(function (prev) {
|
|
88773
|
+
return prev ? __assign(__assign({}, prev), state) : null;
|
|
88774
|
+
});
|
|
88775
|
+
}, []);
|
|
88776
|
+
var registerVideoElement = React.useCallback(function (element) {
|
|
88777
|
+
videoElementRef.current = element;
|
|
88778
|
+
}, []);
|
|
88779
|
+
var unregisterVideoElement = React.useCallback(function () {
|
|
88780
|
+
videoElementRef.current = null;
|
|
88781
|
+
}, []);
|
|
88782
|
+
var enterPiP = React.useCallback(function (videoElement, videoState) {
|
|
88783
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
88784
|
+
var error_1;
|
|
88785
|
+
return __generator(this, function (_a) {
|
|
88786
|
+
switch (_a.label) {
|
|
88787
|
+
case 0:
|
|
88788
|
+
if (!document.pictureInPictureEnabled) {
|
|
88789
|
+
console.warn('Picture-in-Picture is not supported in this browser');
|
|
88790
|
+
return [2 /*return*/, false];
|
|
88791
|
+
}
|
|
88792
|
+
if (document.pictureInPictureElement) {
|
|
88793
|
+
console.warn('Another video is already in Picture-in-Picture mode');
|
|
88794
|
+
return [2 /*return*/, false];
|
|
88795
|
+
}
|
|
88796
|
+
_a.label = 1;
|
|
88797
|
+
case 1:
|
|
88798
|
+
_a.trys.push([1, 5,, 6]);
|
|
88799
|
+
// Store video state
|
|
88800
|
+
setPipVideoState(videoState);
|
|
88801
|
+
videoElementRef.current = videoElement;
|
|
88802
|
+
if (!(videoElement.paused && videoState.isPlaying)) return [3 /*break*/, 3];
|
|
88803
|
+
return [4 /*yield*/, videoElement.play()];
|
|
88804
|
+
case 2:
|
|
88805
|
+
_a.sent();
|
|
88806
|
+
_a.label = 3;
|
|
88807
|
+
case 3:
|
|
88808
|
+
return [4 /*yield*/, videoElement.requestPictureInPicture()];
|
|
88809
|
+
case 4:
|
|
88810
|
+
_a.sent();
|
|
88811
|
+
return [2 /*return*/, true];
|
|
88812
|
+
case 5:
|
|
88813
|
+
error_1 = _a.sent();
|
|
88814
|
+
console.error('Failed to enter picture-in-picture:', error_1);
|
|
88815
|
+
return [2 /*return*/, false];
|
|
88816
|
+
case 6:
|
|
88817
|
+
return [2 /*return*/];
|
|
88818
|
+
}
|
|
88819
|
+
});
|
|
88820
|
+
});
|
|
88821
|
+
}, []);
|
|
88822
|
+
var exitPiP = React.useCallback(function () {
|
|
88823
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
88824
|
+
var error_2;
|
|
88825
|
+
return __generator(this, function (_a) {
|
|
88826
|
+
switch (_a.label) {
|
|
88827
|
+
case 0:
|
|
88828
|
+
_a.trys.push([0, 3,, 4]);
|
|
88829
|
+
if (!document.pictureInPictureElement) return [3 /*break*/, 2];
|
|
88830
|
+
return [4 /*yield*/, document.exitPictureInPicture()];
|
|
88831
|
+
case 1:
|
|
88832
|
+
_a.sent();
|
|
88833
|
+
_a.label = 2;
|
|
88834
|
+
case 2:
|
|
88835
|
+
return [2 /*return*/, true];
|
|
88836
|
+
case 3:
|
|
88837
|
+
error_2 = _a.sent();
|
|
88838
|
+
console.error('Failed to exit picture-in-picture:', error_2);
|
|
88839
|
+
return [2 /*return*/, false];
|
|
88840
|
+
case 4:
|
|
88841
|
+
return [2 /*return*/];
|
|
88842
|
+
}
|
|
88843
|
+
});
|
|
88844
|
+
});
|
|
88845
|
+
}, []);
|
|
88846
|
+
// Listen for PiP events
|
|
88847
|
+
React.useEffect(function () {
|
|
88848
|
+
var handlePiPEnter = function handlePiPEnter() {
|
|
88849
|
+
setIsPiPActive(true);
|
|
88850
|
+
};
|
|
88851
|
+
var handlePiPLeave = function handlePiPLeave() {
|
|
88852
|
+
setIsPiPActive(false);
|
|
88853
|
+
// Keep the video state for potential restoration
|
|
88854
|
+
// but don't clear it immediately
|
|
88855
|
+
};
|
|
88856
|
+
document.addEventListener('enterpictureinpicture', handlePiPEnter);
|
|
88857
|
+
document.addEventListener('leavepictureinpicture', handlePiPLeave);
|
|
88858
|
+
return function () {
|
|
88859
|
+
document.removeEventListener('enterpictureinpicture', handlePiPEnter);
|
|
88860
|
+
document.removeEventListener('leavepictureinpicture', handlePiPLeave);
|
|
88861
|
+
};
|
|
88862
|
+
}, []);
|
|
88863
|
+
var value = {
|
|
88864
|
+
isPiPActive: isPiPActive,
|
|
88865
|
+
pipVideoState: pipVideoState,
|
|
88866
|
+
enterPiP: enterPiP,
|
|
88867
|
+
exitPiP: exitPiP,
|
|
88868
|
+
updateVideoState: updateVideoState,
|
|
88869
|
+
registerVideoElement: registerVideoElement,
|
|
88870
|
+
unregisterVideoElement: unregisterVideoElement
|
|
88871
|
+
};
|
|
88872
|
+
return jsxRuntimeExports.jsx(PiPContext.Provider, {
|
|
88873
|
+
value: value,
|
|
88874
|
+
children: children
|
|
88875
|
+
});
|
|
88876
|
+
};
|
|
88877
|
+
|
|
88878
|
+
var usePiP = function usePiP() {
|
|
88879
|
+
var context = React.useContext(PiPContext);
|
|
88880
|
+
if (context === undefined) {
|
|
88881
|
+
throw new Error('usePiP must be used within a PiPProvider');
|
|
88882
|
+
}
|
|
88883
|
+
return context;
|
|
88884
|
+
};
|
|
88885
|
+
|
|
88761
88886
|
var count = 0;
|
|
88762
88887
|
var defaultVideoState = {
|
|
88763
88888
|
muted: false,
|
|
@@ -88789,26 +88914,30 @@ function usePlayerControls(_a) {
|
|
|
88789
88914
|
isSubtitlesChecked = _e[0],
|
|
88790
88915
|
setIsSubtitlesChecked = _e[1];
|
|
88791
88916
|
var _f = React.useState(false),
|
|
88792
|
-
|
|
88793
|
-
|
|
88917
|
+
isFullscreen = _f[0],
|
|
88918
|
+
setIsFullscreen = _f[1];
|
|
88794
88919
|
var _g = React.useState(false),
|
|
88795
|
-
|
|
88796
|
-
|
|
88797
|
-
var _h = React.useState(false),
|
|
88798
|
-
isControlsActive = _h[0],
|
|
88799
|
-
setIsControlsActive = _h[1];
|
|
88920
|
+
isControlsActive = _g[0],
|
|
88921
|
+
setIsControlsActive = _g[1];
|
|
88800
88922
|
var videoPlayerRef = React.useRef(null);
|
|
88801
88923
|
var controlRef = React.useRef(null);
|
|
88802
88924
|
var playerContainerRef = React.useRef(null);
|
|
88803
|
-
var
|
|
88804
|
-
subtitles =
|
|
88805
|
-
setSubtitles =
|
|
88806
|
-
var
|
|
88807
|
-
currentSubtitle =
|
|
88808
|
-
setCurrentSubtitle =
|
|
88925
|
+
var _h = React.useState([]),
|
|
88926
|
+
subtitles = _h[0],
|
|
88927
|
+
setSubtitles = _h[1];
|
|
88928
|
+
var _j = React.useState(''),
|
|
88929
|
+
currentSubtitle = _j[0],
|
|
88930
|
+
setCurrentSubtitle = _j[1];
|
|
88809
88931
|
var lastSubtitleIndexRef = React.useRef(null);
|
|
88810
88932
|
var lastPlaybackTimeRef = React.useRef(0);
|
|
88811
88933
|
var lastCallTimeRef = React.useRef(Date.now());
|
|
88934
|
+
// Use PiP context instead of local state
|
|
88935
|
+
var _k = usePiP(),
|
|
88936
|
+
isPiPActive = _k.isPiPActive,
|
|
88937
|
+
enterPiP = _k.enterPiP,
|
|
88938
|
+
exitPiP = _k.exitPiP,
|
|
88939
|
+
registerVideoElement = _k.registerVideoElement,
|
|
88940
|
+
unregisterVideoElement = _k.unregisterVideoElement;
|
|
88812
88941
|
var muted = videoState.muted,
|
|
88813
88942
|
volume = videoState.volume,
|
|
88814
88943
|
prevVolume = videoState.prevVolume,
|
|
@@ -88838,10 +88967,21 @@ function usePlayerControls(_a) {
|
|
|
88838
88967
|
setIsFullscreen(!!document.fullscreenElement);
|
|
88839
88968
|
};
|
|
88840
88969
|
var handlePiPEnter = function handlePiPEnter() {
|
|
88841
|
-
|
|
88970
|
+
var _a;
|
|
88971
|
+
// Use context method to update global PiP state
|
|
88972
|
+
var videoElement = (_a = videoPlayerRef.current) === null || _a === void 0 ? void 0 : _a.getInternalPlayer();
|
|
88973
|
+
if (videoElement && videoElement instanceof HTMLVideoElement) {
|
|
88974
|
+
enterPiP(videoElement, {
|
|
88975
|
+
url: url,
|
|
88976
|
+
currentTime: videoElement.currentTime,
|
|
88977
|
+
isPlaying: isPlaying,
|
|
88978
|
+
volume: videoState.volume,
|
|
88979
|
+
muted: videoState.muted
|
|
88980
|
+
});
|
|
88981
|
+
}
|
|
88842
88982
|
};
|
|
88843
88983
|
var handlePiPLeave = function handlePiPLeave() {
|
|
88844
|
-
|
|
88984
|
+
exitPiP();
|
|
88845
88985
|
};
|
|
88846
88986
|
document.addEventListener('fullscreenchange', handleFullscreenChange);
|
|
88847
88987
|
document.addEventListener('enterpictureinpicture', handlePiPEnter);
|
|
@@ -88851,6 +88991,8 @@ function usePlayerControls(_a) {
|
|
|
88851
88991
|
if (videoElement && videoElement instanceof HTMLVideoElement) {
|
|
88852
88992
|
videoElement.addEventListener('enterpictureinpicture', handlePiPEnter);
|
|
88853
88993
|
videoElement.addEventListener('leavepictureinpicture', handlePiPLeave);
|
|
88994
|
+
// Register video element with PiP context
|
|
88995
|
+
registerVideoElement(videoElement);
|
|
88854
88996
|
}
|
|
88855
88997
|
return function () {
|
|
88856
88998
|
document.removeEventListener('fullscreenchange', handleFullscreenChange);
|
|
@@ -88861,8 +89003,10 @@ function usePlayerControls(_a) {
|
|
|
88861
89003
|
videoElement.removeEventListener('enterpictureinpicture', handlePiPEnter);
|
|
88862
89004
|
videoElement.removeEventListener('leavepictureinpicture', handlePiPLeave);
|
|
88863
89005
|
}
|
|
89006
|
+
// Unregister video element from PiP context
|
|
89007
|
+
unregisterVideoElement();
|
|
88864
89008
|
};
|
|
88865
|
-
}, [url]); // Re-run when URL changes to ensure proper cleanup and setup
|
|
89009
|
+
}, [url, enterPiP, exitPiP, registerVideoElement, unregisterVideoElement, isPlaying, videoState.volume, videoState.muted]); // Re-run when URL changes to ensure proper cleanup and setup
|
|
88866
89010
|
React.useEffect(function () {
|
|
88867
89011
|
setStartPlayed(false);
|
|
88868
89012
|
}, [url]);
|
|
@@ -89075,25 +89219,19 @@ function usePlayerControls(_a) {
|
|
|
89075
89219
|
console.warn('Picture-in-Picture is not supported in this browser');
|
|
89076
89220
|
return;
|
|
89077
89221
|
}
|
|
89078
|
-
if (
|
|
89079
|
-
|
|
89080
|
-
|
|
89081
|
-
});
|
|
89222
|
+
if (isPiPActive) {
|
|
89223
|
+
// Exit PiP using context method
|
|
89224
|
+
exitPiP();
|
|
89082
89225
|
} else {
|
|
89083
|
-
//
|
|
89084
|
-
|
|
89085
|
-
|
|
89086
|
-
|
|
89087
|
-
|
|
89088
|
-
|
|
89089
|
-
|
|
89090
|
-
|
|
89091
|
-
|
|
89092
|
-
} else {
|
|
89093
|
-
videoElement.requestPictureInPicture()["catch"](function (error) {
|
|
89094
|
-
console.error('Failed to enter picture-in-picture:', error);
|
|
89095
|
-
});
|
|
89096
|
-
}
|
|
89226
|
+
// Enter PiP using context method
|
|
89227
|
+
var pipVideoState = {
|
|
89228
|
+
url: url,
|
|
89229
|
+
currentTime: videoElement.currentTime,
|
|
89230
|
+
isPlaying: isPlaying,
|
|
89231
|
+
volume: videoState.volume,
|
|
89232
|
+
muted: videoState.muted
|
|
89233
|
+
};
|
|
89234
|
+
enterPiP(videoElement, pipVideoState);
|
|
89097
89235
|
}
|
|
89098
89236
|
};
|
|
89099
89237
|
var handleKeyDown = React.useCallback(function (event) {
|
|
@@ -89468,131 +89606,6 @@ var VideoPlayer = function VideoPlayer(_a) {
|
|
|
89468
89606
|
});
|
|
89469
89607
|
};
|
|
89470
89608
|
|
|
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
|
-
|
|
89596
89609
|
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"])));
|
|
89597
89610
|
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) {
|
|
89598
89611
|
var marginTop = _a.marginTop;
|