@100mslive/roomkit-react 0.2.8-alpha.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dist/{HLSView-TOMPA4E4.js → HLSView-LZOTIUWE.js} +141 -86
  2. package/dist/HLSView-LZOTIUWE.js.map +7 -0
  3. package/dist/Prebuilt/components/Chat/Chat.d.ts +1 -1
  4. package/dist/Prebuilt/components/HMSVideo/VideoProgress.d.ts +4 -1
  5. package/dist/Prebuilt/components/HMSVideo/index.d.ts +4 -1
  6. package/dist/Prebuilt/components/SidePaneTabs.d.ts +0 -1
  7. package/dist/Prebuilt/layouts/SidePane.d.ts +1 -1
  8. package/dist/{chunk-FUDX3LDB.js → chunk-LCECN6XD.js} +194 -142
  9. package/dist/chunk-LCECN6XD.js.map +7 -0
  10. package/dist/index.cjs.js +352 -246
  11. package/dist/index.cjs.js.map +3 -3
  12. package/dist/index.js +1 -1
  13. package/dist/meta.cjs.json +77 -52
  14. package/dist/meta.esbuild.json +89 -63
  15. package/package.json +6 -6
  16. package/src/Prebuilt/components/Chat/Chat.tsx +23 -4
  17. package/src/Prebuilt/components/Chat/ChatFooter.tsx +2 -2
  18. package/src/Prebuilt/components/Chat/EmptyChat.tsx +5 -1
  19. package/src/Prebuilt/components/ConferenceScreen.tsx +13 -1
  20. package/src/Prebuilt/components/EmojiReaction.jsx +2 -2
  21. package/src/Prebuilt/components/Footer/RoleOptions.tsx +4 -4
  22. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +13 -10
  23. package/src/Prebuilt/components/HMSVideo/MwebHLSViewTitle.tsx +6 -4
  24. package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +36 -23
  25. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +1 -1
  26. package/src/Prebuilt/components/MwebLandscapePrompt.tsx +9 -3
  27. package/src/Prebuilt/components/SidePaneTabs.tsx +1 -4
  28. package/src/Prebuilt/layouts/HLSView.jsx +291 -245
  29. package/src/Prebuilt/layouts/SidePane.tsx +73 -49
  30. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +10 -2
  31. package/dist/HLSView-TOMPA4E4.js.map +0 -7
  32. package/dist/chunk-FUDX3LDB.js.map +0 -7
@@ -14,6 +14,8 @@ import {
14
14
  LeaveRoom,
15
15
  Loading,
16
16
  Logo,
17
+ POLL_STATE,
18
+ POLL_VIEWS,
17
19
  RoomDetailsRow,
18
20
  SIDE_PANE_OPTIONS,
19
21
  Sheet,
@@ -30,19 +32,19 @@ import {
30
32
  theme,
31
33
  useIsLandscape,
32
34
  useIsSidepaneTypeOpen,
33
- usePollViewToggle,
34
35
  useRoomLayoutConferencingScreen,
35
36
  useRoomLayoutHeader,
36
37
  useSidepaneToggle,
37
38
  useTheme
38
- } from "./chunk-FUDX3LDB.js";
39
+ } from "./chunk-LCECN6XD.js";
39
40
 
40
41
  // src/Prebuilt/layouts/HLSView.jsx
41
42
  init_define_process_env();
42
- import React14, { useCallback, useEffect as useEffect3, useRef, useState as useState4 } from "react";
43
- import { useFullscreen, useMedia as useMedia4, usePrevious, useToggle } from "react-use";
43
+ import React14, { useCallback as useCallback2, useEffect as useEffect3, useRef, useState as useState4 } from "react";
44
+ import { useFullscreen, useMedia as useMedia3, usePrevious, useToggle } from "react-use";
44
45
  import { HLSPlaybackState, HMSHLSPlayer, HMSHLSPlayerEvents as HMSHLSPlayerEvents2 } from "@100mslive/hls-player";
45
46
  import screenfull from "screenfull";
47
+ import { match, P } from "ts-pattern";
46
48
  import {
47
49
  HLSPlaylistType,
48
50
  HMSNotificationTypes,
@@ -166,11 +168,8 @@ var RightControls = styled(Flex, {
166
168
  // src/Prebuilt/components/HMSVideo/HMSVideo.jsx
167
169
  init_define_process_env();
168
170
  import React2, { forwardRef } from "react";
169
- import { useMedia } from "react-use";
170
171
  var HMSVideo = forwardRef((_a, videoRef) => {
171
172
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
172
- const isLandscape = useIsLandscape();
173
- const isMobile = useMedia(config.media.md);
174
173
  return /* @__PURE__ */ React2.createElement(
175
174
  Flex,
176
175
  __spreadValues({
@@ -178,6 +177,13 @@ var HMSVideo = forwardRef((_a, videoRef) => {
178
177
  css: {
179
178
  size: "100%",
180
179
  position: "relative",
180
+ justifyContent: "center",
181
+ "@md": {
182
+ height: "auto",
183
+ "& video": {
184
+ height: "$60 !important"
185
+ }
186
+ },
181
187
  "& video::cue": {
182
188
  color: "white",
183
189
  whiteSpace: "pre-line",
@@ -201,16 +207,16 @@ var HMSVideo = forwardRef((_a, videoRef) => {
201
207
  "video",
202
208
  {
203
209
  style: {
204
- flex: "1 1 0",
205
210
  margin: "0 auto",
206
- minHeight: "0",
207
211
  objectFit: "contain",
208
- width: "inherit",
209
- height: isLandscape || isMobile ? "100%" : "",
210
- position: isLandscape || isMobile ? "absolute" : ""
212
+ width: "auto",
213
+ height: "auto",
214
+ maxWidth: "100%",
215
+ maxHeight: "100%"
211
216
  },
212
217
  ref: videoRef,
213
- playsInline: true
218
+ playsInline: true,
219
+ disablePictureInPicture: true
214
220
  }
215
221
  ),
216
222
  children
@@ -261,7 +267,7 @@ var SeekControls = ({
261
267
 
262
268
  // src/Prebuilt/components/HMSVideo/VideoProgress.tsx
263
269
  init_define_process_env();
264
- import React6, { useEffect, useState } from "react";
270
+ import React6, { useCallback, useEffect, useState } from "react";
265
271
 
266
272
  // src/Prebuilt/components/HMSVideo/utils.ts
267
273
  init_define_process_env();
@@ -285,44 +291,54 @@ function getDurationFromSeconds2(timeInSeconds) {
285
291
  }
286
292
 
287
293
  // src/Prebuilt/components/HMSVideo/VideoProgress.tsx
288
- var VideoProgress = () => {
294
+ var VideoProgress = ({
295
+ seekProgress,
296
+ setSeekProgress
297
+ }) => {
289
298
  const { hlsPlayer: hlsPlayer2 } = useHMSPlayerContext();
290
299
  const [videoProgress, setVideoProgress] = useState(0);
291
300
  const [bufferProgress, setBufferProgress] = useState(0);
292
301
  const videoEl = hlsPlayer2 == null ? void 0 : hlsPlayer2.getVideoElement();
293
- const onValueChange = (time) => {
294
- hlsPlayer2 == null ? void 0 : hlsPlayer2.seekTo(time);
295
- };
302
+ const setProgress = useCallback(() => {
303
+ var _a, _b;
304
+ if (!videoEl) {
305
+ return;
306
+ }
307
+ const duration = isFinite(videoEl.duration) ? videoEl.duration : ((_a = videoEl.seekable) == null ? void 0 : _a.end(0)) || 0;
308
+ const videoProgress2 = Math.floor(getPercentage(videoEl.currentTime, duration));
309
+ let bufferProgress2 = 0;
310
+ if (videoEl.buffered.length > 0) {
311
+ bufferProgress2 = Math.floor(getPercentage((_b = videoEl.buffered) == null ? void 0 : _b.end(0), duration));
312
+ }
313
+ setVideoProgress(isNaN(videoProgress2) ? 0 : videoProgress2);
314
+ setBufferProgress(isNaN(bufferProgress2) ? 0 : bufferProgress2);
315
+ }, [videoEl]);
316
+ const timeupdateHandler = useCallback(() => {
317
+ if (!videoEl || seekProgress) {
318
+ return;
319
+ }
320
+ setProgress();
321
+ }, [seekProgress, setProgress, videoEl]);
296
322
  useEffect(() => {
297
323
  if (!videoEl) {
298
324
  return;
299
325
  }
300
- const timeupdateHandler = () => {
301
- var _a, _b;
302
- if (!videoEl) {
303
- return;
304
- }
305
- const duration = isFinite(videoEl.duration) ? videoEl.duration : ((_a = videoEl.seekable) == null ? void 0 : _a.end(0)) || 0;
306
- const videoProgress2 = Math.floor(getPercentage(videoEl.currentTime, duration));
307
- let bufferProgress2 = 0;
308
- if (videoEl.buffered.length > 0) {
309
- bufferProgress2 = Math.floor(getPercentage((_b = videoEl.buffered) == null ? void 0 : _b.end(0), duration));
310
- }
311
- setVideoProgress(isNaN(videoProgress2) ? 0 : videoProgress2);
312
- setBufferProgress(isNaN(bufferProgress2) ? 0 : bufferProgress2);
313
- };
314
326
  videoEl.addEventListener("timeupdate", timeupdateHandler);
315
327
  return function cleanup() {
316
328
  videoEl == null ? void 0 : videoEl.removeEventListener("timeupdate", timeupdateHandler);
317
329
  };
318
- }, [videoEl]);
330
+ }, [timeupdateHandler, videoEl]);
319
331
  const onProgress = (progress) => {
332
+ var _a;
320
333
  const progress1 = Math.floor(getPercentage(progress[0], 100));
321
334
  const videoEl2 = hlsPlayer2 == null ? void 0 : hlsPlayer2.getVideoElement();
322
- const currentTime = progress1 * ((videoEl2 == null ? void 0 : videoEl2.duration) || 0) / 100;
323
- if (onValueChange) {
324
- onValueChange(currentTime);
335
+ if (!videoEl2) {
336
+ return;
325
337
  }
338
+ const duration = isFinite(videoEl2.duration) ? videoEl2.duration : ((_a = videoEl2.seekable) == null ? void 0 : _a.end(0)) || 0;
339
+ const currentTime = progress1 * duration / 100;
340
+ hlsPlayer2 == null ? void 0 : hlsPlayer2.seekTo(currentTime);
341
+ setProgress();
326
342
  };
327
343
  if (!videoEl) {
328
344
  return null;
@@ -343,6 +359,8 @@ var VideoProgress = () => {
343
359
  value: [videoProgress],
344
360
  showTooltip: false,
345
361
  onValueChange: onProgress,
362
+ onPointerDown: () => setSeekProgress(true),
363
+ onPointerUp: () => setSeekProgress(false),
346
364
  thumbStyles: { w: "$6", h: "$6" }
347
365
  }
348
366
  ), /* @__PURE__ */ React6.createElement(
@@ -499,14 +517,14 @@ var FullScreenButton = ({ isFullScreen, onToggle }) => {
499
517
  // src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.tsx
500
518
  init_define_process_env();
501
519
  import React10 from "react";
502
- import { useMedia as useMedia2 } from "react-use";
520
+ import { useMedia } from "react-use";
503
521
  import { VolumeTwoIcon as VolumeTwoIcon2 } from "@100mslive/react-icons";
504
522
  function HLSAutoplayBlockedPrompt({
505
523
  open,
506
524
  unblockAutoPlay
507
525
  }) {
508
526
  const isLandscape = useIsLandscape();
509
- const isMobile = useMedia2(config.media.md);
527
+ const isMobile = useMedia(config.media.md);
510
528
  if ((isMobile || isLandscape) && open) {
511
529
  return /* @__PURE__ */ React10.createElement(
512
530
  IconButton,
@@ -571,7 +589,7 @@ function HLSCaptionSelector({ isEnabled }) {
571
589
  // src/Prebuilt/components/HMSVideo/HLSQualitySelector.tsx
572
590
  init_define_process_env();
573
591
  import React12 from "react";
574
- import { useMedia as useMedia3 } from "react-use";
592
+ import { useMedia as useMedia2 } from "react-use";
575
593
  import { CheckIcon, CrossIcon as CrossIcon2, SettingsIcon } from "@100mslive/react-icons";
576
594
  function HLSQualitySelector({
577
595
  open,
@@ -582,7 +600,7 @@ function HLSQualitySelector({
582
600
  isAuto,
583
601
  containerRef
584
602
  }) {
585
- const isMobile = useMedia3(config.media.md);
603
+ const isMobile = useMedia2(config.media.md);
586
604
  const isLandscape = useIsLandscape();
587
605
  if (layers.length === 0) {
588
606
  return null;
@@ -783,7 +801,7 @@ init_define_process_env();
783
801
  import React13 from "react";
784
802
  import { ChevronDownIcon } from "@100mslive/react-icons";
785
803
  var HLSViewTitle = () => {
786
- const { title, details } = useRoomLayoutHeader();
804
+ const { title, details, description } = useRoomLayoutHeader();
787
805
  const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);
788
806
  const isDetailSidepaneOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.ROOM_DETAILS);
789
807
  if (isDetailSidepaneOpen) {
@@ -832,20 +850,36 @@ var HLSViewTitle = () => {
832
850
  }
833
851
  },
834
852
  /* @__PURE__ */ React13.createElement(Logo, null),
835
- /* @__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 }), /* @__PURE__ */ React13.createElement(Text, { variant: "caption", css: { color: "$on_surface_medium" }, onClick: toggleDetailsPane }, "\xA0...more")))
853
+ /* @__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))
836
854
  );
837
855
  };
838
856
 
839
857
  // src/Prebuilt/layouts/HLSView.jsx
840
858
  var hlsPlayer;
841
859
  var toastMap = {};
860
+ var ToggleChat = () => {
861
+ const { elements } = useRoomLayoutConferencingScreen();
862
+ const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
863
+ const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
864
+ const showChat = !!(elements == null ? void 0 : elements.chat);
865
+ const isMobile = useMedia3(config.media.md);
866
+ const hmsActions = useHMSActions();
867
+ useEffect3(() => {
868
+ match({ sidepane, isMobile, showChat }).with({ isMobile: true, showChat: true, sidepane: P.when((value) => !value) }, () => {
869
+ toggleChat();
870
+ }).with({ showChat: false, isMobile: true, sidepane: SIDE_PANE_OPTIONS.CHAT }, () => {
871
+ hmsActions.setAppData(APP_DATA.sidePane, "");
872
+ }).otherwise(() => {
873
+ });
874
+ }, [sidepane, isMobile, toggleChat, showChat, hmsActions]);
875
+ return null;
876
+ };
842
877
  var HLSView = () => {
843
878
  var _a, _b, _c, _d, _e, _f;
844
879
  const videoRef = useRef(null);
845
880
  const hlsViewRef = useRef();
846
881
  const hlsState = useHMSStore(selectHLSState);
847
882
  const enablHlsStats = useHMSStore(selectAppData(APP_DATA.hlsStats));
848
- const { elements, screenType } = useRoomLayoutConferencingScreen();
849
883
  const notification = useHMSNotifications(HMSNotificationTypes.POLL_STOPPED);
850
884
  const hmsActions = useHMSActions();
851
885
  const { themeType } = useTheme();
@@ -862,29 +896,20 @@ var HLSView = () => {
862
896
  const [isPaused, setIsPaused] = useState4(false);
863
897
  const [show, toggle] = useToggle(false);
864
898
  const lastHlsUrl = usePrevious(hlsUrl);
865
- const togglePollView = usePollViewToggle();
866
899
  const vanillaStore = useHMSVanillaStore();
867
900
  const [controlsVisible, setControlsVisible] = useState4(true);
868
901
  const [isUserSelectedAuto, setIsUserSelectedAuto] = useState4(true);
869
902
  const [qualityDropDownOpen, setQualityDropDownOpen] = useState4(false);
870
903
  const controlsRef = useRef(null);
871
904
  const controlsTimerRef = useRef();
872
- const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
873
- const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
874
- const showChat = !!(elements == null ? void 0 : elements.chat);
905
+ const [seekProgress, setSeekProgress] = useState4(false);
875
906
  const isFullScreenSupported = screenfull.isEnabled;
876
- const isMobile = useMedia4(config.media.md);
907
+ const isMobile = useMedia3(config.media.md);
877
908
  const isLandscape = useIsLandscape();
878
909
  const isFullScreen = useFullscreen(hlsViewRef, show, {
879
910
  onClose: () => toggle(false)
880
911
  });
881
912
  const [showLoader, setShowLoader] = useState4(false);
882
- const isMwebHLSStream = screenType === "hls_live_streaming" && isMobile;
883
- useEffect3(() => {
884
- if (sidepane === "" && isMwebHLSStream && showChat) {
885
- toggleChat();
886
- }
887
- }, [sidepane, isMwebHLSStream, toggleChat, showChat]);
888
913
  useEffect3(() => {
889
914
  const videoEl = videoRef.current;
890
915
  const showLoader2 = () => setShowLoader(true);
@@ -921,7 +946,7 @@ var HLSView = () => {
921
946
  videoElem == null ? void 0 : videoElem.removeEventListener("ended", setStreamEndedCallback);
922
947
  };
923
948
  }, [hlsUrl]);
924
- const handleQuality = useCallback(
949
+ const handleQuality = useCallback2(
925
950
  (quality) => {
926
951
  var _a2;
927
952
  if (hlsPlayer) {
@@ -963,7 +988,13 @@ var HLSView = () => {
963
988
  action: /* @__PURE__ */ React14.createElement(
964
989
  Button,
965
990
  {
966
- onClick: () => togglePollView(pollId),
991
+ onClick: () => {
992
+ hmsActions.setAppData(APP_DATA.pollState, {
993
+ [POLL_STATE.pollInView]: pollId,
994
+ [POLL_STATE.view]: POLL_VIEWS.VOTE
995
+ });
996
+ hmsActions.setAppData(APP_DATA.sidePane, SIDE_PANE_OPTIONS.POLLS);
997
+ },
967
998
  variant: "standard",
968
999
  css: {
969
1000
  backgroundColor: "$surface_bright",
@@ -1028,7 +1059,7 @@ var HLSView = () => {
1028
1059
  hlsPlayer.reset();
1029
1060
  };
1030
1061
  }
1031
- }, [hlsUrl, togglePollView, vanillaStore]);
1062
+ }, [hlsUrl, vanillaStore, hmsActions]);
1032
1063
  useEffect3(() => {
1033
1064
  const onHLSStats = (state) => setHlsStatsState(state);
1034
1065
  if (enablHlsStats) {
@@ -1061,19 +1092,21 @@ var HLSView = () => {
1061
1092
  clearTimeout(controlsTimerRef.current);
1062
1093
  }
1063
1094
  controlsTimerRef.current = setTimeout(() => {
1064
- setControlsVisible(false);
1095
+ if (!seekProgress) {
1096
+ setControlsVisible(false);
1097
+ }
1065
1098
  }, 5e3);
1066
1099
  return () => {
1067
1100
  if (controlsTimerRef.current) {
1068
1101
  clearTimeout(controlsTimerRef.current);
1069
1102
  }
1070
1103
  };
1071
- }, [controlsVisible, isFullScreen, qualityDropDownOpen]);
1072
- const onSeekTo = useCallback((seek) => {
1104
+ }, [controlsVisible, isFullScreen, seekProgress, qualityDropDownOpen]);
1105
+ const onSeekTo = useCallback2((seek) => {
1073
1106
  var _a2;
1074
1107
  hlsPlayer == null ? void 0 : hlsPlayer.seekTo(((_a2 = videoRef.current) == null ? void 0 : _a2.currentTime) + seek);
1075
1108
  }, []);
1076
- const onDoubleClickHandler = useCallback(
1109
+ const onDoubleClickHandler = useCallback2(
1077
1110
  (event) => {
1078
1111
  var _a2;
1079
1112
  if (!(isMobile || isLandscape) || ((_a2 = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _a2.playlist_type) !== HLSPlaylistType.DVR) {
@@ -1092,7 +1125,7 @@ var HLSView = () => {
1092
1125
  },
1093
1126
  [hlsState == null ? void 0 : hlsState.variants, isLandscape, isMobile, onSeekTo]
1094
1127
  );
1095
- const onClickHandler = useCallback(() => {
1128
+ const onClickHandler = useCallback2(() => {
1096
1129
  if (!(isMobile || isLandscape)) {
1097
1130
  return;
1098
1131
  }
@@ -1101,7 +1134,7 @@ var HLSView = () => {
1101
1134
  clearTimeout(controlsTimerRef.current);
1102
1135
  }
1103
1136
  }, [isLandscape, isMobile]);
1104
- const onHoverHandler = useCallback(
1137
+ const onHoverHandler = useCallback2(
1105
1138
  (event) => {
1106
1139
  event.preventDefault();
1107
1140
  if (isMobile || isLandscape) {
@@ -1111,17 +1144,33 @@ var HLSView = () => {
1111
1144
  setControlsVisible(true);
1112
1145
  return;
1113
1146
  }
1114
- if (event.type === "mouseleave") {
1147
+ if (event.type === "mouseleave" && !seekProgress) {
1115
1148
  setControlsVisible(false);
1116
- } else if (isFullScreen && !controlsVisible && event.type === "mousemove") {
1149
+ } else if (!controlsVisible && event.type === "mousemove") {
1117
1150
  setControlsVisible(true);
1118
1151
  if (controlsTimerRef.current) {
1119
1152
  clearTimeout(controlsTimerRef.current);
1120
1153
  }
1121
1154
  }
1122
1155
  },
1123
- [controlsVisible, isFullScreen, isLandscape, isMobile, qualityDropDownOpen]
1156
+ [controlsVisible, isLandscape, isMobile, qualityDropDownOpen, seekProgress]
1124
1157
  );
1158
+ if (!hlsUrl || streamEnded) {
1159
+ 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(
1160
+ Flex,
1161
+ {
1162
+ key: "hls-viewer",
1163
+ id: `hls-viewer-${themeType}`,
1164
+ ref: hlsViewRef,
1165
+ direction: isMobile || isLandscape ? "column" : "row",
1166
+ justify: "center",
1167
+ css: {
1168
+ flex: isLandscape ? "2 1 0" : "1 1 0"
1169
+ }
1170
+ },
1171
+ /* @__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"))
1172
+ ));
1173
+ }
1125
1174
  return /* @__PURE__ */ React14.createElement(
1126
1175
  Flex,
1127
1176
  {
@@ -1129,13 +1178,18 @@ var HLSView = () => {
1129
1178
  id: `hls-viewer-${themeType}`,
1130
1179
  ref: hlsViewRef,
1131
1180
  direction: isMobile || isLandscape ? "column" : "row",
1181
+ justify: "center",
1132
1182
  css: {
1133
- w: sidepane !== "" && isLandscape ? "" : "100%",
1134
- h: sidepane !== "" && isMobile ? "36%" : "100%",
1135
- flex: "1 1 0"
1183
+ flex: isLandscape ? "2 1 0" : "1 1 0",
1184
+ "&:fullscreen": {
1185
+ "& video": {
1186
+ height: "unset !important"
1187
+ }
1188
+ }
1136
1189
  }
1137
1190
  },
1138
- hlsUrl && !streamEnded ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__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(
1191
+ 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 })),
1192
+ /* @__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(
1139
1193
  Flex,
1140
1194
  {
1141
1195
  id: "hls-player-container",
@@ -1143,7 +1197,10 @@ var HLSView = () => {
1143
1197
  justify: "center",
1144
1198
  css: {
1145
1199
  size: "100%",
1146
- margin: "0 auto"
1200
+ margin: "0 auto",
1201
+ "@md": {
1202
+ height: "auto"
1203
+ }
1147
1204
  }
1148
1205
  },
1149
1206
  !(isMobile || isLandscape) && /* @__PURE__ */ React14.createElement(HLSAutoplayBlockedPrompt, { open: isHlsAutoplayBlocked, unblockAutoPlay }),
@@ -1170,12 +1227,13 @@ var HLSView = () => {
1170
1227
  onDoubleClickHandler(e);
1171
1228
  }
1172
1229
  },
1173
- /* @__PURE__ */ React14.createElement(React14.Fragment, null, isMobile || isLandscape ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, !showLoader && ((_b = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _b.playlist_type) === HLSPlaylistType.DVR && /* @__PURE__ */ React14.createElement(
1230
+ /* @__PURE__ */ React14.createElement(React14.Fragment, null, isMobile || isLandscape ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
1174
1231
  Flex,
1175
1232
  {
1176
1233
  align: "center",
1177
1234
  justify: "center",
1178
1235
  css: {
1236
+ position: "absolute",
1179
1237
  bg: "#00000066",
1180
1238
  display: "inline-flex",
1181
1239
  gap: "$2",
@@ -1185,7 +1243,7 @@ var HLSView = () => {
1185
1243
  opacity: controlsVisible ? `1` : "0"
1186
1244
  }
1187
1245
  },
1188
- /* @__PURE__ */ React14.createElement(
1246
+ !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(
1189
1247
  HMSVideoPlayer.Seeker,
1190
1248
  {
1191
1249
  title: "backward",
@@ -1195,8 +1253,7 @@ var HLSView = () => {
1195
1253
  }
1196
1254
  },
1197
1255
  /* @__PURE__ */ React14.createElement(BackwardArrowIcon, { width: 32, height: 32 })
1198
- ),
1199
- /* @__PURE__ */ React14.createElement(
1256
+ ), /* @__PURE__ */ React14.createElement(
1200
1257
  Box,
1201
1258
  {
1202
1259
  css: {
@@ -1205,8 +1262,7 @@ var HLSView = () => {
1205
1262
  }
1206
1263
  },
1207
1264
  /* @__PURE__ */ React14.createElement(HMSVideoPlayer.PlayPauseButton, { isPaused, width: 48, height: 48 })
1208
- ),
1209
- /* @__PURE__ */ React14.createElement(
1265
+ ), /* @__PURE__ */ React14.createElement(
1210
1266
  HMSVideoPlayer.Seeker,
1211
1267
  {
1212
1268
  title: "forward",
@@ -1216,7 +1272,7 @@ var HLSView = () => {
1216
1272
  }
1217
1273
  },
1218
1274
  /* @__PURE__ */ React14.createElement(ForwardArrowIcon, { width: 32, height: 32 })
1219
- )
1275
+ ))
1220
1276
  ), /* @__PURE__ */ React14.createElement(
1221
1277
  Flex,
1222
1278
  {
@@ -1242,7 +1298,6 @@ var HLSView = () => {
1242
1298
  p: "$4 $8"
1243
1299
  }
1244
1300
  },
1245
- /* @__PURE__ */ React14.createElement(HMSVideoPlayer.Controls.Left, null, hlsViewRef.current && /* @__PURE__ */ React14.createElement(LeaveRoom, { screenType, container: hlsViewRef.current })),
1246
1301
  /* @__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(
1247
1302
  HLSQualitySelector,
1248
1303
  {
@@ -1256,7 +1311,7 @@ var HLSView = () => {
1256
1311
  }
1257
1312
  ) : null, /* @__PURE__ */ React14.createElement(HLSAutoplayBlockedPrompt, { open: isHlsAutoplayBlocked, unblockAutoPlay }))
1258
1313
  )
1259
- )) : null, /* @__PURE__ */ React14.createElement(
1314
+ )) : null, controlsVisible && /* @__PURE__ */ React14.createElement(
1260
1315
  Flex,
1261
1316
  {
1262
1317
  ref: controlsRef,
@@ -1272,12 +1327,10 @@ var HLSView = () => {
1272
1327
  width: "100%",
1273
1328
  pt: "$8",
1274
1329
  flexShrink: 0,
1275
- transition: "visibility 0s 0.5s, opacity 0.5s linear",
1276
- visibility: controlsVisible ? `` : `hidden`,
1277
- opacity: controlsVisible ? `1` : "0"
1330
+ transition: "visibility 0s 0.5s, opacity 0.5s linear"
1278
1331
  }
1279
1332
  },
1280
- ((_d = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _d.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React14.createElement(HMSVideoPlayer.Progress, null) : null,
1333
+ ((_d = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _d.playlist_type) === HLSPlaylistType.DVR ? /* @__PURE__ */ React14.createElement(HMSVideoPlayer.Progress, { seekProgress, setSeekProgress }) : null,
1281
1334
  /* @__PURE__ */ React14.createElement(
1282
1335
  HMSVideoPlayer.Controls.Root,
1283
1336
  {
@@ -1350,11 +1403,13 @@ var HLSView = () => {
1350
1403
  )
1351
1404
  ))
1352
1405
  )
1353
- )), isMobile && !isFullScreen && /* @__PURE__ */ React14.createElement(HLSViewTitle, null)) : /* @__PURE__ */ React14.createElement(Flex, { align: "center", justify: "center", direction: "column", css: { size: "100%", px: "$10" } }, /* @__PURE__ */ React14.createElement(Flex, { align: "center", gap: "2", css: { position: "absolute", left: "$4", top: "$4", zIndex: 1 } }, isMobile || isLandscape ? /* @__PURE__ */ React14.createElement(LeaveRoom, { screenType }) : null), /* @__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"))
1406
+ )),
1407
+ /* @__PURE__ */ React14.createElement(ToggleChat, null),
1408
+ isMobile && !isFullScreen && /* @__PURE__ */ React14.createElement(HLSViewTitle, null)
1354
1409
  );
1355
1410
  };
1356
1411
  var HLSView_default = HLSView;
1357
1412
  export {
1358
1413
  HLSView_default as default
1359
1414
  };
1360
- //# sourceMappingURL=HLSView-TOMPA4E4.js.map
1415
+ //# sourceMappingURL=HLSView-LZOTIUWE.js.map