@100mslive/roomkit-react 0.3.3-alpha.3 → 0.3.3-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +0 -1
- package/dist/Accordion/index.d.ts +0 -1
- package/dist/{HLSView-BCIIVR2T.js → HLSView-VUANLYLS.js} +166 -331
- package/dist/HLSView-VUANLYLS.js.map +7 -0
- package/dist/IconButton/IconButton.d.ts +1 -1
- package/dist/Modal/Dialog.d.ts +1 -1
- package/dist/Prebuilt/IconButton.d.ts +3 -2
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +1 -3
- package/dist/Prebuilt/components/HMSVideo/PlayPauseButton.d.ts +2 -2
- package/dist/Prebuilt/components/HMSVideo/{SeekControl.d.ts → SeekControls.d.ts} +2 -2
- package/dist/Prebuilt/components/HMSVideo/index.d.ts +11 -15
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2 -2
- package/dist/Prebuilt/components/RaiseHand.d.ts +1 -1
- package/dist/Prebuilt/layouts/WhiteboardView.d.ts +2 -0
- package/dist/Sheet/Sheet.d.ts +1 -1
- package/dist/{chunk-W47ZJGSD.js → chunk-5WTUTVRO.js} +540 -617
- package/dist/chunk-5WTUTVRO.js.map +7 -0
- package/dist/index.cjs.js +1426 -1686
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +169 -248
- package/dist/meta.esbuild.json +180 -260
- package/package.json +7 -7
- package/src/Accordion/Accordion.tsx +4 -4
- package/src/IconButton/IconButton.tsx +7 -2
- package/src/Prebuilt/IconButton.tsx +10 -6
- package/src/Prebuilt/components/Chat/ChatBody.tsx +0 -10
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +4 -2
- package/src/Prebuilt/components/ConferenceScreen.tsx +4 -1
- package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -2
- package/src/Prebuilt/components/Footer/Footer.tsx +4 -1
- package/src/Prebuilt/components/Footer/ParticipantList.tsx +1 -4
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +6 -6
- package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +3 -17
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +0 -1
- package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +2 -2
- package/src/Prebuilt/components/HMSVideo/{SeekControl.tsx → SeekControls.tsx} +2 -2
- package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +3 -7
- package/src/Prebuilt/components/HMSVideo/index.ts +4 -5
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +7 -7
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +1 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +5 -1
- package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +1 -0
- package/src/Prebuilt/components/RaiseHand.tsx +1 -7
- package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +1 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +4 -27
- package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +5 -13
- package/src/Prebuilt/components/hooks/{useMetadata.tsx → useMetadata.jsx} +8 -2
- package/src/Prebuilt/layouts/HLSView.jsx +78 -115
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +17 -1
- package/src/Prebuilt/layouts/WhiteboardView.tsx +69 -0
- package/dist/HLSView-BCIIVR2T.js.map +0 -7
- package/dist/Prebuilt/components/HMSVideo/PlayPauseSeekControls.d.ts +0 -14
- package/dist/Prebuilt/components/VideoLayouts/WhiteboardLayout.d.ts +0 -3
- package/dist/Prebuilt/components/hooks/useMetadata.d.ts +0 -8
- package/dist/chunk-W47ZJGSD.js.map +0 -7
- package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +0 -158
- package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +0 -95
@@ -25,7 +25,6 @@ import {
|
|
25
25
|
Tooltip,
|
26
26
|
__async,
|
27
27
|
__objRest,
|
28
|
-
__spreadProps,
|
29
28
|
__spreadValues,
|
30
29
|
config,
|
31
30
|
init_define_process_env,
|
@@ -38,12 +37,12 @@ import {
|
|
38
37
|
useRoomLayoutHeader,
|
39
38
|
useSidepaneToggle,
|
40
39
|
useTheme
|
41
|
-
} from "./chunk-
|
40
|
+
} from "./chunk-5WTUTVRO.js";
|
42
41
|
|
43
42
|
// src/Prebuilt/layouts/HLSView.jsx
|
44
43
|
init_define_process_env();
|
45
|
-
import
|
46
|
-
import { useFullscreen, useMedia as
|
44
|
+
import React14, { useCallback as useCallback2, useEffect as useEffect3, useRef, useState as useState4 } from "react";
|
45
|
+
import { useFullscreen, useMedia as useMedia3, usePrevious, useToggle } from "react-use";
|
47
46
|
import { HLSPlaybackState, HMSHLSPlayer, HMSHLSPlayerEvents as HMSHLSPlayerEvents2 } from "@100mslive/hls-player";
|
48
47
|
import screenfull from "screenfull";
|
49
48
|
import { match, P } from "ts-pattern";
|
@@ -59,7 +58,7 @@ import {
|
|
59
58
|
useHMSStore,
|
60
59
|
useHMSVanillaStore
|
61
60
|
} from "@100mslive/react-sdk";
|
62
|
-
import { ColoredHandIcon, GoLiveIcon } from "@100mslive/react-icons";
|
61
|
+
import { BackwardArrowIcon, ColoredHandIcon, ForwardArrowIcon, GoLiveIcon } from "@100mslive/react-icons";
|
63
62
|
|
64
63
|
// src/Prebuilt/components/HlsStatsOverlay.jsx
|
65
64
|
init_define_process_env();
|
@@ -180,7 +179,6 @@ var HMSVideo = forwardRef((_a, videoRef) => {
|
|
180
179
|
size: "100%",
|
181
180
|
position: "relative",
|
182
181
|
justifyContent: "center",
|
183
|
-
transition: "all 0.3s ease-in-out",
|
184
182
|
"@md": {
|
185
183
|
height: "auto",
|
186
184
|
"& video": {
|
@@ -226,12 +224,6 @@ var HMSVideo = forwardRef((_a, videoRef) => {
|
|
226
224
|
);
|
227
225
|
});
|
228
226
|
|
229
|
-
// src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx
|
230
|
-
init_define_process_env();
|
231
|
-
import React6 from "react";
|
232
|
-
import { useMedia } from "react-use";
|
233
|
-
import { BackwardArrowIcon, ForwardArrowIcon } from "@100mslive/react-icons";
|
234
|
-
|
235
227
|
// src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx
|
236
228
|
init_define_process_env();
|
237
229
|
import React4 from "react";
|
@@ -262,10 +254,10 @@ var PlayPauseButton = ({
|
|
262
254
|
return /* @__PURE__ */ React4.createElement(Tooltip, { title: isPaused ? "Play" : "Pause", side: "top" }, /* @__PURE__ */ React4.createElement(IconButton, { onClick, "data-testid": "play_pause_btn" }, isPaused ? /* @__PURE__ */ React4.createElement(PlayIcon, { width, height }) : /* @__PURE__ */ React4.createElement(PauseIcon, { width, height })));
|
263
255
|
};
|
264
256
|
|
265
|
-
// src/Prebuilt/components/HMSVideo/
|
257
|
+
// src/Prebuilt/components/HMSVideo/SeekControls.tsx
|
266
258
|
init_define_process_env();
|
267
259
|
import React5 from "react";
|
268
|
-
var
|
260
|
+
var SeekControls = ({
|
269
261
|
title,
|
270
262
|
onClick,
|
271
263
|
children,
|
@@ -274,138 +266,9 @@ var SeekControl = ({
|
|
274
266
|
return /* @__PURE__ */ React5.createElement(Tooltip, { title, side: "top" }, /* @__PURE__ */ React5.createElement(IconButton, { onClick, "data-testid": "backward_forward_arrow_btn", css }, children));
|
275
267
|
};
|
276
268
|
|
277
|
-
// src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx
|
278
|
-
var PlayPauseSeekControls = ({
|
279
|
-
isPaused,
|
280
|
-
onSeekTo
|
281
|
-
}) => {
|
282
|
-
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
|
283
|
-
SeekControl,
|
284
|
-
{
|
285
|
-
onClick: (e) => {
|
286
|
-
e.stopPropagation();
|
287
|
-
onSeekTo(-10);
|
288
|
-
},
|
289
|
-
title: "backward"
|
290
|
-
},
|
291
|
-
/* @__PURE__ */ React6.createElement(BackwardArrowIcon, { width: 20, height: 20 })
|
292
|
-
), /* @__PURE__ */ React6.createElement(PlayPauseButton, { isPaused }), /* @__PURE__ */ React6.createElement(
|
293
|
-
SeekControl,
|
294
|
-
{
|
295
|
-
onClick: (e) => {
|
296
|
-
e.stopPropagation();
|
297
|
-
onSeekTo(10);
|
298
|
-
},
|
299
|
-
title: "forward"
|
300
|
-
},
|
301
|
-
/* @__PURE__ */ React6.createElement(ForwardArrowIcon, { width: 20, height: 20 })
|
302
|
-
));
|
303
|
-
};
|
304
|
-
var PlayPauseSeekOverlayControls = ({
|
305
|
-
isPaused,
|
306
|
-
showControls,
|
307
|
-
hoverControlsVisible
|
308
|
-
}) => {
|
309
|
-
const isMobile = useMedia(config.media.md);
|
310
|
-
const isLandscape = useIsLandscape();
|
311
|
-
if (!isMobile && !isLandscape) {
|
312
|
-
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
|
313
|
-
Flex,
|
314
|
-
{
|
315
|
-
css: {
|
316
|
-
bg: "rgba(0, 0, 0, 0.6)",
|
317
|
-
r: "$round",
|
318
|
-
size: "$24",
|
319
|
-
visibility: hoverControlsVisible.seekBackward ? `` : `hidden`,
|
320
|
-
opacity: hoverControlsVisible.seekBackward ? `1` : "0"
|
321
|
-
},
|
322
|
-
direction: "column",
|
323
|
-
align: "center"
|
324
|
-
},
|
325
|
-
/* @__PURE__ */ React6.createElement(SeekControl, { title: "backward" }, /* @__PURE__ */ React6.createElement(BackwardArrowIcon, { width: 52, height: 52 })),
|
326
|
-
/* @__PURE__ */ React6.createElement(Text, { variant: "body2", css: { fontWeight: "$regular" } }, "10 secs")
|
327
|
-
), /* @__PURE__ */ React6.createElement(
|
328
|
-
Box,
|
329
|
-
{
|
330
|
-
css: {
|
331
|
-
bg: "rgba(0, 0, 0, 0.6)",
|
332
|
-
r: "$round",
|
333
|
-
visibility: hoverControlsVisible.pausePlay ? `` : `hidden`,
|
334
|
-
opacity: hoverControlsVisible.pausePlay ? `1` : "0"
|
335
|
-
}
|
336
|
-
},
|
337
|
-
/* @__PURE__ */ React6.createElement(PlayPauseButton, { isPaused, width: 48, height: 48 })
|
338
|
-
), /* @__PURE__ */ React6.createElement(
|
339
|
-
Flex,
|
340
|
-
{
|
341
|
-
css: {
|
342
|
-
bg: "rgba(0, 0, 0, 0.6)",
|
343
|
-
r: "$round",
|
344
|
-
size: "$24",
|
345
|
-
visibility: hoverControlsVisible.seekForward ? `` : `hidden`,
|
346
|
-
opacity: hoverControlsVisible.seekForward ? `1` : "0"
|
347
|
-
},
|
348
|
-
direction: "column",
|
349
|
-
align: "center"
|
350
|
-
},
|
351
|
-
/* @__PURE__ */ React6.createElement(SeekControl, { title: "forward" }, /* @__PURE__ */ React6.createElement(ForwardArrowIcon, { width: 52, height: 52 })),
|
352
|
-
/* @__PURE__ */ React6.createElement(Text, { variant: "body2", css: { fontWeight: "$regular" } }, "10 secs")
|
353
|
-
));
|
354
|
-
}
|
355
|
-
return /* @__PURE__ */ React6.createElement(
|
356
|
-
Flex,
|
357
|
-
{
|
358
|
-
align: "center",
|
359
|
-
justify: "center",
|
360
|
-
css: {
|
361
|
-
position: "absolute",
|
362
|
-
bg: "#00000066",
|
363
|
-
display: "inline-flex",
|
364
|
-
gap: "$2",
|
365
|
-
zIndex: 1,
|
366
|
-
size: "100%",
|
367
|
-
visibility: showControls ? `` : `hidden`,
|
368
|
-
opacity: showControls ? `1` : "0"
|
369
|
-
}
|
370
|
-
},
|
371
|
-
/* @__PURE__ */ React6.createElement(
|
372
|
-
SeekControl,
|
373
|
-
{
|
374
|
-
title: "backward",
|
375
|
-
css: {
|
376
|
-
visibility: hoverControlsVisible.seekBackward ? `` : `hidden`,
|
377
|
-
opacity: hoverControlsVisible.seekBackward ? `1` : "0"
|
378
|
-
}
|
379
|
-
},
|
380
|
-
/* @__PURE__ */ React6.createElement(BackwardArrowIcon, { width: 32, height: 32 })
|
381
|
-
),
|
382
|
-
/* @__PURE__ */ React6.createElement(
|
383
|
-
Box,
|
384
|
-
{
|
385
|
-
css: {
|
386
|
-
bg: "rgba(0, 0, 0, 0.6)",
|
387
|
-
r: "$round"
|
388
|
-
}
|
389
|
-
},
|
390
|
-
/* @__PURE__ */ React6.createElement(PlayPauseButton, { isPaused, width: 48, height: 48 })
|
391
|
-
),
|
392
|
-
/* @__PURE__ */ React6.createElement(
|
393
|
-
SeekControl,
|
394
|
-
{
|
395
|
-
title: "forward",
|
396
|
-
css: {
|
397
|
-
visibility: hoverControlsVisible.seekForward ? `` : `hidden`,
|
398
|
-
opacity: hoverControlsVisible.seekForward ? `1` : "0"
|
399
|
-
}
|
400
|
-
},
|
401
|
-
/* @__PURE__ */ React6.createElement(ForwardArrowIcon, { width: 32, height: 32 })
|
402
|
-
)
|
403
|
-
);
|
404
|
-
};
|
405
|
-
|
406
269
|
// src/Prebuilt/components/HMSVideo/VideoProgress.tsx
|
407
270
|
init_define_process_env();
|
408
|
-
import
|
271
|
+
import React6, { useCallback, useEffect, useState } from "react";
|
409
272
|
|
410
273
|
// src/Prebuilt/components/HMSVideo/utils.ts
|
411
274
|
init_define_process_env();
|
@@ -448,12 +311,8 @@ var VideoProgress = ({
|
|
448
311
|
if (videoEl.buffered.length > 0) {
|
449
312
|
bufferProgress2 = Math.floor(getPercentage((_b = videoEl.buffered) == null ? void 0 : _b.end(0), duration));
|
450
313
|
}
|
451
|
-
|
452
|
-
|
453
|
-
}
|
454
|
-
if (!isNaN(bufferProgress2)) {
|
455
|
-
setBufferProgress(bufferProgress2);
|
456
|
-
}
|
314
|
+
setVideoProgress(isNaN(videoProgress2) ? 0 : videoProgress2);
|
315
|
+
setBufferProgress(isNaN(bufferProgress2) ? 0 : bufferProgress2);
|
457
316
|
}, [videoEl]);
|
458
317
|
const timeupdateHandler = useCallback(() => {
|
459
318
|
if (!videoEl || seekProgress) {
|
@@ -469,7 +328,7 @@ var VideoProgress = ({
|
|
469
328
|
return function cleanup() {
|
470
329
|
videoEl == null ? void 0 : videoEl.removeEventListener("timeupdate", timeupdateHandler);
|
471
330
|
};
|
472
|
-
}, [
|
331
|
+
}, [timeupdateHandler, videoEl]);
|
473
332
|
const onProgress = (progress) => {
|
474
333
|
var _a;
|
475
334
|
const progress1 = Math.floor(getPercentage(progress[0], 100));
|
@@ -485,7 +344,7 @@ var VideoProgress = ({
|
|
485
344
|
if (!videoEl) {
|
486
345
|
return null;
|
487
346
|
}
|
488
|
-
return /* @__PURE__ */
|
347
|
+
return /* @__PURE__ */ React6.createElement(Flex, { align: "center", css: { cursor: "pointer", h: "$2", alignSelf: "stretch" } }, /* @__PURE__ */ React6.createElement(
|
489
348
|
Slider,
|
490
349
|
{
|
491
350
|
id: "video-actual-rest",
|
@@ -505,7 +364,7 @@ var VideoProgress = ({
|
|
505
364
|
onPointerUp: () => setSeekProgress(false),
|
506
365
|
thumbStyles: { w: "$6", h: "$6" }
|
507
366
|
}
|
508
|
-
), /* @__PURE__ */
|
367
|
+
), /* @__PURE__ */ React6.createElement(
|
509
368
|
Box,
|
510
369
|
{
|
511
370
|
id: "video-buffer",
|
@@ -523,7 +382,7 @@ var VideoProgress = ({
|
|
523
382
|
|
524
383
|
// src/Prebuilt/components/HMSVideo/VideoTime.tsx
|
525
384
|
init_define_process_env();
|
526
|
-
import
|
385
|
+
import React7, { useEffect as useEffect2, useState as useState2 } from "react";
|
527
386
|
import { HMSHLSPlayerEvents } from "@100mslive/hls-player";
|
528
387
|
var VideoTime = () => {
|
529
388
|
const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
|
@@ -545,7 +404,7 @@ var VideoTime = () => {
|
|
545
404
|
hlsPlayer2 == null ? void 0 : hlsPlayer2.off(HMSHLSPlayerEvents.CURRENT_TIME, timeupdateHandler);
|
546
405
|
};
|
547
406
|
}, [hlsPlayer2]);
|
548
|
-
return hlsPlayer2 ? /* @__PURE__ */
|
407
|
+
return hlsPlayer2 ? /* @__PURE__ */ React7.createElement(
|
549
408
|
Text,
|
550
409
|
{
|
551
410
|
variant: "body1",
|
@@ -564,14 +423,14 @@ var VideoTime = () => {
|
|
564
423
|
|
565
424
|
// src/Prebuilt/components/HMSVideo/VolumeControl.tsx
|
566
425
|
init_define_process_env();
|
567
|
-
import
|
426
|
+
import React8, { useState as useState3 } from "react";
|
568
427
|
import { VolumeOneIcon, VolumeTwoIcon, VolumeZeroIcon } from "@100mslive/react-icons";
|
569
428
|
var VolumeControl = () => {
|
570
429
|
var _a;
|
571
430
|
const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
|
572
431
|
const [volume, setVolume] = useState3((_a = hlsPlayer2 == null ? void 0 : hlsPlayer2.volume) != null ? _a : 100);
|
573
432
|
const [showSlider, setShowSlider] = useState3(false);
|
574
|
-
return /* @__PURE__ */
|
433
|
+
return /* @__PURE__ */ React8.createElement(
|
575
434
|
Flex,
|
576
435
|
{
|
577
436
|
align: "center",
|
@@ -585,7 +444,7 @@ var VolumeControl = () => {
|
|
585
444
|
setShowSlider(false);
|
586
445
|
}
|
587
446
|
},
|
588
|
-
/* @__PURE__ */
|
447
|
+
/* @__PURE__ */ React8.createElement(
|
589
448
|
VolumeIcon,
|
590
449
|
{
|
591
450
|
volume,
|
@@ -600,7 +459,7 @@ var VolumeControl = () => {
|
|
600
459
|
}
|
601
460
|
}
|
602
461
|
),
|
603
|
-
/* @__PURE__ */
|
462
|
+
/* @__PURE__ */ React8.createElement(
|
604
463
|
Slider,
|
605
464
|
{
|
606
465
|
css: {
|
@@ -628,14 +487,15 @@ var VolumeControl = () => {
|
|
628
487
|
};
|
629
488
|
var VolumeIcon = ({ volume, onClick }) => {
|
630
489
|
if (volume === 0) {
|
631
|
-
return /* @__PURE__ */
|
490
|
+
return /* @__PURE__ */ React8.createElement(VolumeZeroIcon, { style: { cursor: "pointer", transition: "color 0.3s" }, onClick });
|
632
491
|
}
|
633
|
-
return volume < 50 ? /* @__PURE__ */
|
492
|
+
return volume < 50 ? /* @__PURE__ */ React8.createElement(VolumeOneIcon, { style: { cursor: "pointer", transition: "color 0.3s" }, onClick }) : /* @__PURE__ */ React8.createElement(VolumeTwoIcon, { style: { cursor: "pointer", transition: "color 0.3s" }, onClick });
|
634
493
|
};
|
635
494
|
|
636
495
|
// src/Prebuilt/components/HMSVideo/index.ts
|
637
496
|
var HMSVideoPlayer = {
|
638
497
|
Root: HMSVideo,
|
498
|
+
PlayPauseButton,
|
639
499
|
Progress: VideoProgress,
|
640
500
|
Duration: VideoTime,
|
641
501
|
Volume: VolumeControl,
|
@@ -644,33 +504,30 @@ var HMSVideoPlayer = {
|
|
644
504
|
Left: LeftControls,
|
645
505
|
Right: RightControls
|
646
506
|
},
|
647
|
-
|
648
|
-
Overlay: PlayPauseSeekOverlayControls,
|
649
|
-
Button: PlayPauseSeekControls
|
650
|
-
}
|
507
|
+
Seeker: SeekControls
|
651
508
|
};
|
652
509
|
|
653
510
|
// src/Prebuilt/components/HMSVideo/FullscreenButton.tsx
|
654
511
|
init_define_process_env();
|
655
|
-
import
|
512
|
+
import React9 from "react";
|
656
513
|
import { ExpandIcon, ShrinkIcon } from "@100mslive/react-icons";
|
657
514
|
var FullScreenButton = ({ isFullScreen, onToggle }) => {
|
658
|
-
return /* @__PURE__ */
|
515
|
+
return /* @__PURE__ */ React9.createElement(Tooltip, { title: `${isFullScreen ? "Exit" : "Go"} fullscreen`, side: "top" }, /* @__PURE__ */ React9.createElement(IconButton, { css: { margin: "0px" }, onClick: onToggle, key: "fullscreen_btn", "data-testid": "fullscreen_btn" }, /* @__PURE__ */ React9.createElement(Flex, null, isFullScreen ? /* @__PURE__ */ React9.createElement(ShrinkIcon, null) : /* @__PURE__ */ React9.createElement(ExpandIcon, null))));
|
659
516
|
};
|
660
517
|
|
661
518
|
// src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.tsx
|
662
519
|
init_define_process_env();
|
663
|
-
import
|
664
|
-
import { useMedia
|
520
|
+
import React10 from "react";
|
521
|
+
import { useMedia } from "react-use";
|
665
522
|
import { VolumeTwoIcon as VolumeTwoIcon2 } from "@100mslive/react-icons";
|
666
523
|
function HLSAutoplayBlockedPrompt({
|
667
524
|
open,
|
668
525
|
unblockAutoPlay
|
669
526
|
}) {
|
670
527
|
const isLandscape = useIsLandscape();
|
671
|
-
const isMobile =
|
528
|
+
const isMobile = useMedia(config.media.md);
|
672
529
|
if ((isMobile || isLandscape) && open) {
|
673
|
-
return /* @__PURE__ */
|
530
|
+
return /* @__PURE__ */ React10.createElement(
|
674
531
|
IconButton,
|
675
532
|
{
|
676
533
|
css: {
|
@@ -683,8 +540,8 @@ function HLSAutoplayBlockedPrompt({
|
|
683
540
|
return yield unblockAutoPlay();
|
684
541
|
})
|
685
542
|
},
|
686
|
-
/* @__PURE__ */
|
687
|
-
/* @__PURE__ */
|
543
|
+
/* @__PURE__ */ React10.createElement(VolumeTwoIcon2, { width: "32", height: "32" }),
|
544
|
+
/* @__PURE__ */ React10.createElement(
|
688
545
|
Text,
|
689
546
|
{
|
690
547
|
variant: "body1",
|
@@ -698,7 +555,7 @@ function HLSAutoplayBlockedPrompt({
|
|
698
555
|
)
|
699
556
|
);
|
700
557
|
}
|
701
|
-
return /* @__PURE__ */
|
558
|
+
return /* @__PURE__ */ React10.createElement(
|
702
559
|
Dialog.Root,
|
703
560
|
{
|
704
561
|
open,
|
@@ -708,7 +565,7 @@ function HLSAutoplayBlockedPrompt({
|
|
708
565
|
}
|
709
566
|
})
|
710
567
|
},
|
711
|
-
/* @__PURE__ */
|
568
|
+
/* @__PURE__ */ React10.createElement(DialogContent, { title: "Attention", closeable: false }, /* @__PURE__ */ React10.createElement(DialogRow, null, /* @__PURE__ */ React10.createElement(Text, { variant: "md" }, 'The browser wants us to get a confirmation for playing the HLS Stream. Please click "play stream" to proceed.')), /* @__PURE__ */ React10.createElement(DialogRow, { justify: "end" }, /* @__PURE__ */ React10.createElement(
|
712
569
|
Button,
|
713
570
|
{
|
714
571
|
variant: "primary",
|
@@ -723,17 +580,17 @@ function HLSAutoplayBlockedPrompt({
|
|
723
580
|
|
724
581
|
// src/Prebuilt/components/HMSVideo/HLSCaptionSelector.tsx
|
725
582
|
init_define_process_env();
|
726
|
-
import
|
583
|
+
import React11 from "react";
|
727
584
|
import { ClosedCaptionIcon, OpenCaptionIcon } from "@100mslive/react-icons";
|
728
585
|
function HLSCaptionSelector({ isEnabled }) {
|
729
586
|
const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
|
730
|
-
return /* @__PURE__ */
|
587
|
+
return /* @__PURE__ */ React11.createElement(Tooltip, { title: "Subtitles/closed captions", side: "top" }, /* @__PURE__ */ React11.createElement(IconButton, { css: { p: "$2" }, onClick: () => hlsPlayer2 == null ? void 0 : hlsPlayer2.toggleCaption() }, isEnabled ? /* @__PURE__ */ React11.createElement(ClosedCaptionIcon, { width: "20", height: "20px" }) : /* @__PURE__ */ React11.createElement(OpenCaptionIcon, { width: "20", height: "20px" })));
|
731
588
|
}
|
732
589
|
|
733
590
|
// src/Prebuilt/components/HMSVideo/HLSQualitySelector.tsx
|
734
591
|
init_define_process_env();
|
735
|
-
import
|
736
|
-
import { useMedia as
|
592
|
+
import React12 from "react";
|
593
|
+
import { useMedia as useMedia2 } from "react-use";
|
737
594
|
import { CheckIcon, CrossIcon as CrossIcon2, SettingsIcon } from "@100mslive/react-icons";
|
738
595
|
function HLSQualitySelector({
|
739
596
|
open,
|
@@ -744,13 +601,13 @@ function HLSQualitySelector({
|
|
744
601
|
isAuto,
|
745
602
|
containerRef
|
746
603
|
}) {
|
747
|
-
const isMobile =
|
604
|
+
const isMobile = useMedia2(config.media.md);
|
748
605
|
const isLandscape = useIsLandscape();
|
749
606
|
if (layers.length === 0) {
|
750
607
|
return null;
|
751
608
|
}
|
752
609
|
if (isMobile || isLandscape) {
|
753
|
-
return /* @__PURE__ */
|
610
|
+
return /* @__PURE__ */ React12.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React12.createElement(Sheet.Trigger, { asChild: true, "data-testid": "quality_selector" }, /* @__PURE__ */ React12.createElement(
|
754
611
|
Flex,
|
755
612
|
{
|
756
613
|
css: {
|
@@ -760,15 +617,15 @@ function HLSQualitySelector({
|
|
760
617
|
p: "$2"
|
761
618
|
}
|
762
619
|
},
|
763
|
-
/* @__PURE__ */
|
764
|
-
)), /* @__PURE__ */
|
620
|
+
/* @__PURE__ */ React12.createElement(SettingsIcon, null)
|
621
|
+
)), /* @__PURE__ */ React12.createElement(
|
765
622
|
Sheet.Content,
|
766
623
|
{
|
767
624
|
container: containerRef,
|
768
625
|
css: { bg: "$surface_default", pb: "$1" },
|
769
626
|
onClick: () => onOpenChange(false)
|
770
627
|
},
|
771
|
-
/* @__PURE__ */
|
628
|
+
/* @__PURE__ */ React12.createElement(
|
772
629
|
Sheet.Title,
|
773
630
|
{
|
774
631
|
css: {
|
@@ -785,10 +642,10 @@ function HLSQualitySelector({
|
|
785
642
|
}
|
786
643
|
},
|
787
644
|
"Quality",
|
788
|
-
/* @__PURE__ */
|
645
|
+
/* @__PURE__ */ React12.createElement(Sheet.Close, { css: { color: "$on_surface_high" }, onClick: () => onOpenChange(false) }, /* @__PURE__ */ React12.createElement(CrossIcon2, null))
|
789
646
|
),
|
790
647
|
layers.map((layer) => {
|
791
|
-
return /* @__PURE__ */
|
648
|
+
return /* @__PURE__ */ React12.createElement(
|
792
649
|
Flex,
|
793
650
|
{
|
794
651
|
align: "center",
|
@@ -806,12 +663,12 @@ function HLSQualitySelector({
|
|
806
663
|
key: layer.width,
|
807
664
|
onClick: () => onQualityChange(layer)
|
808
665
|
},
|
809
|
-
/* @__PURE__ */
|
810
|
-
/* @__PURE__ */
|
811
|
-
!isAuto && layer.width === (selection == null ? void 0 : selection.width) && layer.height === (selection == null ? void 0 : selection.height) && /* @__PURE__ */
|
666
|
+
/* @__PURE__ */ React12.createElement(Text, { variant: "caption", css: { fontWeight: "$semiBold" } }, getQualityText(layer)),
|
667
|
+
/* @__PURE__ */ React12.createElement(Text, { variant: "caption", css: { flex: "1 1 0", c: "$on_surface_low", pl: "$2" } }, getBitrateText(layer)),
|
668
|
+
!isAuto && layer.width === (selection == null ? void 0 : selection.width) && layer.height === (selection == null ? void 0 : selection.height) && /* @__PURE__ */ React12.createElement(CheckIcon, { width: "16px", height: "16px" })
|
812
669
|
);
|
813
670
|
}),
|
814
|
-
/* @__PURE__ */
|
671
|
+
/* @__PURE__ */ React12.createElement(
|
815
672
|
Flex,
|
816
673
|
{
|
817
674
|
align: "center",
|
@@ -829,12 +686,12 @@ function HLSQualitySelector({
|
|
829
686
|
key: "auto",
|
830
687
|
onClick: () => onQualityChange({ height: "auto" })
|
831
688
|
},
|
832
|
-
/* @__PURE__ */
|
833
|
-
isAuto && /* @__PURE__ */
|
689
|
+
/* @__PURE__ */ React12.createElement(Text, { variant: "caption", css: { fontWeight: "$semiBold", flex: "1 1 0" } }, "Auto"),
|
690
|
+
isAuto && /* @__PURE__ */ React12.createElement(CheckIcon, { width: "16px", height: "16px" })
|
834
691
|
)
|
835
692
|
));
|
836
693
|
}
|
837
|
-
return /* @__PURE__ */
|
694
|
+
return /* @__PURE__ */ React12.createElement(Dropdown.Root, { open, onOpenChange: (value) => onOpenChange(value), modal: false }, /* @__PURE__ */ React12.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "quality_selector" }, /* @__PURE__ */ React12.createElement(
|
838
695
|
Flex,
|
839
696
|
{
|
840
697
|
css: {
|
@@ -844,7 +701,7 @@ function HLSQualitySelector({
|
|
844
701
|
p: "$2"
|
845
702
|
}
|
846
703
|
},
|
847
|
-
/* @__PURE__ */
|
704
|
+
/* @__PURE__ */ React12.createElement(Tooltip, { title: "Select Quality", side: "top" }, /* @__PURE__ */ React12.createElement(Flex, { align: "center" }, /* @__PURE__ */ React12.createElement(
|
848
705
|
Box,
|
849
706
|
{
|
850
707
|
css: {
|
@@ -855,8 +712,8 @@ function HLSQualitySelector({
|
|
855
712
|
c: "$on_surface_high"
|
856
713
|
}
|
857
714
|
},
|
858
|
-
/* @__PURE__ */
|
859
|
-
), /* @__PURE__ */
|
715
|
+
/* @__PURE__ */ React12.createElement(SettingsIcon, null)
|
716
|
+
), /* @__PURE__ */ React12.createElement(
|
860
717
|
Text,
|
861
718
|
{
|
862
719
|
variant: {
|
@@ -866,7 +723,7 @@ function HLSQualitySelector({
|
|
866
723
|
},
|
867
724
|
css: { display: "flex", alignItems: "center", ml: "$2", c: "$on_surface_medium" }
|
868
725
|
},
|
869
|
-
isAuto && /* @__PURE__ */
|
726
|
+
isAuto && /* @__PURE__ */ React12.createElement(React12.Fragment, null, "Auto", /* @__PURE__ */ React12.createElement(
|
870
727
|
Box,
|
871
728
|
{
|
872
729
|
css: {
|
@@ -881,7 +738,7 @@ function HLSQualitySelector({
|
|
881
738
|
selection && Math.min(selection.width || 0, selection.height || 0),
|
882
739
|
"p"
|
883
740
|
)))
|
884
|
-
)), /* @__PURE__ */
|
741
|
+
)), /* @__PURE__ */ React12.createElement(Dropdown.Portal, { container: containerRef }, /* @__PURE__ */ React12.createElement(
|
885
742
|
Dropdown.Content,
|
886
743
|
{
|
887
744
|
sideOffset: 5,
|
@@ -897,7 +754,7 @@ function HLSQualitySelector({
|
|
897
754
|
}
|
898
755
|
},
|
899
756
|
layers.map((layer) => {
|
900
|
-
return /* @__PURE__ */
|
757
|
+
return /* @__PURE__ */ React12.createElement(
|
901
758
|
Dropdown.Item,
|
902
759
|
{
|
903
760
|
onClick: () => onQualityChange(layer),
|
@@ -912,12 +769,12 @@ function HLSQualitySelector({
|
|
912
769
|
gap: "$2"
|
913
770
|
}
|
914
771
|
},
|
915
|
-
/* @__PURE__ */
|
916
|
-
/* @__PURE__ */
|
917
|
-
!isAuto && layer.width === (selection == null ? void 0 : selection.width) && layer.height === (selection == null ? void 0 : selection.height) && /* @__PURE__ */
|
772
|
+
/* @__PURE__ */ React12.createElement(Text, { variant: "caption", css: { fontWeight: "$semiBold" } }, getQualityText(layer)),
|
773
|
+
/* @__PURE__ */ React12.createElement(Text, { variant: "caption", css: { flex: "1 1 0", c: "$on_surface_low", pl: "$2" } }, getBitrateText(layer)),
|
774
|
+
!isAuto && layer.width === (selection == null ? void 0 : selection.width) && layer.height === (selection == null ? void 0 : selection.height) && /* @__PURE__ */ React12.createElement(CheckIcon, { width: "16px", height: "16px" })
|
918
775
|
);
|
919
776
|
}),
|
920
|
-
/* @__PURE__ */
|
777
|
+
/* @__PURE__ */ React12.createElement(
|
921
778
|
Dropdown.Item,
|
922
779
|
{
|
923
780
|
onClick: () => onQualityChange({ height: "auto" }),
|
@@ -932,8 +789,8 @@ function HLSQualitySelector({
|
|
932
789
|
gap: "$2"
|
933
790
|
}
|
934
791
|
},
|
935
|
-
/* @__PURE__ */
|
936
|
-
isAuto && /* @__PURE__ */
|
792
|
+
/* @__PURE__ */ React12.createElement(Text, { variant: "caption", css: { fontWeight: "$semiBold", flex: "1 1 0" } }, "Auto"),
|
793
|
+
isAuto && /* @__PURE__ */ React12.createElement(CheckIcon, { width: "16px", height: "16px" })
|
937
794
|
)
|
938
795
|
)));
|
939
796
|
}
|
@@ -942,14 +799,14 @@ var getBitrateText = (layer) => `(${(Number(layer.bitrate / 1e3) / 1e3).toFixed(
|
|
942
799
|
|
943
800
|
// src/Prebuilt/components/HMSVideo/MwebHLSViewTitle.tsx
|
944
801
|
init_define_process_env();
|
945
|
-
import
|
802
|
+
import React13 from "react";
|
946
803
|
import { ChevronDownIcon } from "@100mslive/react-icons";
|
947
804
|
var HLSViewTitle = () => {
|
948
805
|
const { title, details, description } = useRoomLayoutHeader();
|
949
806
|
const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);
|
950
807
|
const isDetailSidepaneOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.ROOM_DETAILS);
|
951
808
|
if (isDetailSidepaneOpen) {
|
952
|
-
return /* @__PURE__ */
|
809
|
+
return /* @__PURE__ */ React13.createElement(
|
953
810
|
Flex,
|
954
811
|
{
|
955
812
|
gap: "4",
|
@@ -964,8 +821,8 @@ var HLSViewTitle = () => {
|
|
964
821
|
backgroundColor: "$surface_dim"
|
965
822
|
}
|
966
823
|
},
|
967
|
-
/* @__PURE__ */
|
968
|
-
/* @__PURE__ */
|
824
|
+
/* @__PURE__ */ React13.createElement(Text, { variant: "sub2", css: { fontWeight: "$semiBold" } }, "About Session"),
|
825
|
+
/* @__PURE__ */ React13.createElement(
|
969
826
|
Flex,
|
970
827
|
{
|
971
828
|
onClick: toggleDetailsPane,
|
@@ -975,11 +832,11 @@ var HLSViewTitle = () => {
|
|
975
832
|
"&:hover": { opacity: "0.8" }
|
976
833
|
}
|
977
834
|
},
|
978
|
-
/* @__PURE__ */
|
835
|
+
/* @__PURE__ */ React13.createElement(ChevronDownIcon, null)
|
979
836
|
)
|
980
837
|
);
|
981
838
|
}
|
982
|
-
return /* @__PURE__ */
|
839
|
+
return /* @__PURE__ */ React13.createElement(
|
983
840
|
Flex,
|
984
841
|
{
|
985
842
|
gap: "4",
|
@@ -993,38 +850,35 @@ var HLSViewTitle = () => {
|
|
993
850
|
backgroundColor: "$surface_dim"
|
994
851
|
}
|
995
852
|
},
|
996
|
-
/* @__PURE__ */
|
997
|
-
/* @__PURE__ */
|
853
|
+
/* @__PURE__ */ React13.createElement(Logo, null),
|
854
|
+
/* @__PURE__ */ React13.createElement(Flex, { direction: "column" }, title ? /* @__PURE__ */ React13.createElement(Text, { variant: "sub2", css: { fontWeight: "$semiBold" } }, title) : null, /* @__PURE__ */ React13.createElement(Flex, null, /* @__PURE__ */ React13.createElement(RoomDetailsRow, { details }), description ? /* @__PURE__ */ React13.createElement(Text, { variant: "caption", css: { color: "$on_surface_medium" }, onClick: toggleDetailsPane }, "\xA0...more") : null))
|
998
855
|
);
|
999
856
|
};
|
1000
857
|
|
1001
858
|
// src/Prebuilt/layouts/HLSView.jsx
|
1002
859
|
var hlsPlayer;
|
1003
860
|
var toastMap = {};
|
1004
|
-
var ToggleChat = (
|
861
|
+
var ToggleChat = () => {
|
1005
862
|
const { elements } = useRoomLayoutConferencingScreen();
|
1006
863
|
const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
|
1007
864
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
1008
865
|
const showChat = !!(elements == null ? void 0 : elements.chat);
|
1009
|
-
const isMobile =
|
866
|
+
const isMobile = useMedia3(config.media.md);
|
1010
867
|
const hmsActions = useHMSActions();
|
1011
868
|
useEffect3(() => {
|
1012
|
-
match({ sidepane, isMobile, showChat
|
1013
|
-
hmsActions.setAppData(APP_DATA.sidePane, "");
|
1014
|
-
}).with({ isMobile: true, showChat: true, sidepane: P.when((value) => !value) }, () => {
|
869
|
+
match({ sidepane, isMobile, showChat }).with({ isMobile: true, showChat: true, sidepane: P.when((value) => !value) }, () => {
|
1015
870
|
toggleChat();
|
1016
871
|
}).with({ showChat: false, isMobile: true, sidepane: SIDE_PANE_OPTIONS.CHAT }, () => {
|
1017
872
|
hmsActions.setAppData(APP_DATA.sidePane, "");
|
1018
873
|
}).otherwise(() => {
|
1019
874
|
});
|
1020
|
-
}, [sidepane, isMobile, toggleChat, showChat, hmsActions
|
875
|
+
}, [sidepane, isMobile, toggleChat, showChat, hmsActions]);
|
1021
876
|
return null;
|
1022
877
|
};
|
1023
878
|
var HLSView = () => {
|
1024
|
-
var _a, _b, _c, _d, _e, _f
|
879
|
+
var _a, _b, _c, _d, _e, _f;
|
1025
880
|
const videoRef = useRef(null);
|
1026
881
|
const hlsViewRef = useRef();
|
1027
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
1028
882
|
const hlsState = useHMSStore(selectHLSState);
|
1029
883
|
const enablHlsStats = useHMSStore(selectAppData(APP_DATA.hlsStats));
|
1030
884
|
const notification = useHMSNotifications(HMSNotificationTypes.POLL_STOPPED);
|
@@ -1039,11 +893,7 @@ var HLSView = () => {
|
|
1039
893
|
const [hasCaptions, setHasCaptions] = useState4(false);
|
1040
894
|
const [currentSelectedQuality, setCurrentSelectedQuality] = useState4(null);
|
1041
895
|
const [isHlsAutoplayBlocked, setIsHlsAutoplayBlocked] = useState4(false);
|
1042
|
-
const [
|
1043
|
-
seekForward: false,
|
1044
|
-
pausePlay: false,
|
1045
|
-
seekBackward: false
|
1046
|
-
});
|
896
|
+
const [isSeekEnabled, setIsSeekEnabled] = useState4(false);
|
1047
897
|
const [isPaused, setIsPaused] = useState4(false);
|
1048
898
|
const [show, toggle] = useToggle(false);
|
1049
899
|
const lastHlsUrl = usePrevious(hlsUrl);
|
@@ -1055,9 +905,7 @@ var HLSView = () => {
|
|
1055
905
|
const controlsTimerRef = useRef();
|
1056
906
|
const [seekProgress, setSeekProgress] = useState4(false);
|
1057
907
|
const isFullScreenSupported = screenfull.isEnabled;
|
1058
|
-
const
|
1059
|
-
const showChat = !!(elements == null ? void 0 : elements.chat);
|
1060
|
-
const isMobile = useMedia4(config.media.md);
|
908
|
+
const isMobile = useMedia3(config.media.md);
|
1061
909
|
const isLandscape = useIsLandscape();
|
1062
910
|
const isFullScreen = useFullscreen(hlsViewRef, show, {
|
1063
911
|
onClose: () => toggle(false)
|
@@ -1138,7 +986,7 @@ var HLSView = () => {
|
|
1138
986
|
if (!toastMap[pollId]) {
|
1139
987
|
const toastID = ToastManager.addToast({
|
1140
988
|
title: `${pollStartedBy} started a ${poll.type}: ${poll.title}`,
|
1141
|
-
action: /* @__PURE__ */
|
989
|
+
action: /* @__PURE__ */ React14.createElement(
|
1142
990
|
Button,
|
1143
991
|
{
|
1144
992
|
onClick: () => {
|
@@ -1185,17 +1033,7 @@ var HLSView = () => {
|
|
1185
1033
|
const handleNoLongerLive = ({ isLive }) => {
|
1186
1034
|
setIsVideoLive(isLive);
|
1187
1035
|
};
|
1188
|
-
const playbackEventHandler = (data) =>
|
1189
|
-
setIsPaused(data.state === HLSPlaybackState.paused);
|
1190
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1191
|
-
pausePlay: true
|
1192
|
-
}));
|
1193
|
-
setTimeout(() => {
|
1194
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1195
|
-
pausePlay: false
|
1196
|
-
}));
|
1197
|
-
}, 2e3);
|
1198
|
-
};
|
1036
|
+
const playbackEventHandler = (data) => setIsPaused(data.state === HLSPlaybackState.paused);
|
1199
1037
|
const captionEnabledEventHandler = (isCaptionEnabled2) => {
|
1200
1038
|
setIsCaptionEnabled(isCaptionEnabled2);
|
1201
1039
|
};
|
@@ -1265,28 +1103,10 @@ var HLSView = () => {
|
|
1265
1103
|
}
|
1266
1104
|
};
|
1267
1105
|
}, [controlsVisible, isFullScreen, seekProgress, qualityDropDownOpen]);
|
1268
|
-
const onSeekTo = useCallback2(
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), { seekBackward: true }));
|
1273
|
-
setTimeout(() => {
|
1274
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1275
|
-
seekBackward: false
|
1276
|
-
}));
|
1277
|
-
}, 1e3);
|
1278
|
-
}).with({ seek: 10, isMobile: false, isLandscape: false }, () => {
|
1279
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), { seekForward: true }));
|
1280
|
-
setTimeout(() => {
|
1281
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1282
|
-
seekForward: false
|
1283
|
-
}));
|
1284
|
-
}, 1e3);
|
1285
|
-
}).otherwise(() => null);
|
1286
|
-
hlsPlayer == null ? void 0 : hlsPlayer.seekTo(((_a2 = videoRef.current) == null ? void 0 : _a2.currentTime) + seek);
|
1287
|
-
},
|
1288
|
-
[hoverControlsVisible, isLandscape, isMobile]
|
1289
|
-
);
|
1106
|
+
const onSeekTo = useCallback2((seek) => {
|
1107
|
+
var _a2;
|
1108
|
+
hlsPlayer == null ? void 0 : hlsPlayer.seekTo(((_a2 = videoRef.current) == null ? void 0 : _a2.currentTime) + seek);
|
1109
|
+
}, []);
|
1290
1110
|
const onDoubleClickHandler = useCallback2(
|
1291
1111
|
(event) => {
|
1292
1112
|
var _a2;
|
@@ -1294,25 +1114,17 @@ var HLSView = () => {
|
|
1294
1114
|
return;
|
1295
1115
|
}
|
1296
1116
|
const sidePercentage = event.screenX * 100 / event.target.clientWidth;
|
1117
|
+
setIsSeekEnabled(true);
|
1297
1118
|
if (sidePercentage < 45) {
|
1298
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1299
|
-
seekBackward: true
|
1300
|
-
}));
|
1301
1119
|
onSeekTo(-10);
|
1302
1120
|
} else {
|
1303
|
-
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1304
|
-
seekForward: true
|
1305
|
-
}));
|
1306
1121
|
onSeekTo(10);
|
1307
1122
|
}
|
1308
1123
|
setTimeout(() => {
|
1309
|
-
|
1310
|
-
|
1311
|
-
seekBackward: false
|
1312
|
-
}));
|
1313
|
-
}, 1e3);
|
1124
|
+
setIsSeekEnabled(false);
|
1125
|
+
}, 200);
|
1314
1126
|
},
|
1315
|
-
[hlsState == null ? void 0 : hlsState.variants,
|
1127
|
+
[hlsState == null ? void 0 : hlsState.variants, isLandscape, isMobile, onSeekTo]
|
1316
1128
|
);
|
1317
1129
|
const onClickHandler = useCallback2(() => __async(void 0, null, function* () {
|
1318
1130
|
var _a2;
|
@@ -1355,7 +1167,7 @@ var HLSView = () => {
|
|
1355
1167
|
);
|
1356
1168
|
const keyHandler = useKeyboardHandler(isPaused, hlsPlayer);
|
1357
1169
|
if (!hlsUrl || streamEnded) {
|
1358
|
-
return /* @__PURE__ */
|
1170
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(ToggleChat, null), hlsViewRef.current && (isMobile || isLandscape) && /* @__PURE__ */ React14.createElement(Box, { css: { position: "fixed", left: "$4", top: "$4", zIndex: 11 } }, /* @__PURE__ */ React14.createElement(LeaveRoom, { screenType: "hls_live_streaming", container: hlsViewRef.current })), /* @__PURE__ */ React14.createElement(
|
1359
1171
|
Flex,
|
1360
1172
|
{
|
1361
1173
|
key: "hls-viewer",
|
@@ -1367,10 +1179,10 @@ var HLSView = () => {
|
|
1367
1179
|
flex: isLandscape ? "2 1 0" : "1 1 0"
|
1368
1180
|
}
|
1369
1181
|
},
|
1370
|
-
/* @__PURE__ */
|
1182
|
+
/* @__PURE__ */ React14.createElement(Flex, { align: "center", justify: "center", direction: "column", css: { size: "100%", px: "$10" } }, /* @__PURE__ */ React14.createElement(Flex, { css: { c: "$on_surface_high", r: "$round", bg: "$surface_default", p: "$2" } }, streamEnded ? /* @__PURE__ */ React14.createElement(ColoredHandIcon, { height: 56, width: 56 }) : /* @__PURE__ */ React14.createElement(GoLiveIcon, { height: 56, width: 56 })), /* @__PURE__ */ React14.createElement(Text, { variant: "h5", css: { c: "$on_surface_high", mt: "$10", mb: 0, textAlign: "center" } }, streamEnded ? "Stream has ended" : "Stream yet to start"), /* @__PURE__ */ React14.createElement(Text, { variant: "md", css: { textAlign: "center", mt: "$4", c: "$on_surface_medium" } }, streamEnded ? "Have a nice day!" : "Sit back and relax"))
|
1371
1183
|
));
|
1372
1184
|
}
|
1373
|
-
return /* @__PURE__ */
|
1185
|
+
return /* @__PURE__ */ React14.createElement(
|
1374
1186
|
Flex,
|
1375
1187
|
{
|
1376
1188
|
key: "hls-viewer",
|
@@ -1380,7 +1192,6 @@ var HLSView = () => {
|
|
1380
1192
|
justify: "center",
|
1381
1193
|
css: {
|
1382
1194
|
flex: isLandscape ? "2 1 0" : "1 1 0",
|
1383
|
-
transition: "all 0.3s ease-in-out",
|
1384
1195
|
"&:fullscreen": {
|
1385
1196
|
"& video": {
|
1386
1197
|
height: "unset !important"
|
@@ -1388,8 +1199,8 @@ var HLSView = () => {
|
|
1388
1199
|
}
|
1389
1200
|
}
|
1390
1201
|
},
|
1391
|
-
hlsViewRef.current && (isMobile || isLandscape) && /* @__PURE__ */
|
1392
|
-
/* @__PURE__ */
|
1202
|
+
hlsViewRef.current && (isMobile || isLandscape) && /* @__PURE__ */ React14.createElement(Box, { css: { position: "fixed", left: "$4", top: "$4", zIndex: 11 } }, /* @__PURE__ */ React14.createElement(LeaveRoom, { screenType: "hls_live_streaming", container: hlsViewRef.current })),
|
1203
|
+
/* @__PURE__ */ React14.createElement(HMSPlayerContext.Provider, { value: { hlsPlayer } }, (hlsStatsState == null ? void 0 : hlsStatsState.url) && enablHlsStats && !(isMobile || isLandscape) ? /* @__PURE__ */ React14.createElement(HlsStatsOverlay, { hlsStatsState, onClose: sfnOverlayClose }) : null, /* @__PURE__ */ React14.createElement(
|
1393
1204
|
Flex,
|
1394
1205
|
{
|
1395
1206
|
id: "hls-player-container",
|
@@ -1411,8 +1222,8 @@ var HLSView = () => {
|
|
1411
1222
|
}),
|
1412
1223
|
tabIndex: "0"
|
1413
1224
|
},
|
1414
|
-
!(isMobile || isLandscape) && /* @__PURE__ */
|
1415
|
-
showLoader && /* @__PURE__ */
|
1225
|
+
!(isMobile || isLandscape) && /* @__PURE__ */ React14.createElement(HLSAutoplayBlockedPrompt, { open: isHlsAutoplayBlocked, unblockAutoPlay }),
|
1226
|
+
showLoader && /* @__PURE__ */ React14.createElement(
|
1416
1227
|
Flex,
|
1417
1228
|
{
|
1418
1229
|
align: "center",
|
@@ -1421,9 +1232,9 @@ var HLSView = () => {
|
|
1421
1232
|
position: "absolute"
|
1422
1233
|
}
|
1423
1234
|
},
|
1424
|
-
/* @__PURE__ */
|
1235
|
+
/* @__PURE__ */ React14.createElement(Loading, { width: 72, height: 72 })
|
1425
1236
|
),
|
1426
|
-
/* @__PURE__ */
|
1237
|
+
/* @__PURE__ */ React14.createElement(
|
1427
1238
|
HMSVideoPlayer.Root,
|
1428
1239
|
{
|
1429
1240
|
ref: videoRef,
|
@@ -1435,36 +1246,53 @@ var HLSView = () => {
|
|
1435
1246
|
onDoubleClickHandler(e);
|
1436
1247
|
}
|
1437
1248
|
},
|
1438
|
-
/* @__PURE__ */
|
1249
|
+
/* @__PURE__ */ React14.createElement(React14.Fragment, null, isMobile || isLandscape ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
|
1439
1250
|
Flex,
|
1440
1251
|
{
|
1441
1252
|
align: "center",
|
1442
|
-
justify: "
|
1253
|
+
justify: "center",
|
1443
1254
|
css: {
|
1444
1255
|
position: "absolute",
|
1445
1256
|
bg: "#00000066",
|
1446
1257
|
display: "inline-flex",
|
1447
1258
|
gap: "$2",
|
1448
1259
|
zIndex: 1,
|
1449
|
-
size: "100%"
|
1260
|
+
size: "100%",
|
1261
|
+
visibility: controlsVisible ? `` : `hidden`,
|
1262
|
+
opacity: controlsVisible ? `1` : "0"
|
1450
1263
|
}
|
1451
1264
|
},
|
1452
|
-
!showLoader && ((_b = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _b.playlist_type) === HLSPlaylistType.DVR && /* @__PURE__ */
|
1453
|
-
HMSVideoPlayer.
|
1265
|
+
!showLoader && ((_b = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _b.playlist_type) === HLSPlaylistType.DVR && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
|
1266
|
+
HMSVideoPlayer.Seeker,
|
1454
1267
|
{
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1268
|
+
title: "backward",
|
1269
|
+
css: {
|
1270
|
+
visibility: isSeekEnabled ? `` : `hidden`,
|
1271
|
+
opacity: isSeekEnabled ? `1` : "0"
|
1272
|
+
}
|
1273
|
+
},
|
1274
|
+
/* @__PURE__ */ React14.createElement(BackwardArrowIcon, { width: 32, height: 32 })
|
1275
|
+
), /* @__PURE__ */ React14.createElement(
|
1276
|
+
Box,
|
1277
|
+
{
|
1278
|
+
css: {
|
1279
|
+
bg: "rgba(0, 0, 0, 0.6)",
|
1280
|
+
r: "$round"
|
1281
|
+
}
|
1282
|
+
},
|
1283
|
+
/* @__PURE__ */ React14.createElement(HMSVideoPlayer.PlayPauseButton, { isPaused, width: 48, height: 48 })
|
1284
|
+
), /* @__PURE__ */ React14.createElement(
|
1285
|
+
HMSVideoPlayer.Seeker,
|
1286
|
+
{
|
1287
|
+
title: "forward",
|
1288
|
+
css: {
|
1289
|
+
visibility: isSeekEnabled ? `` : `hidden`,
|
1290
|
+
opacity: isSeekEnabled ? `1` : "0"
|
1291
|
+
}
|
1292
|
+
},
|
1293
|
+
/* @__PURE__ */ React14.createElement(ForwardArrowIcon, { width: 32, height: 32 })
|
1294
|
+
))
|
1295
|
+
), /* @__PURE__ */ React14.createElement(
|
1468
1296
|
Flex,
|
1469
1297
|
{
|
1470
1298
|
ref: controlsRef,
|
@@ -1482,24 +1310,14 @@ var HLSView = () => {
|
|
1482
1310
|
opacity: controlsVisible ? `1` : "0"
|
1483
1311
|
}
|
1484
1312
|
},
|
1485
|
-
/* @__PURE__ */
|
1313
|
+
/* @__PURE__ */ React14.createElement(
|
1486
1314
|
HMSVideoPlayer.Controls.Root,
|
1487
1315
|
{
|
1488
1316
|
css: {
|
1489
1317
|
p: "$4 $8"
|
1490
1318
|
}
|
1491
1319
|
},
|
1492
|
-
/* @__PURE__ */
|
1493
|
-
ChatToggle,
|
1494
|
-
{
|
1495
|
-
onClick: () => {
|
1496
|
-
if (isFullScreen) {
|
1497
|
-
toggle();
|
1498
|
-
}
|
1499
|
-
toggleChat();
|
1500
|
-
}
|
1501
|
-
}
|
1502
|
-
), hasCaptions && !isHlsAutoplayBlocked && /* @__PURE__ */ React15.createElement(HLSCaptionSelector, { isEnabled: isCaptionEnabled }), hlsViewRef.current && availableLayers.length > 0 && !isHlsAutoplayBlocked ? /* @__PURE__ */ React15.createElement(
|
1320
|
+
/* @__PURE__ */ React14.createElement(HMSVideoPlayer.Controls.Right, null, isLandscape && /* @__PURE__ */ React14.createElement(ChatToggle, null), hasCaptions && !isHlsAutoplayBlocked && /* @__PURE__ */ React14.createElement(HLSCaptionSelector, { isEnabled: isCaptionEnabled }), hlsViewRef.current && availableLayers.length > 0 && !isHlsAutoplayBlocked ? /* @__PURE__ */ React14.createElement(
|
1503
1321
|
HLSQualitySelector,
|
1504
1322
|
{
|
1505
1323
|
layers: availableLayers,
|
@@ -1510,9 +1328,9 @@ var HLSView = () => {
|
|
1510
1328
|
isAuto: isUserSelectedAuto,
|
1511
1329
|
containerRef: hlsViewRef.current
|
1512
1330
|
}
|
1513
|
-
) : null, /* @__PURE__ */
|
1331
|
+
) : null, /* @__PURE__ */ React14.createElement(HLSAutoplayBlockedPrompt, { open: isHlsAutoplayBlocked, unblockAutoPlay }))
|
1514
1332
|
)
|
1515
|
-
)) : null, controlsVisible && /* @__PURE__ */
|
1333
|
+
)) : null, controlsVisible && /* @__PURE__ */ React14.createElement(
|
1516
1334
|
Flex,
|
1517
1335
|
{
|
1518
1336
|
ref: controlsRef,
|
@@ -1521,7 +1339,7 @@ var HLSView = () => {
|
|
1521
1339
|
align: "start",
|
1522
1340
|
css: {
|
1523
1341
|
position: "absolute",
|
1524
|
-
bottom: isFullScreen && ((
|
1342
|
+
bottom: isFullScreen && ((_c = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _c.playlist_type) === HLSPlaylistType.DVR ? "$8" : "0",
|
1525
1343
|
left: "0",
|
1526
1344
|
zIndex: 1,
|
1527
1345
|
background: isMobile || isLandscape ? "" : `linear-gradient(180deg, ${theme.colors.background_dim.value}00 29.46%, ${theme.colors.background_dim.value}A3 100%);`,
|
@@ -1531,27 +1349,44 @@ var HLSView = () => {
|
|
1531
1349
|
transition: "visibility 0s 0.5s, opacity 0.5s linear"
|
1532
1350
|
}
|
1533
1351
|
},
|
1534
|
-
((
|
1535
|
-
/* @__PURE__ */
|
1352
|
+
((_d = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _d.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React14.createElement(HMSVideoPlayer.Progress, { seekProgress, setSeekProgress }) : null,
|
1353
|
+
/* @__PURE__ */ React14.createElement(
|
1536
1354
|
HMSVideoPlayer.Controls.Root,
|
1537
1355
|
{
|
1538
1356
|
css: {
|
1539
1357
|
p: "$4 $8"
|
1540
1358
|
}
|
1541
1359
|
},
|
1542
|
-
/* @__PURE__ */
|
1360
|
+
/* @__PURE__ */ React14.createElement(HMSVideoPlayer.Controls.Left, null, !(isMobile || isLandscape) && /* @__PURE__ */ React14.createElement(React14.Fragment, null, ((_e = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _e.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
|
1361
|
+
HMSVideoPlayer.Seeker,
|
1362
|
+
{
|
1363
|
+
onClick: () => {
|
1364
|
+
onSeekTo(-10);
|
1365
|
+
},
|
1366
|
+
title: "backward"
|
1367
|
+
},
|
1368
|
+
/* @__PURE__ */ React14.createElement(BackwardArrowIcon, { width: 20, height: 20 })
|
1369
|
+
), /* @__PURE__ */ React14.createElement(HMSVideoPlayer.PlayPauseButton, { isPaused }), /* @__PURE__ */ React14.createElement(
|
1370
|
+
HMSVideoPlayer.Seeker,
|
1371
|
+
{
|
1372
|
+
onClick: () => {
|
1373
|
+
onSeekTo(10);
|
1374
|
+
},
|
1375
|
+
title: "forward"
|
1376
|
+
},
|
1377
|
+
/* @__PURE__ */ React14.createElement(ForwardArrowIcon, { width: 20, height: 20 })
|
1378
|
+
), !isVideoLive ? /* @__PURE__ */ React14.createElement(HMSVideoPlayer.Duration, null) : null) : null, /* @__PURE__ */ React14.createElement(HMSVideoPlayer.Volume, null)), /* @__PURE__ */ React14.createElement(
|
1543
1379
|
IconButton,
|
1544
1380
|
{
|
1545
1381
|
css: { px: "$2" },
|
1546
|
-
onClick: (
|
1547
|
-
e.stopPropagation();
|
1382
|
+
onClick: () => __async(void 0, null, function* () {
|
1548
1383
|
yield hlsPlayer == null ? void 0 : hlsPlayer.seekToLivePosition();
|
1549
1384
|
setIsVideoLive(true);
|
1550
1385
|
}),
|
1551
1386
|
key: "jump-to-live_btn",
|
1552
1387
|
"data-testid": "jump-to-live_btn"
|
1553
1388
|
},
|
1554
|
-
/* @__PURE__ */
|
1389
|
+
/* @__PURE__ */ React14.createElement(Tooltip, { title: isVideoLive ? "Live" : "Go to Live", side: "top" }, /* @__PURE__ */ React14.createElement(Flex, { justify: "center", gap: 2, align: "center" }, /* @__PURE__ */ React14.createElement(
|
1555
1390
|
Box,
|
1556
1391
|
{
|
1557
1392
|
css: {
|
@@ -1561,7 +1396,7 @@ var HLSView = () => {
|
|
1561
1396
|
r: "$1"
|
1562
1397
|
}
|
1563
1398
|
}
|
1564
|
-
), /* @__PURE__ */
|
1399
|
+
), /* @__PURE__ */ React14.createElement(
|
1565
1400
|
Text,
|
1566
1401
|
{
|
1567
1402
|
variant: "$body1",
|
@@ -1572,8 +1407,8 @@ var HLSView = () => {
|
|
1572
1407
|
},
|
1573
1408
|
isVideoLive ? "LIVE" : "GO LIVE"
|
1574
1409
|
)))
|
1575
|
-
), (isMobile || isLandscape) && !isVideoLive && ((
|
1576
|
-
/* @__PURE__ */
|
1410
|
+
), (isMobile || isLandscape) && !isVideoLive && ((_f = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _f.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React14.createElement(HMSVideoPlayer.Duration, null) : null),
|
1411
|
+
/* @__PURE__ */ React14.createElement(HMSVideoPlayer.Controls.Right, null, hasCaptions && !(isMobile || isLandscape) && /* @__PURE__ */ React14.createElement(HLSCaptionSelector, { isEnabled: isCaptionEnabled }), availableLayers.length > 0 && !(isMobile || isLandscape) ? /* @__PURE__ */ React14.createElement(
|
1577
1412
|
HLSQualitySelector,
|
1578
1413
|
{
|
1579
1414
|
layers: availableLayers,
|
@@ -1583,17 +1418,17 @@ var HLSView = () => {
|
|
1583
1418
|
onQualityChange: handleQuality,
|
1584
1419
|
isAuto: isUserSelectedAuto
|
1585
1420
|
}
|
1586
|
-
) : null, isFullScreenSupported ? /* @__PURE__ */
|
1421
|
+
) : null, isFullScreenSupported ? /* @__PURE__ */ React14.createElement(FullScreenButton, { isFullScreen, onToggle: toggle }) : null)
|
1587
1422
|
)
|
1588
1423
|
))
|
1589
1424
|
)
|
1590
1425
|
)),
|
1591
|
-
/* @__PURE__ */
|
1592
|
-
isMobile && !isFullScreen && /* @__PURE__ */
|
1426
|
+
/* @__PURE__ */ React14.createElement(ToggleChat, null),
|
1427
|
+
isMobile && !isFullScreen && /* @__PURE__ */ React14.createElement(HLSViewTitle, null)
|
1593
1428
|
);
|
1594
1429
|
};
|
1595
1430
|
var HLSView_default = HLSView;
|
1596
1431
|
export {
|
1597
1432
|
HLSView_default as default
|
1598
1433
|
};
|
1599
|
-
//# sourceMappingURL=HLSView-
|
1434
|
+
//# sourceMappingURL=HLSView-VUANLYLS.js.map
|