@100mslive/roomkit-react 0.3.3-alpha.3 → 0.3.3-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +0 -1
- package/dist/Accordion/index.d.ts +0 -1
- package/dist/{HLSView-BCIIVR2T.js → HLSView-VUANLYLS.js} +166 -331
- package/dist/HLSView-VUANLYLS.js.map +7 -0
- package/dist/IconButton/IconButton.d.ts +1 -1
- package/dist/Modal/Dialog.d.ts +1 -1
- package/dist/Prebuilt/IconButton.d.ts +3 -2
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +1 -3
- package/dist/Prebuilt/components/HMSVideo/PlayPauseButton.d.ts +2 -2
- package/dist/Prebuilt/components/HMSVideo/{SeekControl.d.ts → SeekControls.d.ts} +2 -2
- package/dist/Prebuilt/components/HMSVideo/index.d.ts +11 -15
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2 -2
- package/dist/Prebuilt/components/RaiseHand.d.ts +1 -1
- package/dist/Prebuilt/layouts/WhiteboardView.d.ts +2 -0
- package/dist/Sheet/Sheet.d.ts +1 -1
- package/dist/{chunk-W47ZJGSD.js → chunk-5WTUTVRO.js} +540 -617
- package/dist/chunk-5WTUTVRO.js.map +7 -0
- package/dist/index.cjs.js +1426 -1686
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +169 -248
- package/dist/meta.esbuild.json +180 -260
- package/package.json +7 -7
- package/src/Accordion/Accordion.tsx +4 -4
- package/src/IconButton/IconButton.tsx +7 -2
- package/src/Prebuilt/IconButton.tsx +10 -6
- package/src/Prebuilt/components/Chat/ChatBody.tsx +0 -10
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +4 -2
- package/src/Prebuilt/components/ConferenceScreen.tsx +4 -1
- package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -2
- package/src/Prebuilt/components/Footer/Footer.tsx +4 -1
- package/src/Prebuilt/components/Footer/ParticipantList.tsx +1 -4
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +6 -6
- package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +3 -17
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +0 -1
- package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +2 -2
- package/src/Prebuilt/components/HMSVideo/{SeekControl.tsx → SeekControls.tsx} +2 -2
- package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +3 -7
- package/src/Prebuilt/components/HMSVideo/index.ts +4 -5
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +7 -7
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +1 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +5 -1
- package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +1 -0
- package/src/Prebuilt/components/RaiseHand.tsx +1 -7
- package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +1 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +4 -27
- package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +5 -13
- package/src/Prebuilt/components/hooks/{useMetadata.tsx → useMetadata.jsx} +8 -2
- package/src/Prebuilt/layouts/HLSView.jsx +78 -115
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +17 -1
- package/src/Prebuilt/layouts/WhiteboardView.tsx +69 -0
- package/dist/HLSView-BCIIVR2T.js.map +0 -7
- package/dist/Prebuilt/components/HMSVideo/PlayPauseSeekControls.d.ts +0 -14
- package/dist/Prebuilt/components/VideoLayouts/WhiteboardLayout.d.ts +0 -3
- package/dist/Prebuilt/components/hooks/useMetadata.d.ts +0 -8
- package/dist/chunk-W47ZJGSD.js.map +0 -7
- package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +0 -158
- package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +0 -95
@@ -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
|
18
|
+
const update = async updatedFields => {
|
19
19
|
try {
|
20
20
|
// get current state from store and merge updated fields
|
21
21
|
const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));
|
@@ -24,7 +24,6 @@ export const useMyMetadata = () => {
|
|
24
24
|
} catch (error) {
|
25
25
|
console.error('failed to update metadata ', updatedFields);
|
26
26
|
}
|
27
|
-
return false;
|
28
27
|
};
|
29
28
|
|
30
29
|
const toggleHandRaise = useCallback(async () => {
|
@@ -44,6 +43,12 @@ export const useMyMetadata = () => {
|
|
44
43
|
}
|
45
44
|
}, [metaData?.isBRBOn]); //eslint-disable-line
|
46
45
|
|
46
|
+
const setPrevRole = async role => {
|
47
|
+
await update({
|
48
|
+
prevRole: role,
|
49
|
+
});
|
50
|
+
};
|
51
|
+
|
47
52
|
return {
|
48
53
|
isHandRaised,
|
49
54
|
isBRBOn: !!metaData?.isBRBOn,
|
@@ -51,5 +56,6 @@ export const useMyMetadata = () => {
|
|
51
56
|
updateMetaData: update,
|
52
57
|
toggleHandRaise,
|
53
58
|
toggleBRB,
|
59
|
+
setPrevRole,
|
54
60
|
};
|
55
61
|
};
|
@@ -15,7 +15,7 @@ import {
|
|
15
15
|
useHMSStore,
|
16
16
|
useHMSVanillaStore,
|
17
17
|
} from '@100mslive/react-sdk';
|
18
|
-
import { ColoredHandIcon, GoLiveIcon } from '@100mslive/react-icons';
|
18
|
+
import { BackwardArrowIcon, ColoredHandIcon, ForwardArrowIcon, 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 = () => {
|
46
46
|
const { elements } = useRoomLayoutConferencingScreen();
|
47
47
|
const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
|
48
48
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
@@ -51,10 +51,7 @@ const ToggleChat = ({ isFullScreen = false }) => {
|
|
51
51
|
const hmsActions = useHMSActions();
|
52
52
|
|
53
53
|
useEffect(() => {
|
54
|
-
match({ sidepane, isMobile, showChat
|
55
|
-
.with({ isFullScreen: true }, () => {
|
56
|
-
hmsActions.setAppData(APP_DATA.sidePane, '');
|
57
|
-
})
|
54
|
+
match({ sidepane, isMobile, showChat })
|
58
55
|
.with({ isMobile: true, showChat: true, sidepane: P.when(value => !value) }, () => {
|
59
56
|
toggleChat();
|
60
57
|
})
|
@@ -64,13 +61,12 @@ const ToggleChat = ({ isFullScreen = false }) => {
|
|
64
61
|
.otherwise(() => {
|
65
62
|
//do nothing
|
66
63
|
});
|
67
|
-
}, [sidepane, isMobile, toggleChat, showChat, hmsActions
|
64
|
+
}, [sidepane, isMobile, toggleChat, showChat, hmsActions]);
|
68
65
|
return null;
|
69
66
|
};
|
70
67
|
const HLSView = () => {
|
71
68
|
const videoRef = useRef(null);
|
72
69
|
const hlsViewRef = useRef();
|
73
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
74
70
|
const hlsState = useHMSStore(selectHLSState);
|
75
71
|
const enablHlsStats = useHMSStore(selectAppData(APP_DATA.hlsStats));
|
76
72
|
const notification = useHMSNotifications(HMSNotificationTypes.POLL_STOPPED);
|
@@ -85,11 +81,7 @@ const HLSView = () => {
|
|
85
81
|
const [hasCaptions, setHasCaptions] = useState(false);
|
86
82
|
const [currentSelectedQuality, setCurrentSelectedQuality] = useState(null);
|
87
83
|
const [isHlsAutoplayBlocked, setIsHlsAutoplayBlocked] = useState(false);
|
88
|
-
const [
|
89
|
-
seekForward: false,
|
90
|
-
pausePlay: false,
|
91
|
-
seekBackward: false,
|
92
|
-
});
|
84
|
+
const [isSeekEnabled, setIsSeekEnabled] = useState(false);
|
93
85
|
const [isPaused, setIsPaused] = useState(false);
|
94
86
|
const [show, toggle] = useToggle(false);
|
95
87
|
const lastHlsUrl = usePrevious(hlsUrl);
|
@@ -101,8 +93,6 @@ const HLSView = () => {
|
|
101
93
|
const controlsTimerRef = useRef();
|
102
94
|
const [seekProgress, setSeekProgress] = useState(false);
|
103
95
|
const isFullScreenSupported = screenfull.isEnabled;
|
104
|
-
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
105
|
-
const showChat = !!elements?.chat;
|
106
96
|
|
107
97
|
const isMobile = useMedia(config.media.md);
|
108
98
|
const isLandscape = useIsLandscape();
|
@@ -243,19 +233,7 @@ const HLSView = () => {
|
|
243
233
|
setIsVideoLive(isLive);
|
244
234
|
};
|
245
235
|
|
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
|
-
};
|
236
|
+
const playbackEventHandler = data => setIsPaused(data.state === HLSPlaybackState.paused);
|
259
237
|
const captionEnabledEventHandler = isCaptionEnabled => {
|
260
238
|
setIsCaptionEnabled(isCaptionEnabled);
|
261
239
|
};
|
@@ -336,63 +314,28 @@ const HLSView = () => {
|
|
336
314
|
};
|
337
315
|
}, [controlsVisible, isFullScreen, seekProgress, qualityDropDownOpen]);
|
338
316
|
|
339
|
-
const onSeekTo = useCallback(
|
340
|
-
|
341
|
-
|
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
|
-
);
|
317
|
+
const onSeekTo = useCallback(seek => {
|
318
|
+
hlsPlayer?.seekTo(videoRef.current?.currentTime + seek);
|
319
|
+
}, []);
|
365
320
|
const onDoubleClickHandler = useCallback(
|
366
321
|
event => {
|
367
322
|
if (!(isMobile || isLandscape) || hlsState?.variants[0]?.playlist_type !== HLSPlaylistType.DVR) {
|
368
323
|
return;
|
369
324
|
}
|
370
325
|
const sidePercentage = (event.screenX * 100) / event.target.clientWidth;
|
326
|
+
setIsSeekEnabled(true);
|
371
327
|
// there is space for pause/unpause button
|
372
328
|
if (sidePercentage < 45) {
|
373
|
-
setHoverControlsVisible({
|
374
|
-
...hoverControlsVisible,
|
375
|
-
seekBackward: true,
|
376
|
-
});
|
377
329
|
onSeekTo(-10);
|
378
330
|
} else {
|
379
|
-
setHoverControlsVisible({
|
380
|
-
...hoverControlsVisible,
|
381
|
-
seekForward: true,
|
382
|
-
});
|
383
331
|
onSeekTo(10);
|
384
332
|
}
|
385
333
|
setTimeout(() => {
|
386
|
-
|
387
|
-
|
388
|
-
seekForward: false,
|
389
|
-
seekBackward: false,
|
390
|
-
});
|
391
|
-
}, 1000);
|
334
|
+
setIsSeekEnabled(false);
|
335
|
+
}, 200);
|
392
336
|
},
|
393
|
-
[hlsState?.variants,
|
337
|
+
[hlsState?.variants, isLandscape, isMobile, onSeekTo],
|
394
338
|
);
|
395
|
-
|
396
339
|
const onClickHandler = useCallback(async () => {
|
397
340
|
match({ isMobile, isLandscape, playlist_type: hlsState?.variants[0]?.playlist_type })
|
398
341
|
.with({ playlist_type: HLSPlaylistType.DVR, isMobile: false, isLandscape: false }, async () => {
|
@@ -413,7 +356,6 @@ const HLSView = () => {
|
|
413
356
|
)
|
414
357
|
.otherwise(() => null);
|
415
358
|
}, [hlsState?.variants, isLandscape, isMobile, isPaused]);
|
416
|
-
|
417
359
|
const onHoverHandler = useCallback(
|
418
360
|
event => {
|
419
361
|
event.preventDefault();
|
@@ -481,7 +423,6 @@ const HLSView = () => {
|
|
481
423
|
justify="center"
|
482
424
|
css={{
|
483
425
|
flex: isLandscape ? '2 1 0' : '1 1 0',
|
484
|
-
transition: 'all 0.3s ease-in-out',
|
485
426
|
'&:fullscreen': {
|
486
427
|
'& video': {
|
487
428
|
height: 'unset !important',
|
@@ -543,37 +484,53 @@ const HLSView = () => {
|
|
543
484
|
}}
|
544
485
|
>
|
545
486
|
<>
|
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
|
-
)}
|
568
487
|
{isMobile || isLandscape ? (
|
569
488
|
<>
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
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>
|
577
534
|
<Flex
|
578
535
|
ref={controlsRef}
|
579
536
|
direction="column"
|
@@ -596,16 +553,7 @@ const HLSView = () => {
|
|
596
553
|
}}
|
597
554
|
>
|
598
555
|
<HMSVideoPlayer.Controls.Right>
|
599
|
-
{
|
600
|
-
<ChatToggle
|
601
|
-
onClick={() => {
|
602
|
-
if (isFullScreen) {
|
603
|
-
toggle();
|
604
|
-
}
|
605
|
-
toggleChat();
|
606
|
-
}}
|
607
|
-
/>
|
608
|
-
)}
|
556
|
+
{isLandscape && <ChatToggle />}
|
609
557
|
{hasCaptions && !isHlsAutoplayBlocked && <HLSCaptionSelector isEnabled={isCaptionEnabled} />}
|
610
558
|
{hlsViewRef.current && availableLayers.length > 0 && !isHlsAutoplayBlocked ? (
|
611
559
|
<HLSQualitySelector
|
@@ -658,7 +606,23 @@ const HLSView = () => {
|
|
658
606
|
<>
|
659
607
|
{hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? (
|
660
608
|
<>
|
661
|
-
<HMSVideoPlayer.
|
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>
|
662
626
|
{!isVideoLive ? <HMSVideoPlayer.Duration /> : null}
|
663
627
|
</>
|
664
628
|
) : null}
|
@@ -667,8 +631,7 @@ const HLSView = () => {
|
|
667
631
|
)}
|
668
632
|
<IconButton
|
669
633
|
css={{ px: '$2' }}
|
670
|
-
onClick={async
|
671
|
-
e.stopPropagation();
|
634
|
+
onClick={async () => {
|
672
635
|
await hlsPlayer?.seekToLivePosition();
|
673
636
|
setIsVideoLive(true);
|
674
637
|
}}
|
@@ -727,7 +690,7 @@ const HLSView = () => {
|
|
727
690
|
</HMSVideoPlayer.Root>
|
728
691
|
</Flex>
|
729
692
|
</HMSPlayerContext.Provider>
|
730
|
-
<ToggleChat
|
693
|
+
<ToggleChat />
|
731
694
|
{isMobile && !isFullScreen && <HLSViewTitle />}
|
732
695
|
</Flex>
|
733
696
|
);
|
@@ -5,7 +5,14 @@ import {
|
|
5
5
|
HLSLiveStreamingScreen_Elements,
|
6
6
|
} from '@100mslive/types-prebuilt';
|
7
7
|
import { match } from 'ts-pattern';
|
8
|
-
import {
|
8
|
+
import {
|
9
|
+
selectIsConnectedToRoom,
|
10
|
+
selectLocalPeerRoleName,
|
11
|
+
selectPeerScreenSharing,
|
12
|
+
selectWhiteboard,
|
13
|
+
useHMSActions,
|
14
|
+
useHMSStore,
|
15
|
+
} from '@100mslive/react-sdk';
|
9
16
|
// @ts-ignore: No implicit Any
|
10
17
|
import FullPageProgress from '../components/FullPageProgress';
|
11
18
|
import { GridLayout } from '../components/VideoLayouts/GridLayout';
|
@@ -17,6 +24,7 @@ import { PDFView } from './PDFView';
|
|
17
24
|
import SidePane from './SidePane';
|
18
25
|
// @ts-ignore: No implicit Any
|
19
26
|
import { WaitingView } from './WaitingView';
|
27
|
+
import { WhiteboardView } from './WhiteboardView';
|
20
28
|
import {
|
21
29
|
usePDFConfig,
|
22
30
|
useUrlToEmbed,
|
@@ -42,6 +50,8 @@ export const VideoStreamingSection = ({
|
|
42
50
|
}) => {
|
43
51
|
const localPeerRole = useHMSStore(selectLocalPeerRoleName);
|
44
52
|
const isConnected = useHMSStore(selectIsConnectedToRoom);
|
53
|
+
const peerSharing = useHMSStore(selectPeerScreenSharing);
|
54
|
+
const isWhiteboardOpen = useHMSStore(selectWhiteboard)?.open;
|
45
55
|
|
46
56
|
const hmsActions = useHMSActions();
|
47
57
|
const waitingViewerRole = useWaitingViewerRole();
|
@@ -79,6 +89,12 @@ export const VideoStreamingSection = ({
|
|
79
89
|
ViewComponent = <PDFView />;
|
80
90
|
} else if (urlToIframe) {
|
81
91
|
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 />;
|
82
98
|
} else {
|
83
99
|
//@ts-ignore
|
84
100
|
ViewComponent = <GridLayout {...(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid} />;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React, { useEffect, useMemo } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
3
|
+
import { selectPeers, selectWhiteboard, useHMSStore, useWhiteboard } from '@100mslive/react-sdk';
|
4
|
+
import { SecondaryTiles } from '../components/SecondaryTiles';
|
5
|
+
import { ProminenceLayout } from '../components/VideoLayouts/ProminenceLayout';
|
6
|
+
import { config as cssConfig } from '../../';
|
7
|
+
import { Box } from '../../Layout';
|
8
|
+
// @ts-ignore: No implicit Any
|
9
|
+
import { useSetAppDataByKey } from '../components/AppData/useUISettings';
|
10
|
+
import { APP_DATA } from '../common/constants';
|
11
|
+
|
12
|
+
const EmbedComponent = () => {
|
13
|
+
const isMobile = useMedia(cssConfig.media.md);
|
14
|
+
const { iframeRef } = useWhiteboard(isMobile);
|
15
|
+
|
16
|
+
return (
|
17
|
+
<Box
|
18
|
+
css={{
|
19
|
+
mx: '$8',
|
20
|
+
flex: '3 1 0',
|
21
|
+
'@lg': {
|
22
|
+
flex: '2 1 0',
|
23
|
+
display: 'flex',
|
24
|
+
alignItems: 'center',
|
25
|
+
},
|
26
|
+
}}
|
27
|
+
>
|
28
|
+
<iframe
|
29
|
+
title="Whiteboard View"
|
30
|
+
ref={iframeRef}
|
31
|
+
style={{
|
32
|
+
width: '100%',
|
33
|
+
height: '100%',
|
34
|
+
border: 0,
|
35
|
+
borderRadius: '0.75rem',
|
36
|
+
}}
|
37
|
+
allow="autoplay; clipboard-write;"
|
38
|
+
referrerPolicy="no-referrer"
|
39
|
+
/>
|
40
|
+
</Box>
|
41
|
+
);
|
42
|
+
};
|
43
|
+
|
44
|
+
export const WhiteboardView = () => {
|
45
|
+
const peers = useHMSStore(selectPeers);
|
46
|
+
const whiteboard = useHMSStore(selectWhiteboard);
|
47
|
+
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
48
|
+
|
49
|
+
const smallTilePeers = useMemo(() => {
|
50
|
+
const smallTilePeers = peers.filter(peer => peer.id !== whiteboard?.owner);
|
51
|
+
return smallTilePeers;
|
52
|
+
}, [peers, whiteboard?.owner]);
|
53
|
+
|
54
|
+
useEffect(() => {
|
55
|
+
setActiveScreenSharePeer(whiteboard?.owner || '');
|
56
|
+
return () => {
|
57
|
+
setActiveScreenSharePeer('');
|
58
|
+
};
|
59
|
+
}, [whiteboard?.owner, setActiveScreenSharePeer]);
|
60
|
+
|
61
|
+
return (
|
62
|
+
<ProminenceLayout.Root>
|
63
|
+
<ProminenceLayout.ProminentSection>
|
64
|
+
<EmbedComponent />
|
65
|
+
</ProminenceLayout.ProminentSection>
|
66
|
+
<SecondaryTiles peers={smallTilePeers} />
|
67
|
+
</ProminenceLayout.Root>
|
68
|
+
);
|
69
|
+
};
|