@100mslive/roomkit-react 0.3.11-alpha.6 → 0.3.11-alpha.8
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/{HLSView-EDTAEGGA.js → HLSView-VRWXYNFD.js} +120 -109
- package/dist/{HLSView-EDTAEGGA.js.map → HLSView-VRWXYNFD.js.map} +2 -2
- package/dist/{HLSView-4TKT4P7R.css → HLSView-ZFLKFFSD.css} +3 -3
- package/dist/{HLSView-4TKT4P7R.css.map → HLSView-ZFLKFFSD.css.map} +1 -1
- package/dist/WhiteboardLayout-L4SDISQA.css +2780 -0
- package/dist/WhiteboardLayout-L4SDISQA.css.map +7 -0
- package/dist/WhiteboardLayout-YBVQ5JAO.js +80 -0
- package/dist/WhiteboardLayout-YBVQ5JAO.js.map +7 -0
- package/dist/{chunk-6RJ75CE5.js → chunk-DVZ464HO.js} +1965 -1719
- package/dist/chunk-DVZ464HO.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +1860 -1556
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +808 -223
- package/dist/meta.esbuild.json +943 -253
- package/package.json +7 -7
- package/src/Prebuilt/components/AppData/AppData.tsx +2 -2
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +11 -7
- package/dist/chunk-6RJ75CE5.js.map +0 -7
@@ -24,6 +24,10 @@ import {
|
|
24
24
|
ToastManager,
|
25
25
|
Tooltip,
|
26
26
|
WaitingView,
|
27
|
+
__async,
|
28
|
+
__objRest,
|
29
|
+
__spreadProps,
|
30
|
+
__spreadValues,
|
27
31
|
config,
|
28
32
|
init_define_process_env,
|
29
33
|
styled,
|
@@ -35,7 +39,7 @@ import {
|
|
35
39
|
useRoomLayoutHeader,
|
36
40
|
useSidepaneToggle,
|
37
41
|
useTheme
|
38
|
-
} from "./chunk-
|
42
|
+
} from "./chunk-DVZ464HO.js";
|
39
43
|
|
40
44
|
// src/Prebuilt/layouts/HLSView.jsx
|
41
45
|
init_define_process_env();
|
@@ -63,6 +67,7 @@ init_define_process_env();
|
|
63
67
|
import React, { memo } from "react";
|
64
68
|
import { CrossIcon } from "@100mslive/react-icons";
|
65
69
|
function HlsStatsOverlay({ hlsStatsState, onClose }) {
|
70
|
+
var _a, _b, _c;
|
66
71
|
return /* @__PURE__ */ React.createElement(
|
67
72
|
Flex,
|
68
73
|
{
|
@@ -82,18 +87,18 @@ function HlsStatsOverlay({ hlsStatsState, onClose }) {
|
|
82
87
|
"a",
|
83
88
|
{
|
84
89
|
style: { cursor: "pointer", textDecoration: "underline" },
|
85
|
-
href: hlsStatsState
|
90
|
+
href: hlsStatsState == null ? void 0 : hlsStatsState.url,
|
86
91
|
target: "_blank",
|
87
92
|
rel: "noreferrer"
|
88
93
|
},
|
89
94
|
"Stream url"
|
90
95
|
))),
|
91
|
-
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Video size" }, ` ${hlsStatsState
|
92
|
-
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Buffer duration" }, hlsStatsState
|
93
|
-
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Connection speed" }, `${(hlsStatsState
|
94
|
-
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Bitrate" }, `${(hlsStatsState
|
96
|
+
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Video size" }, ` ${(_a = hlsStatsState == null ? void 0 : hlsStatsState.videoSize) == null ? void 0 : _a.width}x${(_b = hlsStatsState == null ? void 0 : hlsStatsState.videoSize) == null ? void 0 : _b.height}`),
|
97
|
+
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Buffer duration" }, (_c = hlsStatsState == null ? void 0 : hlsStatsState.bufferedDuration) == null ? void 0 : _c.toFixed(2), " "),
|
98
|
+
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Connection speed" }, `${((hlsStatsState == null ? void 0 : hlsStatsState.bandwidthEstimate) / (1e3 * 1e3)).toFixed(2)} Mbps`),
|
99
|
+
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Bitrate" }, `${((hlsStatsState == null ? void 0 : hlsStatsState.bitrate) / (1e3 * 1e3)).toFixed(2)} Mbps`),
|
95
100
|
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "distance from live" }, getDurationFromSeconds(hlsStatsState.distanceFromLive / 1e3)),
|
96
|
-
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Dropped frames" }, hlsStatsState
|
101
|
+
/* @__PURE__ */ React.createElement(HlsStatsRow, { label: "Dropped frames" }, hlsStatsState == null ? void 0 : hlsStatsState.droppedFrames)
|
97
102
|
);
|
98
103
|
}
|
99
104
|
function getDurationFromSeconds(timeInSeconds) {
|
@@ -166,10 +171,11 @@ var RightControls = styled(Flex, {
|
|
166
171
|
// src/Prebuilt/components/HMSVideo/HMSVideo.jsx
|
167
172
|
init_define_process_env();
|
168
173
|
import React2, { forwardRef } from "react";
|
169
|
-
var HMSVideo = forwardRef((
|
174
|
+
var HMSVideo = forwardRef((_a, videoRef) => {
|
175
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
170
176
|
return /* @__PURE__ */ React2.createElement(
|
171
177
|
Flex,
|
172
|
-
{
|
178
|
+
__spreadValues({
|
173
179
|
"data-testid": "hms-video",
|
174
180
|
css: {
|
175
181
|
size: "100%",
|
@@ -200,9 +206,8 @@ var HMSVideo = forwardRef(({ children, ...props }, videoRef) => {
|
|
200
206
|
fontSize: "$space$10 !important"
|
201
207
|
}
|
202
208
|
},
|
203
|
-
direction: "column"
|
204
|
-
|
205
|
-
},
|
209
|
+
direction: "column"
|
210
|
+
}, props),
|
206
211
|
/* @__PURE__ */ React2.createElement(
|
207
212
|
"video",
|
208
213
|
{
|
@@ -251,10 +256,10 @@ var PlayPauseButton = ({
|
|
251
256
|
height = 20
|
252
257
|
}) => {
|
253
258
|
const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
|
254
|
-
const onClick =
|
255
|
-
event
|
256
|
-
isPaused ?
|
257
|
-
};
|
259
|
+
const onClick = (event) => __async(void 0, null, function* () {
|
260
|
+
event == null ? void 0 : event.stopPropagation();
|
261
|
+
isPaused ? yield hlsPlayer2 == null ? void 0 : hlsPlayer2.play() : hlsPlayer2 == null ? void 0 : hlsPlayer2.pause();
|
262
|
+
});
|
258
263
|
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 })));
|
259
264
|
};
|
260
265
|
|
@@ -441,8 +446,9 @@ var VideoProgress = ({
|
|
441
446
|
const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
|
442
447
|
const [videoProgress, setVideoProgress] = useState(0);
|
443
448
|
const [bufferProgress, setBufferProgress] = useState(0);
|
444
|
-
const videoEl = hlsPlayer2
|
449
|
+
const videoEl = hlsPlayer2 == null ? void 0 : hlsPlayer2.getVideoElement();
|
445
450
|
const setProgress = useCallback(() => {
|
451
|
+
var _a;
|
446
452
|
if (!videoEl) {
|
447
453
|
return;
|
448
454
|
}
|
@@ -450,7 +456,7 @@ var VideoProgress = ({
|
|
450
456
|
const videoProgress2 = Math.floor(getPercentage(videoEl.currentTime, duration));
|
451
457
|
let bufferProgress2 = 0;
|
452
458
|
if (videoEl.buffered.length > 0) {
|
453
|
-
bufferProgress2 = Math.floor(getPercentage(videoEl.buffered
|
459
|
+
bufferProgress2 = Math.floor(getPercentage((_a = videoEl.buffered) == null ? void 0 : _a.end(0), duration));
|
454
460
|
}
|
455
461
|
if (!isNaN(videoProgress2)) {
|
456
462
|
setVideoProgress(videoProgress2);
|
@@ -472,18 +478,19 @@ var VideoProgress = ({
|
|
472
478
|
setProgress();
|
473
479
|
videoEl.addEventListener("timeupdate", timeupdateHandler);
|
474
480
|
return function cleanup() {
|
475
|
-
videoEl
|
481
|
+
videoEl == null ? void 0 : videoEl.removeEventListener("timeupdate", timeupdateHandler);
|
476
482
|
};
|
477
483
|
}, [setProgress, timeupdateHandler, videoEl]);
|
478
484
|
const onProgress = (progress) => {
|
485
|
+
var _a;
|
479
486
|
const progress1 = Math.floor(getPercentage(progress[0], 100));
|
480
|
-
const videoEl2 = hlsPlayer2
|
487
|
+
const videoEl2 = hlsPlayer2 == null ? void 0 : hlsPlayer2.getVideoElement();
|
481
488
|
if (!videoEl2) {
|
482
489
|
return;
|
483
490
|
}
|
484
|
-
const duration = isFinite(videoEl2.duration) ? videoEl2.duration : videoEl2.seekable
|
491
|
+
const duration = isFinite(videoEl2.duration) ? videoEl2.duration : ((_a = videoEl2.seekable) == null ? void 0 : _a.end(0)) || 0;
|
485
492
|
const currentTime = progress1 * duration / 100;
|
486
|
-
hlsPlayer2
|
493
|
+
hlsPlayer2 == null ? void 0 : hlsPlayer2.seekTo(currentTime);
|
487
494
|
setProgress();
|
488
495
|
};
|
489
496
|
if (!videoEl) {
|
@@ -534,7 +541,7 @@ var VideoTime = () => {
|
|
534
541
|
const [videoTime, setVideoTime] = useState2(getDurationFromSeconds2(0));
|
535
542
|
const updateTime = useCallback2(
|
536
543
|
(currentTime) => {
|
537
|
-
const videoEl = hlsPlayer2
|
544
|
+
const videoEl = hlsPlayer2 == null ? void 0 : hlsPlayer2.getVideoElement();
|
538
545
|
if (videoEl) {
|
539
546
|
const duration = getDuration(videoEl);
|
540
547
|
setVideoTime(getDurationFromSeconds2(duration - currentTime));
|
@@ -550,11 +557,11 @@ var VideoTime = () => {
|
|
550
557
|
};
|
551
558
|
if (hlsPlayer2) {
|
552
559
|
hlsPlayer2.on(HMSHLSPlayerEvents.CURRENT_TIME, timeupdateHandler);
|
553
|
-
const videoEl = hlsPlayer2
|
560
|
+
const videoEl = hlsPlayer2 == null ? void 0 : hlsPlayer2.getVideoElement();
|
554
561
|
updateTime(videoEl.currentTime);
|
555
562
|
}
|
556
563
|
return function cleanup() {
|
557
|
-
hlsPlayer2
|
564
|
+
hlsPlayer2 == null ? void 0 : hlsPlayer2.off(HMSHLSPlayerEvents.CURRENT_TIME, timeupdateHandler);
|
558
565
|
};
|
559
566
|
}, [hlsPlayer2, updateTime]);
|
560
567
|
return hlsPlayer2 ? /* @__PURE__ */ React8.createElement(
|
@@ -579,8 +586,9 @@ init_define_process_env();
|
|
579
586
|
import React9, { useState as useState3 } from "react";
|
580
587
|
import { VolumeOneIcon, VolumeTwoIcon, VolumeZeroIcon } from "@100mslive/react-icons";
|
581
588
|
var VolumeControl = () => {
|
589
|
+
var _a;
|
582
590
|
const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
|
583
|
-
const [volume, setVolume] = useState3(hlsPlayer2
|
591
|
+
const [volume, setVolume] = useState3((_a = hlsPlayer2 == null ? void 0 : hlsPlayer2.volume) != null ? _a : 100);
|
584
592
|
const [showSlider, setShowSlider] = useState3(false);
|
585
593
|
return /* @__PURE__ */ React9.createElement(
|
586
594
|
Flex,
|
@@ -603,10 +611,10 @@ var VolumeControl = () => {
|
|
603
611
|
onClick: () => {
|
604
612
|
if (volume > 0) {
|
605
613
|
setVolume(0);
|
606
|
-
hlsPlayer2
|
614
|
+
hlsPlayer2 == null ? void 0 : hlsPlayer2.setVolume(0);
|
607
615
|
} else {
|
608
616
|
setVolume(100);
|
609
|
-
hlsPlayer2
|
617
|
+
hlsPlayer2 == null ? void 0 : hlsPlayer2.setVolume(100);
|
610
618
|
}
|
611
619
|
}
|
612
620
|
}
|
@@ -629,7 +637,7 @@ var VolumeControl = () => {
|
|
629
637
|
step: 1,
|
630
638
|
value: [volume],
|
631
639
|
onValueChange: (volume2) => {
|
632
|
-
hlsPlayer2
|
640
|
+
hlsPlayer2 == null ? void 0 : hlsPlayer2.setVolume(volume2[0]);
|
633
641
|
setVolume(volume2[0]);
|
634
642
|
},
|
635
643
|
thumbStyles: { w: "$6", h: "$6" }
|
@@ -690,7 +698,9 @@ function HLSAutoplayBlockedPrompt({
|
|
690
698
|
color: "#000",
|
691
699
|
r: "$2"
|
692
700
|
},
|
693
|
-
onClick:
|
701
|
+
onClick: () => __async(this, null, function* () {
|
702
|
+
return yield unblockAutoPlay();
|
703
|
+
})
|
694
704
|
},
|
695
705
|
/* @__PURE__ */ React11.createElement(VolumeTwoIcon2, { width: "32", height: "32" }),
|
696
706
|
/* @__PURE__ */ React11.createElement(
|
@@ -711,19 +721,19 @@ function HLSAutoplayBlockedPrompt({
|
|
711
721
|
Dialog.Root,
|
712
722
|
{
|
713
723
|
open,
|
714
|
-
onOpenChange:
|
724
|
+
onOpenChange: (value) => __async(this, null, function* () {
|
715
725
|
if (!value) {
|
716
|
-
|
726
|
+
yield unblockAutoPlay();
|
717
727
|
}
|
718
|
-
}
|
728
|
+
})
|
719
729
|
},
|
720
730
|
/* @__PURE__ */ React11.createElement(DialogContent, { title: "Attention", closeable: false }, /* @__PURE__ */ React11.createElement(DialogRow, null, /* @__PURE__ */ React11.createElement(Text, { variant: "md" }, 'The browser wants us to get a confirmation for playing the HLS Stream. Please click "play stream" to proceed.')), /* @__PURE__ */ React11.createElement(DialogRow, { justify: "end" }, /* @__PURE__ */ React11.createElement(
|
721
731
|
Button,
|
722
732
|
{
|
723
733
|
variant: "primary",
|
724
|
-
onClick:
|
725
|
-
|
726
|
-
}
|
734
|
+
onClick: () => __async(this, null, function* () {
|
735
|
+
yield unblockAutoPlay();
|
736
|
+
})
|
727
737
|
},
|
728
738
|
"Play stream"
|
729
739
|
)))
|
@@ -736,7 +746,7 @@ import React12 from "react";
|
|
736
746
|
import { ClosedCaptionIcon, OpenCaptionIcon } from "@100mslive/react-icons";
|
737
747
|
function HLSCaptionSelector({ isEnabled }) {
|
738
748
|
const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
|
739
|
-
return /* @__PURE__ */ React12.createElement(Tooltip, { title: "Subtitles/closed captions", side: "top" }, /* @__PURE__ */ React12.createElement(IconButton, { css: { p: "$2" }, onClick: () => hlsPlayer2
|
749
|
+
return /* @__PURE__ */ React12.createElement(Tooltip, { title: "Subtitles/closed captions", side: "top" }, /* @__PURE__ */ React12.createElement(IconButton, { css: { p: "$2" }, onClick: () => hlsPlayer2 == null ? void 0 : hlsPlayer2.toggleCaption() }, isEnabled ? /* @__PURE__ */ React12.createElement(ClosedCaptionIcon, { width: "20", height: "20px" }) : /* @__PURE__ */ React12.createElement(OpenCaptionIcon, { width: "20", height: "20px" })));
|
740
750
|
}
|
741
751
|
|
742
752
|
// src/Prebuilt/components/HMSVideo/HLSQualitySelector.tsx
|
@@ -817,7 +827,7 @@ function HLSQualitySelector({
|
|
817
827
|
},
|
818
828
|
/* @__PURE__ */ React13.createElement(Text, { variant: "caption", css: { fontWeight: "$semiBold" } }, getQualityText(layer)),
|
819
829
|
/* @__PURE__ */ React13.createElement(Text, { variant: "caption", css: { flex: "1 1 0", c: "$on_surface_low", pl: "$2" } }, getBitrateText(layer)),
|
820
|
-
!isAuto && layer.width === selection
|
830
|
+
!isAuto && layer.width === (selection == null ? void 0 : selection.width) && layer.height === (selection == null ? void 0 : selection.height) && /* @__PURE__ */ React13.createElement(CheckIcon, { width: "16px", height: "16px" })
|
821
831
|
);
|
822
832
|
}),
|
823
833
|
/* @__PURE__ */ React13.createElement(
|
@@ -912,7 +922,7 @@ function HLSQualitySelector({
|
|
912
922
|
onClick: () => onQualityChange(layer),
|
913
923
|
key: layer.width,
|
914
924
|
css: {
|
915
|
-
bg: !isAuto && layer.width === selection
|
925
|
+
bg: !isAuto && layer.width === (selection == null ? void 0 : selection.width) && layer.height === (selection == null ? void 0 : selection.height) ? "$surface_default" : "$surface_bright",
|
916
926
|
"&:hover": {
|
917
927
|
bg: "$surface_brighter"
|
918
928
|
},
|
@@ -923,7 +933,7 @@ function HLSQualitySelector({
|
|
923
933
|
},
|
924
934
|
/* @__PURE__ */ React13.createElement(Text, { variant: "caption", css: { fontWeight: "$semiBold" } }, getQualityText(layer)),
|
925
935
|
/* @__PURE__ */ React13.createElement(Text, { variant: "caption", css: { flex: "1 1 0", c: "$on_surface_low", pl: "$2" } }, getBitrateText(layer)),
|
926
|
-
!isAuto && layer.width === selection
|
936
|
+
!isAuto && layer.width === (selection == null ? void 0 : selection.width) && layer.height === (selection == null ? void 0 : selection.height) && /* @__PURE__ */ React13.createElement(CheckIcon, { width: "16px", height: "16px" })
|
927
937
|
);
|
928
938
|
}),
|
929
939
|
/* @__PURE__ */ React13.createElement(
|
@@ -1014,7 +1024,7 @@ var ToggleChat = ({ isFullScreen = false }) => {
|
|
1014
1024
|
const { elements } = useRoomLayoutConferencingScreen();
|
1015
1025
|
const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
|
1016
1026
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
1017
|
-
const showChat = !!elements
|
1027
|
+
const showChat = !!(elements == null ? void 0 : elements.chat);
|
1018
1028
|
const isMobile = useMedia4(config.media.md);
|
1019
1029
|
const hmsActions = useHMSActions();
|
1020
1030
|
useEffect3(() => {
|
@@ -1030,6 +1040,7 @@ var ToggleChat = ({ isFullScreen = false }) => {
|
|
1030
1040
|
return null;
|
1031
1041
|
};
|
1032
1042
|
var HLSView = () => {
|
1043
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
1033
1044
|
const videoRef = useRef(null);
|
1034
1045
|
const hlsViewRef = useRef();
|
1035
1046
|
const { elements } = useRoomLayoutConferencingScreen();
|
@@ -1040,7 +1051,7 @@ var HLSView = () => {
|
|
1040
1051
|
const { themeType } = useTheme();
|
1041
1052
|
const [streamEnded, setStreamEnded] = useState4(false);
|
1042
1053
|
let [hlsStatsState, setHlsStatsState] = useState4(null);
|
1043
|
-
const hlsUrl = hlsState.variants[0]
|
1054
|
+
const hlsUrl = (_a = hlsState.variants[0]) == null ? void 0 : _a.url;
|
1044
1055
|
const [availableLayers, setAvailableLayers] = useState4([]);
|
1045
1056
|
const [isVideoLive, setIsVideoLive] = useState4(true);
|
1046
1057
|
const [isCaptionEnabled, setIsCaptionEnabled] = useState4(true);
|
@@ -1064,7 +1075,7 @@ var HLSView = () => {
|
|
1064
1075
|
const [seekProgress, setSeekProgress] = useState4(false);
|
1065
1076
|
const isFullScreenSupported = screenfull.isEnabled;
|
1066
1077
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
1067
|
-
const showChat = !!elements
|
1078
|
+
const showChat = !!(elements == null ? void 0 : elements.chat);
|
1068
1079
|
const isMobile = useMedia4(config.media.md);
|
1069
1080
|
const isLandscape = useIsLandscape();
|
1070
1081
|
const isFullScreen = useFullscreen(hlsViewRef, show, {
|
@@ -1075,11 +1086,11 @@ var HLSView = () => {
|
|
1075
1086
|
const videoEl = videoRef.current;
|
1076
1087
|
const showLoader2 = () => setShowLoader(true);
|
1077
1088
|
const hideLoader = () => setShowLoader(false);
|
1078
|
-
videoEl
|
1079
|
-
videoEl
|
1089
|
+
videoEl == null ? void 0 : videoEl.addEventListener("playing", hideLoader);
|
1090
|
+
videoEl == null ? void 0 : videoEl.addEventListener("waiting", showLoader2);
|
1080
1091
|
return () => {
|
1081
|
-
videoEl
|
1082
|
-
videoEl
|
1092
|
+
videoEl == null ? void 0 : videoEl.removeEventListener("playing", hideLoader);
|
1093
|
+
videoEl == null ? void 0 : videoEl.removeEventListener("waiting", showLoader2);
|
1083
1094
|
};
|
1084
1095
|
}, []);
|
1085
1096
|
useEffect3(() => {
|
@@ -1090,7 +1101,7 @@ var HLSView = () => {
|
|
1090
1101
|
useEffect3(() => {
|
1091
1102
|
if (!notification)
|
1092
1103
|
return;
|
1093
|
-
const toastID = toastMap
|
1104
|
+
const toastID = toastMap == null ? void 0 : toastMap[notification.data.id];
|
1094
1105
|
if (toastID) {
|
1095
1106
|
ToastManager.removeToast(toastMap[notification.data.id]);
|
1096
1107
|
delete toastMap[notification.data.id];
|
@@ -1100,18 +1111,19 @@ var HLSView = () => {
|
|
1100
1111
|
const videoElem = videoRef.current;
|
1101
1112
|
const setStreamEndedCallback = () => {
|
1102
1113
|
setStreamEnded(true);
|
1103
|
-
videoElem
|
1114
|
+
videoElem == null ? void 0 : videoElem.removeEventListener("ended", setStreamEndedCallback);
|
1104
1115
|
};
|
1105
|
-
videoElem
|
1116
|
+
videoElem == null ? void 0 : videoElem.addEventListener("ended", setStreamEndedCallback);
|
1106
1117
|
return () => {
|
1107
|
-
videoElem
|
1118
|
+
videoElem == null ? void 0 : videoElem.removeEventListener("ended", setStreamEndedCallback);
|
1108
1119
|
};
|
1109
1120
|
}, [hlsUrl]);
|
1110
1121
|
const handleQuality = useCallback3(
|
1111
1122
|
(quality) => {
|
1123
|
+
var _a2;
|
1112
1124
|
if (hlsPlayer) {
|
1113
|
-
setIsUserSelectedAuto(quality.height
|
1114
|
-
hlsPlayer
|
1125
|
+
setIsUserSelectedAuto(((_a2 = quality.height) == null ? void 0 : _a2.toString().toLowerCase()) === "auto");
|
1126
|
+
hlsPlayer == null ? void 0 : hlsPlayer.setLayer(quality);
|
1115
1127
|
}
|
1116
1128
|
},
|
1117
1129
|
[availableLayers]
|
@@ -1121,12 +1133,14 @@ var HLSView = () => {
|
|
1121
1133
|
let videoEl = videoRef.current;
|
1122
1134
|
const manifestLoadedHandler = ({ layers }) => {
|
1123
1135
|
setAvailableLayers(layers);
|
1124
|
-
setHasCaptions(hlsPlayer
|
1136
|
+
setHasCaptions(hlsPlayer == null ? void 0 : hlsPlayer.hasCaptions());
|
1125
1137
|
};
|
1126
1138
|
const layerUpdatedHandler = ({ layer }) => {
|
1127
1139
|
setCurrentSelectedQuality(layer);
|
1128
1140
|
};
|
1129
|
-
const metadataLoadedHandler = (
|
1141
|
+
const metadataLoadedHandler = (_a2) => {
|
1142
|
+
var _b2 = _a2, { payload } = _b2, rest = __objRest(_b2, ["payload"]);
|
1143
|
+
var _a3;
|
1130
1144
|
const parsePayload = (str) => {
|
1131
1145
|
try {
|
1132
1146
|
return JSON.parse(str);
|
@@ -1171,7 +1185,7 @@ var HLSView = () => {
|
|
1171
1185
|
}
|
1172
1186
|
switch (parsedPayload.type) {
|
1173
1187
|
case EMOJI_REACTION_TYPE:
|
1174
|
-
window.showFlyingEmoji
|
1188
|
+
(_a3 = window.showFlyingEmoji) == null ? void 0 : _a3.call(window, { emojiId: parsedPayload == null ? void 0 : parsedPayload.emojiId, senderId: parsedPayload == null ? void 0 : parsedPayload.senderId });
|
1175
1189
|
break;
|
1176
1190
|
default: {
|
1177
1191
|
const toast = {
|
@@ -1192,15 +1206,13 @@ var HLSView = () => {
|
|
1192
1206
|
};
|
1193
1207
|
const playbackEventHandler = (data) => {
|
1194
1208
|
setIsPaused(data.state === HLSPlaybackState.paused);
|
1195
|
-
setHoverControlsVisible({
|
1196
|
-
...hoverControlsVisible,
|
1209
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1197
1210
|
pausePlay: true
|
1198
|
-
});
|
1211
|
+
}));
|
1199
1212
|
setTimeout(() => {
|
1200
|
-
setHoverControlsVisible({
|
1201
|
-
...hoverControlsVisible,
|
1213
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1202
1214
|
pausePlay: false
|
1203
|
-
});
|
1215
|
+
}));
|
1204
1216
|
}, 2e3);
|
1205
1217
|
};
|
1206
1218
|
const captionEnabledEventHandler = (isCaptionEnabled2) => {
|
@@ -1233,22 +1245,22 @@ var HLSView = () => {
|
|
1233
1245
|
useEffect3(() => {
|
1234
1246
|
const onHLSStats = (state) => setHlsStatsState(state);
|
1235
1247
|
if (enablHlsStats) {
|
1236
|
-
hlsPlayer
|
1248
|
+
hlsPlayer == null ? void 0 : hlsPlayer.on(HMSHLSPlayerEvents2.STATS, onHLSStats);
|
1237
1249
|
} else {
|
1238
|
-
hlsPlayer
|
1250
|
+
hlsPlayer == null ? void 0 : hlsPlayer.off(HMSHLSPlayerEvents2.STATS, onHLSStats);
|
1239
1251
|
}
|
1240
1252
|
return () => {
|
1241
|
-
hlsPlayer
|
1253
|
+
hlsPlayer == null ? void 0 : hlsPlayer.off(HMSHLSPlayerEvents2.STATS, onHLSStats);
|
1242
1254
|
};
|
1243
1255
|
}, [enablHlsStats]);
|
1244
|
-
const unblockAutoPlay =
|
1256
|
+
const unblockAutoPlay = () => __async(void 0, null, function* () {
|
1245
1257
|
try {
|
1246
|
-
|
1258
|
+
yield hlsPlayer.play();
|
1247
1259
|
setIsHlsAutoplayBlocked(false);
|
1248
1260
|
} catch (error) {
|
1249
1261
|
console.error("Tried to unblock Autoplay failed with", error.message);
|
1250
1262
|
}
|
1251
|
-
};
|
1263
|
+
});
|
1252
1264
|
const sfnOverlayClose = () => {
|
1253
1265
|
hmsActions.setAppData(APP_DATA.hlsStats, !enablHlsStats);
|
1254
1266
|
};
|
@@ -1274,64 +1286,62 @@ var HLSView = () => {
|
|
1274
1286
|
}, [controlsVisible, isFullScreen, seekProgress, qualityDropDownOpen]);
|
1275
1287
|
const onSeekTo = useCallback3(
|
1276
1288
|
(seek) => {
|
1289
|
+
var _a2;
|
1277
1290
|
match({ isLandscape, isMobile, seek }).with({ seek: -10, isMobile: false, isLandscape: false }, () => {
|
1278
|
-
setHoverControlsVisible({
|
1291
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), { seekBackward: true }));
|
1279
1292
|
setTimeout(() => {
|
1280
|
-
setHoverControlsVisible({
|
1281
|
-
...hoverControlsVisible,
|
1293
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1282
1294
|
seekBackward: false
|
1283
|
-
});
|
1295
|
+
}));
|
1284
1296
|
}, 1e3);
|
1285
1297
|
}).with({ seek: 10, isMobile: false, isLandscape: false }, () => {
|
1286
|
-
setHoverControlsVisible({
|
1298
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), { seekForward: true }));
|
1287
1299
|
setTimeout(() => {
|
1288
|
-
setHoverControlsVisible({
|
1289
|
-
...hoverControlsVisible,
|
1300
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1290
1301
|
seekForward: false
|
1291
|
-
});
|
1302
|
+
}));
|
1292
1303
|
}, 1e3);
|
1293
1304
|
}).otherwise(() => null);
|
1294
|
-
hlsPlayer
|
1305
|
+
hlsPlayer == null ? void 0 : hlsPlayer.seekTo(((_a2 = videoRef.current) == null ? void 0 : _a2.currentTime) + seek);
|
1295
1306
|
},
|
1296
1307
|
[hoverControlsVisible, isLandscape, isMobile]
|
1297
1308
|
);
|
1298
1309
|
const onDoubleClickHandler = useCallback3(
|
1299
1310
|
(event) => {
|
1300
|
-
|
1311
|
+
var _a2;
|
1312
|
+
if (!(isMobile || isLandscape) || ((_a2 = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _a2.playlist_type) !== HLSPlaylistType.DVR) {
|
1301
1313
|
return;
|
1302
1314
|
}
|
1303
1315
|
const sidePercentage = event.screenX * 100 / event.target.clientWidth;
|
1304
1316
|
if (sidePercentage < 45) {
|
1305
|
-
setHoverControlsVisible({
|
1306
|
-
...hoverControlsVisible,
|
1317
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1307
1318
|
seekBackward: true
|
1308
|
-
});
|
1319
|
+
}));
|
1309
1320
|
onSeekTo(-10);
|
1310
1321
|
} else {
|
1311
|
-
setHoverControlsVisible({
|
1312
|
-
...hoverControlsVisible,
|
1322
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1313
1323
|
seekForward: true
|
1314
|
-
});
|
1324
|
+
}));
|
1315
1325
|
onSeekTo(10);
|
1316
1326
|
}
|
1317
1327
|
setTimeout(() => {
|
1318
|
-
setHoverControlsVisible({
|
1319
|
-
...hoverControlsVisible,
|
1328
|
+
setHoverControlsVisible(__spreadProps(__spreadValues({}, hoverControlsVisible), {
|
1320
1329
|
seekForward: false,
|
1321
1330
|
seekBackward: false
|
1322
|
-
});
|
1331
|
+
}));
|
1323
1332
|
}, 1e3);
|
1324
1333
|
},
|
1325
|
-
[hlsState
|
1334
|
+
[hlsState == null ? void 0 : hlsState.variants, hoverControlsVisible, isLandscape, isMobile, onSeekTo]
|
1326
1335
|
);
|
1327
|
-
const onClickHandler = useCallback3(
|
1328
|
-
|
1336
|
+
const onClickHandler = useCallback3(() => __async(void 0, null, function* () {
|
1337
|
+
var _a2;
|
1338
|
+
match({ isMobile, isLandscape, playlist_type: (_a2 = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _a2.playlist_type }).with({ playlist_type: HLSPlaylistType.DVR, isMobile: false, isLandscape: false }, () => __async(void 0, null, function* () {
|
1329
1339
|
if (isPaused) {
|
1330
|
-
|
1340
|
+
yield hlsPlayer == null ? void 0 : hlsPlayer.play();
|
1331
1341
|
} else {
|
1332
|
-
hlsPlayer
|
1342
|
+
hlsPlayer == null ? void 0 : hlsPlayer.pause();
|
1333
1343
|
}
|
1334
|
-
}).when(
|
1344
|
+
})).when(
|
1335
1345
|
({ isMobile: isMobile2, isLandscape: isLandscape2 }) => isMobile2 || isLandscape2,
|
1336
1346
|
() => {
|
1337
1347
|
setControlsVisible((value) => !value);
|
@@ -1340,7 +1350,7 @@ var HLSView = () => {
|
|
1340
1350
|
}
|
1341
1351
|
}
|
1342
1352
|
).otherwise(() => null);
|
1343
|
-
}, [hlsState
|
1353
|
+
}), [hlsState == null ? void 0 : hlsState.variants, isLandscape, isMobile, isPaused]);
|
1344
1354
|
const onHoverHandler = useCallback3(
|
1345
1355
|
(event) => {
|
1346
1356
|
event.preventDefault();
|
@@ -1412,7 +1422,7 @@ var HLSView = () => {
|
|
1412
1422
|
}
|
1413
1423
|
},
|
1414
1424
|
hlsViewRef.current && (isMobile || isLandscape) && /* @__PURE__ */ React15.createElement(Box, { css: { position: "fixed", left: "$4", top: "$4", zIndex: 11 } }, /* @__PURE__ */ React15.createElement(LeaveRoom, { screenType: "hls_live_streaming", container: hlsViewRef.current })),
|
1415
|
-
/* @__PURE__ */ React15.createElement(HMSPlayerContext.Provider, { value: { hlsPlayer } }, hlsStatsState
|
1425
|
+
/* @__PURE__ */ React15.createElement(HMSPlayerContext.Provider, { value: { hlsPlayer } }, (hlsStatsState == null ? void 0 : hlsStatsState.url) && enablHlsStats && !(isMobile || isLandscape) ? /* @__PURE__ */ React15.createElement(HlsStatsOverlay, { hlsStatsState, onClose: sfnOverlayClose }) : null, /* @__PURE__ */ React15.createElement(
|
1416
1426
|
Flex,
|
1417
1427
|
{
|
1418
1428
|
id: "hls-player-container",
|
@@ -1426,11 +1436,12 @@ var HLSView = () => {
|
|
1426
1436
|
},
|
1427
1437
|
outline: "none"
|
1428
1438
|
},
|
1429
|
-
onKeyDown:
|
1430
|
-
|
1431
|
-
|
1439
|
+
onKeyDown: (event) => __async(void 0, null, function* () {
|
1440
|
+
var _a2;
|
1441
|
+
if (((_a2 = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _a2.playlist_type) === HLSPlaylistType.DVR) {
|
1442
|
+
yield keyHandler(event);
|
1432
1443
|
}
|
1433
|
-
},
|
1444
|
+
}),
|
1434
1445
|
tabIndex: "0"
|
1435
1446
|
},
|
1436
1447
|
!(isMobile || isLandscape) && /* @__PURE__ */ React15.createElement(HLSAutoplayBlockedPrompt, { open: isHlsAutoplayBlocked, unblockAutoPlay }),
|
@@ -1471,7 +1482,7 @@ var HLSView = () => {
|
|
1471
1482
|
size: "100%"
|
1472
1483
|
}
|
1473
1484
|
},
|
1474
|
-
!showLoader && hlsState
|
1485
|
+
!showLoader && ((_b = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _b.playlist_type) === HLSPlaylistType.DVR && /* @__PURE__ */ React15.createElement(
|
1475
1486
|
HMSVideoPlayer.PlayPauseSeekControls.Overlay,
|
1476
1487
|
{
|
1477
1488
|
isPaused,
|
@@ -1479,7 +1490,7 @@ var HLSView = () => {
|
|
1479
1490
|
hoverControlsVisible
|
1480
1491
|
}
|
1481
1492
|
)
|
1482
|
-
), isMobile || isLandscape ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, !showLoader && hlsState
|
1493
|
+
), isMobile || isLandscape ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, !showLoader && ((_c = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _c.playlist_type) === HLSPlaylistType.DVR && /* @__PURE__ */ React15.createElement(
|
1483
1494
|
HMSVideoPlayer.PlayPauseSeekControls.Overlay,
|
1484
1495
|
{
|
1485
1496
|
isPaused,
|
@@ -1546,7 +1557,7 @@ var HLSView = () => {
|
|
1546
1557
|
align: "start",
|
1547
1558
|
css: {
|
1548
1559
|
position: "absolute",
|
1549
|
-
bottom: isFullScreen && hlsState
|
1560
|
+
bottom: isFullScreen && ((_d = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _d.playlist_type) === HLSPlaylistType.DVR ? "$8" : "0",
|
1550
1561
|
left: "0",
|
1551
1562
|
zIndex: 1,
|
1552
1563
|
background: isMobile || isLandscape ? "" : `linear-gradient(180deg, ${theme.colors.background_dim.value}00 29.46%, ${theme.colors.background_dim.value}A3 100%);`,
|
@@ -1556,7 +1567,7 @@ var HLSView = () => {
|
|
1556
1567
|
transition: "visibility 0s 0.5s, opacity 0.5s linear"
|
1557
1568
|
}
|
1558
1569
|
},
|
1559
|
-
hlsState
|
1570
|
+
((_e = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _e.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React15.createElement(HMSVideoPlayer.Progress, { seekProgress, setSeekProgress }) : null,
|
1560
1571
|
/* @__PURE__ */ React15.createElement(
|
1561
1572
|
HMSVideoPlayer.Controls.Root,
|
1562
1573
|
{
|
@@ -1565,15 +1576,15 @@ var HLSView = () => {
|
|
1565
1576
|
},
|
1566
1577
|
onClick: (e) => e.stopPropagation()
|
1567
1578
|
},
|
1568
|
-
/* @__PURE__ */ React15.createElement(HMSVideoPlayer.Controls.Left, null, !(isMobile || isLandscape) && /* @__PURE__ */ React15.createElement(React15.Fragment, null, hlsState
|
1579
|
+
/* @__PURE__ */ React15.createElement(HMSVideoPlayer.Controls.Left, null, !(isMobile || isLandscape) && /* @__PURE__ */ React15.createElement(React15.Fragment, null, ((_f = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _f.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(HMSVideoPlayer.PlayPauseSeekControls.Button, { isPaused, onSeekTo }), !isVideoLive ? /* @__PURE__ */ React15.createElement(HMSVideoPlayer.Duration, null) : null) : null, /* @__PURE__ */ React15.createElement(HMSVideoPlayer.Volume, null)), /* @__PURE__ */ React15.createElement(
|
1569
1580
|
IconButton,
|
1570
1581
|
{
|
1571
1582
|
css: { px: "$2" },
|
1572
|
-
onClick:
|
1583
|
+
onClick: (e) => __async(void 0, null, function* () {
|
1573
1584
|
e.stopPropagation();
|
1574
|
-
|
1585
|
+
yield hlsPlayer == null ? void 0 : hlsPlayer.seekToLivePosition();
|
1575
1586
|
setIsVideoLive(true);
|
1576
|
-
},
|
1587
|
+
}),
|
1577
1588
|
key: "jump-to-live_btn",
|
1578
1589
|
"data-testid": "jump-to-live_btn"
|
1579
1590
|
},
|
@@ -1598,7 +1609,7 @@ var HLSView = () => {
|
|
1598
1609
|
},
|
1599
1610
|
isVideoLive ? "LIVE" : "GO LIVE"
|
1600
1611
|
)))
|
1601
|
-
), (isMobile || isLandscape) && !isVideoLive && hlsState
|
1612
|
+
), (isMobile || isLandscape) && !isVideoLive && ((_g = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _g.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React15.createElement(HMSVideoPlayer.Duration, null) : null),
|
1602
1613
|
/* @__PURE__ */ React15.createElement(HMSVideoPlayer.Controls.Right, null, hasCaptions && !(isMobile || isLandscape) && /* @__PURE__ */ React15.createElement(HLSCaptionSelector, { isEnabled: isCaptionEnabled }), availableLayers.length > 0 && !(isMobile || isLandscape) ? /* @__PURE__ */ React15.createElement(
|
1603
1614
|
HLSQualitySelector,
|
1604
1615
|
{
|
@@ -1622,4 +1633,4 @@ var HLSView_default = HLSView;
|
|
1622
1633
|
export {
|
1623
1634
|
HLSView_default as default
|
1624
1635
|
};
|
1625
|
-
//# sourceMappingURL=HLSView-
|
1636
|
+
//# sourceMappingURL=HLSView-VRWXYNFD.js.map
|