@100mslive/roomkit-react 0.3.3-alpha.4 → 0.3.3-alpha.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/dist/Accordion/Accordion.d.ts +1 -0
  2. package/dist/Accordion/index.d.ts +1 -0
  3. package/dist/{HLSView-VUANLYLS.js → HLSView-W72TK3BE.js} +331 -166
  4. package/dist/HLSView-W72TK3BE.js.map +7 -0
  5. package/dist/IconButton/IconButton.d.ts +1 -1
  6. package/dist/Modal/Dialog.d.ts +1 -1
  7. package/dist/Prebuilt/IconButton.d.ts +2 -3
  8. package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +3 -1
  9. package/dist/Prebuilt/components/HMSVideo/PlayPauseButton.d.ts +2 -2
  10. package/dist/Prebuilt/components/HMSVideo/PlayPauseSeekControls.d.ts +14 -0
  11. package/dist/Prebuilt/components/HMSVideo/{SeekControls.d.ts → SeekControl.d.ts} +2 -2
  12. package/dist/Prebuilt/components/HMSVideo/index.d.ts +15 -11
  13. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2 -2
  14. package/dist/Prebuilt/components/RaiseHand.d.ts +1 -1
  15. package/dist/Prebuilt/components/VideoLayouts/WhiteboardLayout.d.ts +3 -0
  16. package/dist/Prebuilt/components/hooks/useMetadata.d.ts +8 -0
  17. package/dist/Sheet/Sheet.d.ts +1 -1
  18. package/dist/{chunk-5WTUTVRO.js → chunk-HTFCZ4D6.js} +618 -540
  19. package/dist/chunk-HTFCZ4D6.js.map +7 -0
  20. package/dist/index.cjs.js +1688 -1427
  21. package/dist/index.cjs.js.map +4 -4
  22. package/dist/index.js +1 -1
  23. package/dist/meta.cjs.json +249 -170
  24. package/dist/meta.esbuild.json +261 -181
  25. package/package.json +7 -7
  26. package/src/Accordion/Accordion.tsx +4 -4
  27. package/src/IconButton/IconButton.tsx +2 -7
  28. package/src/Prebuilt/IconButton.tsx +6 -10
  29. package/src/Prebuilt/components/Chat/ChatBody.tsx +10 -0
  30. package/src/Prebuilt/components/Chat/ChatFooter.tsx +2 -4
  31. package/src/Prebuilt/components/ConferenceScreen.tsx +1 -4
  32. package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -2
  33. package/src/Prebuilt/components/Footer/Footer.tsx +1 -4
  34. package/src/Prebuilt/components/Footer/ParticipantList.tsx +4 -1
  35. package/src/Prebuilt/components/Footer/RoleAccordion.tsx +6 -6
  36. package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +17 -3
  37. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +1 -0
  38. package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +2 -2
  39. package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +158 -0
  40. package/src/Prebuilt/components/HMSVideo/{SeekControls.tsx → SeekControl.tsx} +2 -2
  41. package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +7 -3
  42. package/src/Prebuilt/components/HMSVideo/index.ts +5 -4
  43. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +7 -7
  44. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +0 -1
  45. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +1 -5
  46. package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +0 -1
  47. package/src/Prebuilt/components/RaiseHand.tsx +7 -1
  48. package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +0 -1
  49. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +27 -4
  50. package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +95 -0
  51. package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +13 -5
  52. package/src/Prebuilt/components/hooks/{useMetadata.jsx → useMetadata.tsx} +2 -8
  53. package/src/Prebuilt/layouts/HLSView.jsx +115 -78
  54. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +1 -17
  55. package/dist/HLSView-VUANLYLS.js.map +0 -7
  56. package/dist/Prebuilt/layouts/WhiteboardView.d.ts +0 -2
  57. package/dist/chunk-5WTUTVRO.js.map +0 -7
  58. package/src/Prebuilt/layouts/WhiteboardView.tsx +0 -69
@@ -4,11 +4,17 @@ import { CSS } from '../../Theme';
4
4
  import { Tooltip } from '../../Tooltip';
5
5
  // @ts-ignore: No implicit Any
6
6
  import IconButton from '../IconButton';
7
- // @ts-ignore: No implicit Any
7
+ import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
8
8
  import { useMyMetadata } from './hooks/useMetadata';
9
9
 
10
10
  export const RaiseHand = ({ css }: { css?: CSS }) => {
11
11
  const { isHandRaised, toggleHandRaise } = useMyMetadata();
12
+ const { elements } = useRoomLayoutConferencingScreen();
13
+
14
+ if (!elements.hand_raise) {
15
+ return null;
16
+ }
17
+
12
18
  return (
13
19
  <Tooltip title={isHandRaised ? 'Lower hand' : 'Raise hand'}>
14
20
  <IconButton
@@ -13,7 +13,6 @@ import { Flex, Text } from '../../..';
13
13
  import { PreviewControls, PreviewTile } from '../Preview/PreviewJoin';
14
14
  import { RequestPrompt } from './RequestPrompt';
15
15
  import { useRoomLayoutPreviewScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
16
- // @ts-ignore: No implicit Any
17
16
  import { useMyMetadata } from '../hooks/useMetadata';
18
17
  // @ts-ignore: No implicit Any
19
18
  import { ROLE_CHANGE_DECLINED } from '../../common/constants';
@@ -5,12 +5,14 @@ import {
5
5
  selectLocalPeerRoleName,
6
6
  selectPeers,
7
7
  selectPeerScreenSharing,
8
+ selectWhiteboard,
8
9
  useHMSStore,
9
10
  useHMSVanillaStore,
10
11
  } from '@100mslive/react-sdk';
11
12
  import { EqualProminence } from './EqualProminence';
12
13
  import { RoleProminence } from './RoleProminence';
13
14
  import { ScreenshareLayout } from './ScreenshareLayout';
15
+ import { WhiteboardLayout } from './WhiteboardLayout';
14
16
  // @ts-ignore: No implicit Any
15
17
  import { usePinnedTrack, useSetAppDataByKey } from '../AppData/useUISettings';
16
18
  import { VideoTileContext } from '../hooks/useVideoTileLayout';
@@ -40,6 +42,7 @@ export const GridLayout = ({
40
42
  hide_metadata_on_tile = false,
41
43
  }: GridLayoutProps) => {
42
44
  const peerSharing = useHMSStore(selectPeerScreenSharing);
45
+ const whiteboard = useHMSStore(selectWhiteboard);
43
46
  const pinnedTrack = usePinnedTrack();
44
47
  const peers = useHMSStore(selectPeers);
45
48
  const localPeerRole = useHMSStore(selectLocalPeerRoleName);
@@ -53,9 +56,9 @@ export const GridLayout = ({
53
56
  )) ||
54
57
  pinnedTrack;
55
58
  const updatedPeers = useMemo(() => {
56
- // remove screenshare peer from active speaker sorting
57
- if (activeScreensharePeerId) {
58
- return peers.filter(peer => peer.id !== activeScreensharePeerId);
59
+ // remove screenshare/whiteboard peer from active speaker sorting
60
+ if (activeScreensharePeerId || whiteboard?.open) {
61
+ return peers.filter(peer => peer.id !== activeScreensharePeerId || peer.customerUserId !== whiteboard?.owner);
59
62
  }
60
63
  if (isInsetEnabled) {
61
64
  const isLocalPeerPinned = localPeerID === pinnedTrack?.peerId;
@@ -67,7 +70,16 @@ export const GridLayout = ({
67
70
  }
68
71
  }
69
72
  return peers;
70
- }, [isInsetEnabled, activeScreensharePeerId, localPeerRole, localPeerID, prominentRoles, peers, pinnedTrack]);
73
+ }, [
74
+ isInsetEnabled,
75
+ whiteboard,
76
+ activeScreensharePeerId,
77
+ localPeerRole,
78
+ localPeerID,
79
+ prominentRoles,
80
+ peers,
81
+ pinnedTrack,
82
+ ]);
71
83
  const vanillaStore = useHMSVanillaStore();
72
84
  const [sortedPeers, setSortedPeers] = useState(updatedPeers);
73
85
  const peersSorter = useMemo(() => new PeersSorter(vanillaStore), [vanillaStore]);
@@ -104,6 +116,17 @@ export const GridLayout = ({
104
116
  />
105
117
  </VideoTileContext.Provider>
106
118
  );
119
+ } else if (whiteboard?.open) {
120
+ return (
121
+ <VideoTileContext.Provider value={tileLayout}>
122
+ <WhiteboardLayout
123
+ peers={sortedPeers}
124
+ onPageSize={setPageSize}
125
+ onPageChange={setMainPage}
126
+ edgeToEdge={edge_to_edge}
127
+ />
128
+ </VideoTileContext.Provider>
129
+ );
107
130
  } else if (isRoleProminence) {
108
131
  return (
109
132
  <VideoTileContext.Provider value={tileLayout}>
@@ -0,0 +1,95 @@
1
+ import React, { useEffect, useMemo } from 'react';
2
+ import { useMedia } from 'react-use';
3
+ import { selectPeerByCondition, selectWhiteboard, useHMSStore, useWhiteboard } from '@100mslive/react-sdk';
4
+ import { Box } from '../../../Layout';
5
+ import { config as cssConfig } from '../../../Theme';
6
+ import { InsetTile } from '../InsetTile';
7
+ import { SecondaryTiles } from '../SecondaryTiles';
8
+ import { LayoutMode } from '../Settings/LayoutSettings';
9
+ import { LayoutProps } from './interface';
10
+ import { ProminenceLayout } from './ProminenceLayout';
11
+ // @ts-ignore: No implicit Any
12
+ import { useSetUiSettings } from '../AppData/useUISettings';
13
+ import { UI_SETTINGS } from '../../common/constants';
14
+
15
+ const WhiteboardEmbed = () => {
16
+ const isMobile = useMedia(cssConfig.media.md);
17
+ const { iframeRef } = useWhiteboard(isMobile);
18
+
19
+ return (
20
+ <Box
21
+ css={{
22
+ mx: '$8',
23
+ flex: '3 1 0',
24
+ '@lg': {
25
+ flex: '2 1 0',
26
+ display: 'flex',
27
+ alignItems: 'center',
28
+ },
29
+ }}
30
+ >
31
+ <iframe
32
+ title="Whiteboard View"
33
+ ref={iframeRef}
34
+ style={{
35
+ width: '100%',
36
+ height: '100%',
37
+ border: 0,
38
+ borderRadius: '0.75rem',
39
+ }}
40
+ allow="autoplay; clipboard-write;"
41
+ referrerPolicy="no-referrer"
42
+ />
43
+ </Box>
44
+ );
45
+ };
46
+
47
+ export const WhiteboardLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }: LayoutProps) => {
48
+ const whiteboard = useHMSStore(selectWhiteboard);
49
+ const whiteboardOwner = useHMSStore(selectPeerByCondition(peer => peer.customerUserId === whiteboard?.owner));
50
+ const [layoutMode, setLayoutMode] = useSetUiSettings(UI_SETTINGS.layoutMode);
51
+ const isMobile = useMedia(cssConfig.media.md);
52
+ const hasSidebar = !isMobile && layoutMode === LayoutMode.SIDEBAR;
53
+ const secondaryPeers = useMemo(() => {
54
+ if (layoutMode === LayoutMode.SPOTLIGHT) {
55
+ return [];
56
+ }
57
+ if (isMobile || layoutMode === LayoutMode.SIDEBAR) {
58
+ return whiteboardOwner
59
+ ? [whiteboardOwner, ...peers.filter(p => p.id !== whiteboardOwner?.id)] //keep active sharing peer as first tile
60
+ : peers;
61
+ }
62
+ return peers.filter(p => p.id !== whiteboardOwner?.id);
63
+ }, [whiteboardOwner, peers, isMobile, layoutMode]);
64
+
65
+ useEffect(() => {
66
+ if (isMobile) {
67
+ setLayoutMode(LayoutMode.GALLERY);
68
+ return;
69
+ }
70
+ if (layoutMode === LayoutMode.SIDEBAR) {
71
+ return;
72
+ }
73
+ setLayoutMode(LayoutMode.SIDEBAR);
74
+ return () => {
75
+ // reset to gallery once whiteboard is stopped
76
+ setLayoutMode(LayoutMode.GALLERY);
77
+ };
78
+ }, [isMobile]); // eslint-disable-line react-hooks/exhaustive-deps
79
+
80
+ return (
81
+ <ProminenceLayout.Root edgeToEdge={edgeToEdge} hasSidebar={hasSidebar}>
82
+ <ProminenceLayout.ProminentSection>
83
+ <WhiteboardEmbed />
84
+ </ProminenceLayout.ProminentSection>
85
+ <SecondaryTiles
86
+ peers={secondaryPeers}
87
+ onPageChange={onPageChange}
88
+ onPageSize={onPageSize}
89
+ edgeToEdge={edgeToEdge}
90
+ hasSidebar={hasSidebar}
91
+ />
92
+ {layoutMode === LayoutMode.SPOTLIGHT && whiteboardOwner && <InsetTile peerId={whiteboardOwner?.id} />}
93
+ </ProminenceLayout.Root>
94
+ );
95
+ };
@@ -6,19 +6,27 @@ import { useScreenShare, useWhiteboard } from '@100mslive/react-sdk';
6
6
  * close existing screenshare or whiteboard when the other is started
7
7
  */
8
8
  export const useCloseScreenshareWhiteboard = () => {
9
- const { amIScreenSharing, toggleScreenShare } = useScreenShare();
9
+ const { amIScreenSharing, screenSharingPeerId, toggleScreenShare } = useScreenShare();
10
10
  const { isOwner: isWhiteboardOwner, toggle: toggleWhiteboard } = useWhiteboard();
11
- const prevScreenSharer = usePrevious(amIScreenSharing);
11
+ const prevScreenSharer = usePrevious(screenSharingPeerId);
12
12
  const prevWhiteboardOwner = usePrevious(isWhiteboardOwner);
13
13
 
14
14
  // if both screenshare and whiteboard are open, close the one that was open earlier
15
15
  useEffect(() => {
16
- if (isWhiteboardOwner && amIScreenSharing) {
17
- if (prevScreenSharer && !prevWhiteboardOwner) {
16
+ if (isWhiteboardOwner && screenSharingPeerId) {
17
+ if (prevScreenSharer && amIScreenSharing && !prevWhiteboardOwner) {
18
18
  toggleScreenShare?.();
19
19
  } else if (prevWhiteboardOwner && !prevScreenSharer) {
20
20
  toggleWhiteboard?.();
21
21
  }
22
22
  }
23
- }, [isWhiteboardOwner, amIScreenSharing, prevScreenSharer, prevWhiteboardOwner, toggleScreenShare, toggleWhiteboard]);
23
+ }, [
24
+ isWhiteboardOwner,
25
+ screenSharingPeerId,
26
+ amIScreenSharing,
27
+ prevScreenSharer,
28
+ prevWhiteboardOwner,
29
+ toggleScreenShare,
30
+ toggleWhiteboard,
31
+ ]);
24
32
  };
@@ -15,7 +15,7 @@ export const useMyMetadata = () => {
15
15
  const metaData = useHMSStore(selectPeerMetadata(localPeerId));
16
16
  const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId));
17
17
 
18
- const update = async updatedFields => {
18
+ const update = async (updatedFields: Record<string, any>) => {
19
19
  try {
20
20
  // get current state from store and merge updated fields
21
21
  const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));
@@ -24,6 +24,7 @@ export const useMyMetadata = () => {
24
24
  } catch (error) {
25
25
  console.error('failed to update metadata ', updatedFields);
26
26
  }
27
+ return false;
27
28
  };
28
29
 
29
30
  const toggleHandRaise = useCallback(async () => {
@@ -43,12 +44,6 @@ export const useMyMetadata = () => {
43
44
  }
44
45
  }, [metaData?.isBRBOn]); //eslint-disable-line
45
46
 
46
- const setPrevRole = async role => {
47
- await update({
48
- prevRole: role,
49
- });
50
- };
51
-
52
47
  return {
53
48
  isHandRaised,
54
49
  isBRBOn: !!metaData?.isBRBOn,
@@ -56,6 +51,5 @@ export const useMyMetadata = () => {
56
51
  updateMetaData: update,
57
52
  toggleHandRaise,
58
53
  toggleBRB,
59
- setPrevRole,
60
54
  };
61
55
  };
@@ -15,7 +15,7 @@ import {
15
15
  useHMSStore,
16
16
  useHMSVanillaStore,
17
17
  } from '@100mslive/react-sdk';
18
- import { BackwardArrowIcon, ColoredHandIcon, ForwardArrowIcon, GoLiveIcon } from '@100mslive/react-icons';
18
+ import { ColoredHandIcon, GoLiveIcon } from '@100mslive/react-icons';
19
19
  import { ChatToggle } from '../components/Footer/ChatToggle';
20
20
  import { HlsStatsOverlay } from '../components/HlsStatsOverlay';
21
21
  import { HMSVideoPlayer } from '../components/HMSVideo';
@@ -42,7 +42,7 @@ import { APP_DATA, EMOJI_REACTION_TYPE, POLL_STATE, POLL_VIEWS, SIDE_PANE_OPTION
42
42
  let hlsPlayer;
43
43
  const toastMap = {};
44
44
 
45
- const ToggleChat = () => {
45
+ const ToggleChat = ({ isFullScreen = false }) => {
46
46
  const { elements } = useRoomLayoutConferencingScreen();
47
47
  const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
48
48
  const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
@@ -51,7 +51,10 @@ const ToggleChat = () => {
51
51
  const hmsActions = useHMSActions();
52
52
 
53
53
  useEffect(() => {
54
- match({ sidepane, isMobile, showChat })
54
+ match({ sidepane, isMobile, showChat, isFullScreen })
55
+ .with({ isFullScreen: true }, () => {
56
+ hmsActions.setAppData(APP_DATA.sidePane, '');
57
+ })
55
58
  .with({ isMobile: true, showChat: true, sidepane: P.when(value => !value) }, () => {
56
59
  toggleChat();
57
60
  })
@@ -61,12 +64,13 @@ const ToggleChat = () => {
61
64
  .otherwise(() => {
62
65
  //do nothing
63
66
  });
64
- }, [sidepane, isMobile, toggleChat, showChat, hmsActions]);
67
+ }, [sidepane, isMobile, toggleChat, showChat, hmsActions, isFullScreen]);
65
68
  return null;
66
69
  };
67
70
  const HLSView = () => {
68
71
  const videoRef = useRef(null);
69
72
  const hlsViewRef = useRef();
73
+ const { elements } = useRoomLayoutConferencingScreen();
70
74
  const hlsState = useHMSStore(selectHLSState);
71
75
  const enablHlsStats = useHMSStore(selectAppData(APP_DATA.hlsStats));
72
76
  const notification = useHMSNotifications(HMSNotificationTypes.POLL_STOPPED);
@@ -81,7 +85,11 @@ const HLSView = () => {
81
85
  const [hasCaptions, setHasCaptions] = useState(false);
82
86
  const [currentSelectedQuality, setCurrentSelectedQuality] = useState(null);
83
87
  const [isHlsAutoplayBlocked, setIsHlsAutoplayBlocked] = useState(false);
84
- const [isSeekEnabled, setIsSeekEnabled] = useState(false);
88
+ const [hoverControlsVisible, setHoverControlsVisible] = useState({
89
+ seekForward: false,
90
+ pausePlay: false,
91
+ seekBackward: false,
92
+ });
85
93
  const [isPaused, setIsPaused] = useState(false);
86
94
  const [show, toggle] = useToggle(false);
87
95
  const lastHlsUrl = usePrevious(hlsUrl);
@@ -93,6 +101,8 @@ const HLSView = () => {
93
101
  const controlsTimerRef = useRef();
94
102
  const [seekProgress, setSeekProgress] = useState(false);
95
103
  const isFullScreenSupported = screenfull.isEnabled;
104
+ const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
105
+ const showChat = !!elements?.chat;
96
106
 
97
107
  const isMobile = useMedia(config.media.md);
98
108
  const isLandscape = useIsLandscape();
@@ -233,7 +243,19 @@ const HLSView = () => {
233
243
  setIsVideoLive(isLive);
234
244
  };
235
245
 
236
- const playbackEventHandler = data => setIsPaused(data.state === HLSPlaybackState.paused);
246
+ const playbackEventHandler = data => {
247
+ setIsPaused(data.state === HLSPlaybackState.paused);
248
+ setHoverControlsVisible({
249
+ ...hoverControlsVisible,
250
+ pausePlay: true,
251
+ });
252
+ setTimeout(() => {
253
+ setHoverControlsVisible({
254
+ ...hoverControlsVisible,
255
+ pausePlay: false,
256
+ });
257
+ }, 2000);
258
+ };
237
259
  const captionEnabledEventHandler = isCaptionEnabled => {
238
260
  setIsCaptionEnabled(isCaptionEnabled);
239
261
  };
@@ -314,28 +336,63 @@ const HLSView = () => {
314
336
  };
315
337
  }, [controlsVisible, isFullScreen, seekProgress, qualityDropDownOpen]);
316
338
 
317
- const onSeekTo = useCallback(seek => {
318
- hlsPlayer?.seekTo(videoRef.current?.currentTime + seek);
319
- }, []);
339
+ const onSeekTo = useCallback(
340
+ seek => {
341
+ match({ isLandscape, isMobile, seek })
342
+ .with({ seek: -10, isMobile: false, isLandscape: false }, () => {
343
+ setHoverControlsVisible({ ...hoverControlsVisible, seekBackward: true });
344
+ setTimeout(() => {
345
+ setHoverControlsVisible({
346
+ ...hoverControlsVisible,
347
+ seekBackward: false,
348
+ });
349
+ }, 1000);
350
+ })
351
+ .with({ seek: 10, isMobile: false, isLandscape: false }, () => {
352
+ setHoverControlsVisible({ ...hoverControlsVisible, seekForward: true });
353
+ setTimeout(() => {
354
+ setHoverControlsVisible({
355
+ ...hoverControlsVisible,
356
+ seekForward: false,
357
+ });
358
+ }, 1000);
359
+ })
360
+ .otherwise(() => null);
361
+ hlsPlayer?.seekTo(videoRef.current?.currentTime + seek);
362
+ },
363
+ [hoverControlsVisible, isLandscape, isMobile],
364
+ );
320
365
  const onDoubleClickHandler = useCallback(
321
366
  event => {
322
367
  if (!(isMobile || isLandscape) || hlsState?.variants[0]?.playlist_type !== HLSPlaylistType.DVR) {
323
368
  return;
324
369
  }
325
370
  const sidePercentage = (event.screenX * 100) / event.target.clientWidth;
326
- setIsSeekEnabled(true);
327
371
  // there is space for pause/unpause button
328
372
  if (sidePercentage < 45) {
373
+ setHoverControlsVisible({
374
+ ...hoverControlsVisible,
375
+ seekBackward: true,
376
+ });
329
377
  onSeekTo(-10);
330
378
  } else {
379
+ setHoverControlsVisible({
380
+ ...hoverControlsVisible,
381
+ seekForward: true,
382
+ });
331
383
  onSeekTo(10);
332
384
  }
333
385
  setTimeout(() => {
334
- setIsSeekEnabled(false);
335
- }, 200);
386
+ setHoverControlsVisible({
387
+ ...hoverControlsVisible,
388
+ seekForward: false,
389
+ seekBackward: false,
390
+ });
391
+ }, 1000);
336
392
  },
337
- [hlsState?.variants, isLandscape, isMobile, onSeekTo],
393
+ [hlsState?.variants, hoverControlsVisible, isLandscape, isMobile, onSeekTo],
338
394
  );
395
+
339
396
  const onClickHandler = useCallback(async () => {
340
397
  match({ isMobile, isLandscape, playlist_type: hlsState?.variants[0]?.playlist_type })
341
398
  .with({ playlist_type: HLSPlaylistType.DVR, isMobile: false, isLandscape: false }, async () => {
@@ -356,6 +413,7 @@ const HLSView = () => {
356
413
  )
357
414
  .otherwise(() => null);
358
415
  }, [hlsState?.variants, isLandscape, isMobile, isPaused]);
416
+
359
417
  const onHoverHandler = useCallback(
360
418
  event => {
361
419
  event.preventDefault();
@@ -423,6 +481,7 @@ const HLSView = () => {
423
481
  justify="center"
424
482
  css={{
425
483
  flex: isLandscape ? '2 1 0' : '1 1 0',
484
+ transition: 'all 0.3s ease-in-out',
426
485
  '&:fullscreen': {
427
486
  '& video': {
428
487
  height: 'unset !important',
@@ -484,53 +543,37 @@ const HLSView = () => {
484
543
  }}
485
544
  >
486
545
  <>
546
+ {!(isMobile || isLandscape) && (
547
+ <Flex
548
+ align="center"
549
+ justify="between"
550
+ css={{
551
+ position: 'absolute',
552
+ bg: '#00000066',
553
+ display: 'inline-flex',
554
+ gap: '$2',
555
+ zIndex: 1,
556
+ size: '100%',
557
+ }}
558
+ >
559
+ {!showLoader && hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR && (
560
+ <HMSVideoPlayer.PlayPauseSeekControls.Overlay
561
+ isPaused={isPaused}
562
+ showControls={controlsVisible}
563
+ hoverControlsVisible={hoverControlsVisible}
564
+ />
565
+ )}
566
+ </Flex>
567
+ )}
487
568
  {isMobile || isLandscape ? (
488
569
  <>
489
- <Flex
490
- align="center"
491
- justify="center"
492
- css={{
493
- position: 'absolute',
494
- bg: '#00000066',
495
- display: 'inline-flex',
496
- gap: '$2',
497
- zIndex: 1,
498
- size: '100%',
499
- visibility: controlsVisible ? `` : `hidden`,
500
- opacity: controlsVisible ? `1` : '0',
501
- }}
502
- >
503
- {!showLoader && hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR && (
504
- <>
505
- <HMSVideoPlayer.Seeker
506
- title="backward"
507
- css={{
508
- visibility: isSeekEnabled ? `` : `hidden`,
509
- opacity: isSeekEnabled ? `1` : '0',
510
- }}
511
- >
512
- <BackwardArrowIcon width={32} height={32} />
513
- </HMSVideoPlayer.Seeker>
514
- <Box
515
- css={{
516
- bg: 'rgba(0, 0, 0, 0.6)',
517
- r: '$round',
518
- }}
519
- >
520
- <HMSVideoPlayer.PlayPauseButton isPaused={isPaused} width={48} height={48} />
521
- </Box>
522
- <HMSVideoPlayer.Seeker
523
- title="forward"
524
- css={{
525
- visibility: isSeekEnabled ? `` : `hidden`,
526
- opacity: isSeekEnabled ? `1` : '0',
527
- }}
528
- >
529
- <ForwardArrowIcon width={32} height={32} />
530
- </HMSVideoPlayer.Seeker>
531
- </>
532
- )}
533
- </Flex>
570
+ {!showLoader && hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR && (
571
+ <HMSVideoPlayer.PlayPauseSeekControls.Overlay
572
+ isPaused={isPaused}
573
+ showControls={controlsVisible}
574
+ hoverControlsVisible={hoverControlsVisible}
575
+ />
576
+ )}
534
577
  <Flex
535
578
  ref={controlsRef}
536
579
  direction="column"
@@ -553,7 +596,16 @@ const HLSView = () => {
553
596
  }}
554
597
  >
555
598
  <HMSVideoPlayer.Controls.Right>
556
- {isLandscape && <ChatToggle />}
599
+ {(isLandscape || (isMobile && isFullScreen)) && showChat && (
600
+ <ChatToggle
601
+ onClick={() => {
602
+ if (isFullScreen) {
603
+ toggle();
604
+ }
605
+ toggleChat();
606
+ }}
607
+ />
608
+ )}
557
609
  {hasCaptions && !isHlsAutoplayBlocked && <HLSCaptionSelector isEnabled={isCaptionEnabled} />}
558
610
  {hlsViewRef.current && availableLayers.length > 0 && !isHlsAutoplayBlocked ? (
559
611
  <HLSQualitySelector
@@ -606,23 +658,7 @@ const HLSView = () => {
606
658
  <>
607
659
  {hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? (
608
660
  <>
609
- <HMSVideoPlayer.Seeker
610
- onClick={() => {
611
- onSeekTo(-10);
612
- }}
613
- title="backward"
614
- >
615
- <BackwardArrowIcon width={20} height={20} />
616
- </HMSVideoPlayer.Seeker>
617
- <HMSVideoPlayer.PlayPauseButton isPaused={isPaused} />
618
- <HMSVideoPlayer.Seeker
619
- onClick={() => {
620
- onSeekTo(10);
621
- }}
622
- title="forward"
623
- >
624
- <ForwardArrowIcon width={20} height={20} />
625
- </HMSVideoPlayer.Seeker>
661
+ <HMSVideoPlayer.PlayPauseSeekControls.Button isPaused={isPaused} onSeekTo={onSeekTo} />
626
662
  {!isVideoLive ? <HMSVideoPlayer.Duration /> : null}
627
663
  </>
628
664
  ) : null}
@@ -631,7 +667,8 @@ const HLSView = () => {
631
667
  )}
632
668
  <IconButton
633
669
  css={{ px: '$2' }}
634
- onClick={async () => {
670
+ onClick={async e => {
671
+ e.stopPropagation();
635
672
  await hlsPlayer?.seekToLivePosition();
636
673
  setIsVideoLive(true);
637
674
  }}
@@ -690,7 +727,7 @@ const HLSView = () => {
690
727
  </HMSVideoPlayer.Root>
691
728
  </Flex>
692
729
  </HMSPlayerContext.Provider>
693
- <ToggleChat />
730
+ <ToggleChat isFullScreen={isFullScreen} />
694
731
  {isMobile && !isFullScreen && <HLSViewTitle />}
695
732
  </Flex>
696
733
  );
@@ -5,14 +5,7 @@ import {
5
5
  HLSLiveStreamingScreen_Elements,
6
6
  } from '@100mslive/types-prebuilt';
7
7
  import { match } from 'ts-pattern';
8
- import {
9
- selectIsConnectedToRoom,
10
- selectLocalPeerRoleName,
11
- selectPeerScreenSharing,
12
- selectWhiteboard,
13
- useHMSActions,
14
- useHMSStore,
15
- } from '@100mslive/react-sdk';
8
+ import { selectIsConnectedToRoom, selectLocalPeerRoleName, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
16
9
  // @ts-ignore: No implicit Any
17
10
  import FullPageProgress from '../components/FullPageProgress';
18
11
  import { GridLayout } from '../components/VideoLayouts/GridLayout';
@@ -24,7 +17,6 @@ import { PDFView } from './PDFView';
24
17
  import SidePane from './SidePane';
25
18
  // @ts-ignore: No implicit Any
26
19
  import { WaitingView } from './WaitingView';
27
- import { WhiteboardView } from './WhiteboardView';
28
20
  import {
29
21
  usePDFConfig,
30
22
  useUrlToEmbed,
@@ -50,8 +42,6 @@ export const VideoStreamingSection = ({
50
42
  }) => {
51
43
  const localPeerRole = useHMSStore(selectLocalPeerRoleName);
52
44
  const isConnected = useHMSStore(selectIsConnectedToRoom);
53
- const peerSharing = useHMSStore(selectPeerScreenSharing);
54
- const isWhiteboardOpen = useHMSStore(selectWhiteboard)?.open;
55
45
 
56
46
  const hmsActions = useHMSActions();
57
47
  const waitingViewerRole = useWaitingViewerRole();
@@ -89,12 +79,6 @@ export const VideoStreamingSection = ({
89
79
  ViewComponent = <PDFView />;
90
80
  } else if (urlToIframe) {
91
81
  ViewComponent = <EmbedView />;
92
- } else if (peerSharing) {
93
- // screen share should take preference over whiteboard
94
- //@ts-ignore
95
- ViewComponent = <GridLayout {...(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid} />;
96
- } else if (isWhiteboardOpen) {
97
- ViewComponent = <WhiteboardView />;
98
82
  } else {
99
83
  //@ts-ignore
100
84
  ViewComponent = <GridLayout {...(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid} />;