@100mslive/roomkit-react 0.3.3-alpha.0 → 0.3.3-alpha.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/dist/Accordion/Accordion.d.ts +1 -0
  2. package/dist/Accordion/index.d.ts +1 -0
  3. package/dist/{HLSView-NVF25XHT.js → HLSView-SYFDABFO.js} +331 -166
  4. package/dist/HLSView-SYFDABFO.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/VideoLayouts/WhiteboardLayout.d.ts +3 -0
  15. package/dist/Sheet/Sheet.d.ts +1 -1
  16. package/dist/{chunk-2V7F62FX.js → chunk-HIJ2DH6Q.js} +423 -404
  17. package/dist/chunk-HIJ2DH6Q.js.map +7 -0
  18. package/dist/index.cjs.js +1130 -931
  19. package/dist/index.cjs.js.map +4 -4
  20. package/dist/index.js +1 -1
  21. package/dist/meta.cjs.json +208 -124
  22. package/dist/meta.esbuild.json +222 -137
  23. package/package.json +7 -7
  24. package/src/Accordion/Accordion.tsx +4 -4
  25. package/src/IconButton/IconButton.tsx +2 -7
  26. package/src/Prebuilt/IconButton.tsx +6 -10
  27. package/src/Prebuilt/components/Chat/ChatBody.tsx +10 -0
  28. package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -2
  29. package/src/Prebuilt/components/Footer/ParticipantList.tsx +4 -1
  30. package/src/Prebuilt/components/Footer/RoleAccordion.tsx +6 -6
  31. package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +17 -3
  32. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +1 -0
  33. package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +2 -2
  34. package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +158 -0
  35. package/src/Prebuilt/components/HMSVideo/{SeekControls.tsx → SeekControl.tsx} +2 -2
  36. package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +7 -3
  37. package/src/Prebuilt/components/HMSVideo/index.ts +5 -4
  38. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +9 -9
  39. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +27 -4
  40. package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +95 -0
  41. package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +13 -5
  42. package/src/Prebuilt/layouts/HLSView.jsx +115 -78
  43. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +1 -17
  44. package/dist/HLSView-NVF25XHT.js.map +0 -7
  45. package/dist/Prebuilt/layouts/WhiteboardView.d.ts +0 -2
  46. package/dist/chunk-2V7F62FX.js.map +0 -7
  47. package/src/Prebuilt/layouts/WhiteboardView.tsx +0 -69
@@ -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 @@ 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} />;