@100mslive/roomkit-react 0.1.8-alpha.0 → 0.1.9-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-IQRPLYNH.js → HLSView-U53QN3AC.js} +3 -3
- package/dist/Modal/Dialog.d.ts +402 -1706
- package/dist/Prebuilt/App.d.ts +6 -0
- package/dist/Prebuilt/AppContext.d.ts +2 -0
- package/dist/Prebuilt/AppStateContext.d.ts +16 -0
- package/dist/Prebuilt/components/ConferenceScreen.d.ts +2 -0
- package/dist/Prebuilt/components/Footer/PaginatedParticipants.d.ts +5 -0
- package/dist/Prebuilt/components/Footer/PollsToggle.d.ts +2 -0
- package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +10 -3
- package/dist/Prebuilt/components/LeaveScreen.d.ts +2 -0
- package/dist/Prebuilt/components/MwebLandscapePrompt.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/AutoplayBlockedModal.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/HLSFailureModal.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/InitErrorModal.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/Notifications.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/PeerNotifications.d.ts +1 -0
- package/dist/Prebuilt/components/Notifications/PermissionErrorModal.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/ReconnectNotifications.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/TrackBulkUnmuteModal.d.ts +2 -0
- package/dist/Prebuilt/components/Notifications/TrackNotifications.d.ts +1 -0
- package/dist/Prebuilt/components/Notifications/TrackUnmuteModal.d.ts +2 -0
- package/dist/Prebuilt/components/Polls/Polls.d.ts +2 -0
- package/dist/Prebuilt/components/Preview/PreviewJoin.d.ts +1 -2
- package/dist/Prebuilt/components/Preview/PreviewScreen.d.ts +2 -0
- package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +1 -1
- package/dist/{VirtualBackground-GP4ATXD3.js → VirtualBackground-PMLQPJB6.js} +3 -5
- package/dist/{VirtualBackground-GP4ATXD3.js.map → VirtualBackground-PMLQPJB6.js.map} +1 -1
- package/dist/chunk-ANQRGVIX.js +14441 -0
- package/dist/chunk-ANQRGVIX.js.map +7 -0
- package/dist/{chunk-Z3O2WGWV.js → chunk-XQ2NRKIW.js} +66 -3
- package/dist/chunk-XQ2NRKIW.js.map +7 -0
- package/dist/context/DialogContext.d.ts +6 -0
- package/dist/hooks/useDialogContainerSelector.d.ts +1 -0
- package/dist/index.cjs.js +10956 -9818
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -2
- package/dist/meta.cjs.json +4076 -3201
- package/dist/meta.esbuild.json +4391 -3623
- package/dist/utils/animations.d.ts +11 -0
- package/package.json +6 -7
- package/src/AudioLevel/AudioLevel.tsx +1 -1
- package/src/Modal/Dialog.tsx +31 -3
- package/src/Prebuilt/App.tsx +49 -97
- package/src/Prebuilt/AppContext.tsx +6 -0
- package/src/Prebuilt/AppStateContext.tsx +71 -0
- package/src/Prebuilt/common/constants.js +36 -1
- package/src/Prebuilt/common/utils.js +47 -0
- package/src/Prebuilt/components/AppData/AppData.jsx +6 -1
- package/src/Prebuilt/components/AppData/useSidepane.js +23 -1
- package/src/Prebuilt/components/AppData/useUISettings.js +49 -5
- package/src/Prebuilt/components/Chip.tsx +6 -2
- package/src/Prebuilt/components/{conference.jsx → ConferenceScreen.tsx} +34 -46
- package/src/Prebuilt/components/Footer/Footer.tsx +5 -0
- package/src/Prebuilt/components/Footer/PaginatedParticipants.tsx +125 -0
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +55 -24
- package/src/Prebuilt/components/Footer/PollsToggle.tsx +22 -0
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +87 -85
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +1 -1
- package/src/Prebuilt/components/Header/StreamActions.tsx +5 -3
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +4 -5
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +0 -4
- package/src/Prebuilt/components/{PostLeave.jsx → LeaveScreen.tsx} +6 -13
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +2 -3
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +2 -3
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +18 -1
- package/src/Prebuilt/components/{MwebLandscapePrompt.jsx → MwebLandscapePrompt.tsx} +10 -11
- package/src/Prebuilt/components/Notifications/{AutoplayBlockedModal.jsx → AutoplayBlockedModal.tsx} +2 -1
- package/src/Prebuilt/components/Notifications/{HLSFailureModal.jsx → HLSFailureModal.tsx} +10 -8
- package/src/Prebuilt/components/Notifications/{InitErrorModal.jsx → InitErrorModal.tsx} +5 -2
- package/src/Prebuilt/components/Notifications/{Notifications.jsx → Notifications.tsx} +41 -27
- package/src/Prebuilt/components/Notifications/{PeerNotifications.jsx → PeerNotifications.tsx} +3 -0
- package/src/Prebuilt/components/Notifications/{PermissionErrorModal.jsx → PermissionErrorModal.tsx} +6 -4
- package/src/Prebuilt/components/Notifications/{ReconnectNotifications.jsx → ReconnectNotifications.tsx} +11 -6
- package/src/Prebuilt/components/Notifications/{TrackBulkUnmuteModal.jsx → TrackBulkUnmuteModal.tsx} +9 -3
- package/src/Prebuilt/components/Notifications/{TrackUnmuteModal.jsx → TrackUnmuteModal.tsx} +9 -3
- package/src/Prebuilt/components/Notifications/index.tsx +1 -0
- package/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.jsx +229 -0
- package/src/Prebuilt/components/Polls/CreatePollQuiz/Timer.jsx +71 -0
- package/src/Prebuilt/components/Polls/CreateQuestions/CreateQuestions.jsx +132 -0
- package/src/Prebuilt/components/Polls/CreateQuestions/DeleteQuestionModal.jsx +66 -0
- package/src/Prebuilt/components/Polls/CreateQuestions/QuestionForm.jsx +251 -0
- package/src/Prebuilt/components/Polls/CreateQuestions/SavedQuestion.jsx +57 -0
- package/src/Prebuilt/components/Polls/Polls.tsx +28 -0
- package/src/Prebuilt/components/Polls/Voting/PollResultSummary.jsx +125 -0
- package/src/Prebuilt/components/Polls/Voting/QuestionCard.jsx +249 -0
- package/src/Prebuilt/components/Polls/Voting/StandardVoting.jsx +40 -0
- package/src/Prebuilt/components/Polls/Voting/TimedVoting.jsx +36 -0
- package/src/Prebuilt/components/Polls/Voting/Voting.jsx +99 -0
- package/src/Prebuilt/components/Polls/common/MultipleChoiceOptions.jsx +101 -0
- package/src/Prebuilt/components/Polls/common/OptionInputWithDelete.jsx +25 -0
- package/src/Prebuilt/components/Polls/common/SingleChoiceOptions.jsx +125 -0
- package/src/Prebuilt/components/Polls/common/StatusIndicator.jsx +47 -0
- package/src/Prebuilt/components/Polls/common/VoteCount.jsx +28 -0
- package/src/Prebuilt/components/Polls/common/VoteProgress.jsx +17 -0
- package/src/Prebuilt/components/Polls/common/VoterList.jsx +22 -0
- package/src/Prebuilt/components/Polls/common/Votes.jsx +72 -0
- package/src/Prebuilt/components/Preview/PreviewForm.tsx +3 -2
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +29 -21
- package/src/Prebuilt/components/Preview/{PreviewContainer.tsx → PreviewScreen.tsx} +2 -19
- package/src/Prebuilt/components/RaiseHand.jsx +1 -1
- package/src/Prebuilt/components/RoleChangeModal.jsx +2 -3
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +2 -3
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +2 -3
- package/src/Prebuilt/components/Settings/StartRecording.jsx +15 -4
- package/src/Prebuilt/components/SidePaneTabs.tsx +32 -6
- package/src/Prebuilt/components/StatsForNerds.jsx +2 -3
- package/src/Prebuilt/components/Streaming/Common.jsx +31 -21
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +8 -9
- package/src/Prebuilt/components/VideoTile.jsx +28 -39
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +3 -3
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +1 -1
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +9 -17
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +2 -3
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +1 -1
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -3
- package/src/Prebuilt/layouts/EmbedView.jsx +47 -60
- package/src/Prebuilt/layouts/PDFView.jsx +49 -99
- package/src/Prebuilt/layouts/SidePane.tsx +9 -4
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +2 -2
- package/src/Prebuilt/primitives/DialogContent.jsx +4 -5
- package/src/context/DialogContext.tsx +13 -0
- package/src/hooks/useDialogContainerSelector.tsx +7 -0
- package/src/index.ts +1 -0
- package/src/utils/animations.ts +6 -0
- package/dist/Prebuilt/components/PrebuiltDialogPortal.d.ts +0 -4
- package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +0 -3
- package/dist/chunk-2H5NIZB7.js +0 -70
- package/dist/chunk-2H5NIZB7.js.map +0 -7
- package/dist/chunk-GLYGPYNS.js +0 -7125
- package/dist/chunk-GLYGPYNS.js.map +0 -7
- package/dist/chunk-Z3O2WGWV.js.map +0 -7
- package/dist/conference-JD35TNH4.js +0 -6503
- package/dist/conference-JD35TNH4.js.map +0 -7
- package/src/Prebuilt/components/GoLiveButton.jsx +0 -42
- package/src/Prebuilt/components/PrebuiltDialogPortal.tsx +0 -6
- package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +0 -220
- package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +0 -334
- package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +0 -76
- /package/dist/{HLSView-IQRPLYNH.js.map → HLSView-U53QN3AC.js.map} +0 -0
- /package/{src/Prebuilt/components/Notifications/index.jsx → dist/Prebuilt/components/Notifications/index.d.ts} +0 -0
- /package/src/Prebuilt/components/Notifications/{TrackNotifications.jsx → TrackNotifications.tsx} +0 -0
@@ -1,30 +1,30 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useEffect } from 'react';
|
2
2
|
import { useMeasure } from 'react-use';
|
3
3
|
import { FixedSizeList } from 'react-window';
|
4
|
-
import { HMSPeer,
|
5
|
-
import {
|
4
|
+
import { HMSPeer, selectIsLargeRoom, useHMSStore, usePaginatedParticipants } from '@100mslive/react-sdk';
|
5
|
+
import { ChevronRightIcon } from '@100mslive/react-icons';
|
6
6
|
import { Accordion } from '../../../Accordion';
|
7
|
-
import {
|
7
|
+
import { Flex } from '../../../Layout';
|
8
8
|
import { Text } from '../../../Text';
|
9
|
-
import Chip from '../Chip';
|
10
9
|
// @ts-ignore: No implicit Any
|
11
10
|
import { Participant } from './ParticipantList';
|
12
11
|
import { RoleOptions } from './RoleOptions';
|
13
12
|
// @ts-ignore: No implicit Any
|
14
13
|
import { getFormattedCount } from '../../common/utils';
|
15
14
|
|
16
|
-
const ROW_HEIGHT = 50;
|
15
|
+
export const ROW_HEIGHT = 50;
|
16
|
+
const ITER_TIMER = 5000;
|
17
17
|
|
18
|
-
interface ItemData {
|
18
|
+
export interface ItemData {
|
19
19
|
peerList: HMSPeer[];
|
20
20
|
isConnected: boolean;
|
21
21
|
}
|
22
22
|
|
23
|
-
function itemKey(index: number, data: ItemData) {
|
24
|
-
return data.peerList[index]
|
23
|
+
export function itemKey(index: number, data: ItemData) {
|
24
|
+
return data.peerList[index]?.id;
|
25
25
|
}
|
26
26
|
|
27
|
-
const VirtualizedParticipantItem = React.memo(({ index, data }: { index: number; data: ItemData }) => {
|
27
|
+
export const VirtualizedParticipantItem = React.memo(({ index, data }: { index: number; data: ItemData }) => {
|
28
28
|
return <Participant key={data.peerList[index].id} peer={data.peerList[index]} isConnected={data.isConnected} />;
|
29
29
|
});
|
30
30
|
|
@@ -34,101 +34,103 @@ export const RoleAccordion = ({
|
|
34
34
|
isConnected,
|
35
35
|
filter,
|
36
36
|
isHandRaisedAccordion = false,
|
37
|
+
offStageRoles,
|
38
|
+
onActive,
|
37
39
|
}: ItemData & {
|
38
40
|
roleName: string;
|
39
41
|
isHandRaisedAccordion?: boolean;
|
40
42
|
filter?: { search: string };
|
43
|
+
offStageRoles: string[];
|
44
|
+
onActive?: (role: string) => void;
|
41
45
|
}) => {
|
42
46
|
const [ref, { width }] = useMeasure<HTMLDivElement>();
|
43
|
-
const actions = useHMSActions();
|
44
47
|
const showAcordion = filter?.search ? peerList.some(peer => peer.name.toLowerCase().includes(filter.search)) : true;
|
45
|
-
const
|
46
|
-
const
|
48
|
+
const isLargeRoom = useHMSStore(selectIsLargeRoom);
|
49
|
+
const { peers, total, loadPeers } = usePaginatedParticipants({ role: roleName, limit: 10 });
|
50
|
+
const isOffStageRole = roleName && offStageRoles.includes(roleName);
|
47
51
|
|
48
|
-
|
49
|
-
if (!
|
52
|
+
useEffect(() => {
|
53
|
+
if (!isOffStageRole || !isLargeRoom) {
|
50
54
|
return;
|
51
55
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
.finally(() => {
|
59
|
-
setHasNext(iteratorRef.current ? iteratorRef.current.hasNext() : false);
|
60
|
-
});
|
61
|
-
}, [actions, roleName]);
|
62
|
-
|
63
|
-
useEffect(() => {
|
64
|
-
loadNext();
|
65
|
-
}, [loadNext]);
|
56
|
+
loadPeers();
|
57
|
+
const interval = setInterval(() => {
|
58
|
+
loadPeers();
|
59
|
+
}, ITER_TIMER);
|
60
|
+
return () => clearInterval(interval);
|
61
|
+
}, [isOffStageRole, isLargeRoom]); //eslint-disable-line
|
66
62
|
|
67
63
|
if (!showAcordion || (isHandRaisedAccordion && filter?.search) || (peerList.length === 0 && filter?.search)) {
|
68
64
|
return null;
|
69
65
|
}
|
70
66
|
|
71
|
-
const
|
67
|
+
const peersInAccordion = isOffStageRole && isLargeRoom ? peers : peerList;
|
68
|
+
const height = ROW_HEIGHT * peersInAccordion.length;
|
69
|
+
const hasNext = total > peersInAccordion.length;
|
70
|
+
|
71
|
+
if (peersInAccordion.length === 0) {
|
72
|
+
return null;
|
73
|
+
}
|
72
74
|
|
73
75
|
return (
|
74
|
-
<
|
75
|
-
<Accordion.
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
<Accordion.Item value={roleName} css={{ '&:hover .role_actions': { visibility: 'visible' }, mb: '$8' }} ref={ref}>
|
77
|
+
<Accordion.Header
|
78
|
+
iconStyles={{ c: '$on_surface_high' }}
|
79
|
+
css={{
|
80
|
+
textTransform: 'capitalize',
|
81
|
+
p: '$6 $8',
|
82
|
+
fontSize: '$sm',
|
83
|
+
fontWeight: '$semiBold',
|
84
|
+
c: '$on_surface_medium',
|
85
|
+
borderRadius: '$1',
|
86
|
+
border: '1px solid $border_default',
|
87
|
+
'&[data-state="open"]': {
|
88
|
+
borderBottomLeftRadius: 0,
|
89
|
+
borderBottomRightRadius: 0,
|
90
|
+
},
|
91
|
+
}}
|
80
92
|
>
|
81
|
-
<
|
82
|
-
<
|
83
|
-
|
93
|
+
<Flex justify="between" css={{ flexGrow: 1, pr: '$6' }}>
|
94
|
+
<Text
|
95
|
+
variant="sm"
|
96
|
+
css={{ fontWeight: '$semiBold', textTransform: 'capitalize', color: '$on_surface_medium' }}
|
97
|
+
>
|
98
|
+
{roleName} {`(${getFormattedCount(isLargeRoom && isOffStageRole ? total : peerList.length)})`}
|
99
|
+
</Text>
|
100
|
+
<RoleOptions roleName={roleName} peerList={peersInAccordion} />
|
101
|
+
</Flex>
|
102
|
+
</Accordion.Header>
|
103
|
+
<Accordion.Content contentStyles={{ border: '1px solid $border_default', borderTop: 'none' }}>
|
104
|
+
<FixedSizeList
|
105
|
+
itemSize={ROW_HEIGHT}
|
106
|
+
itemData={{ peerList: peersInAccordion, isConnected }}
|
107
|
+
itemKey={itemKey}
|
108
|
+
itemCount={peersInAccordion.length}
|
109
|
+
width={width}
|
110
|
+
height={height}
|
111
|
+
>
|
112
|
+
{VirtualizedParticipantItem}
|
113
|
+
</FixedSizeList>
|
114
|
+
{offStageRoles?.includes(roleName) && hasNext ? (
|
115
|
+
<Flex
|
116
|
+
align="center"
|
117
|
+
justify="end"
|
84
118
|
css={{
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
119
|
+
gap: '$1',
|
120
|
+
cursor: 'pointer',
|
121
|
+
color: '$on_surface_high',
|
122
|
+
p: '$6',
|
123
|
+
borderTop: '1px solid $border_default',
|
90
124
|
}}
|
125
|
+
onClick={() => onActive?.(roleName)}
|
91
126
|
>
|
92
|
-
<
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
</Flex>
|
101
|
-
</Accordion.Header>
|
102
|
-
<Accordion.Content>
|
103
|
-
<Box css={{ borderTop: '1px solid $border_default' }} />
|
104
|
-
<FixedSizeList
|
105
|
-
itemSize={ROW_HEIGHT}
|
106
|
-
itemData={{ peerList, isConnected }}
|
107
|
-
itemKey={itemKey}
|
108
|
-
itemCount={peerList.length}
|
109
|
-
width={width}
|
110
|
-
height={height}
|
111
|
-
>
|
112
|
-
{VirtualizedParticipantItem}
|
113
|
-
</FixedSizeList>
|
114
|
-
{hasNext ? (
|
115
|
-
<Chip
|
116
|
-
icon={<AddCircleIcon />}
|
117
|
-
content="Load More"
|
118
|
-
onClick={loadNext}
|
119
|
-
backgroundColor="$secondary_default"
|
120
|
-
css={{
|
121
|
-
w: 'max-content',
|
122
|
-
borderRadius: '$size$9',
|
123
|
-
m: '$2 auto',
|
124
|
-
p: '$4',
|
125
|
-
cursor: 'pointer',
|
126
|
-
}}
|
127
|
-
/>
|
128
|
-
) : null}
|
129
|
-
</Accordion.Content>
|
130
|
-
</Accordion.Item>
|
131
|
-
</Accordion.Root>
|
132
|
-
</Flex>
|
127
|
+
<Text variant="sm" css={{ color: 'inherit' }}>
|
128
|
+
View All
|
129
|
+
</Text>
|
130
|
+
<ChevronRightIcon />
|
131
|
+
</Flex>
|
132
|
+
) : null}
|
133
|
+
</Accordion.Content>
|
134
|
+
</Accordion.Item>
|
133
135
|
);
|
134
136
|
};
|
@@ -46,7 +46,7 @@ export const RoleOptions = ({ roleName, peerList }: { roleName: string; peerList
|
|
46
46
|
const canRemoveRoleFromRoom =
|
47
47
|
permissions?.removeOthers && (on_stage_role === roleName || off_stage_roles?.includes(roleName));
|
48
48
|
|
49
|
-
if (!(canMuteRole || canRemoveRoleFromStage || canRemoveRoleFromRoom)) {
|
49
|
+
if (!(canMuteRole || canRemoveRoleFromStage || canRemoveRoleFromRoom) || peerList.length === 0) {
|
50
50
|
return null;
|
51
51
|
}
|
52
52
|
|
@@ -17,6 +17,7 @@ import { Sheet } from '../../../Sheet';
|
|
17
17
|
import { ToastManager } from '../Toast/ToastManager';
|
18
18
|
// @ts-ignore
|
19
19
|
import { AdditionalRoomState, getRecordingText } from './AdditionalRoomState';
|
20
|
+
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
20
21
|
// @ts-ignore
|
21
22
|
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
22
23
|
// @ts-ignore
|
@@ -29,13 +30,14 @@ export const LiveStatus = () => {
|
|
29
30
|
const hlsState = useHMSStore(selectHLSState);
|
30
31
|
const isMobile = useMedia(cssConfig.media.md);
|
31
32
|
const intervalRef = useRef<NodeJS.Timeout | null>(null);
|
32
|
-
|
33
|
+
const { screenType } = useRoomLayoutConferencingScreen();
|
33
34
|
const [liveTime, setLiveTime] = useState(0);
|
34
35
|
|
35
36
|
const startTimer = useCallback(() => {
|
36
37
|
intervalRef.current = setInterval(() => {
|
37
|
-
|
38
|
-
|
38
|
+
const timeStamp = hlsState?.variants[0]?.[screenType === 'hls_live_streaming' ? 'startedAt' : 'initialisedAt'];
|
39
|
+
if (hlsState?.running && timeStamp) {
|
40
|
+
setLiveTime(Date.now() - timeStamp.getTime());
|
39
41
|
}
|
40
42
|
}, 1000);
|
41
43
|
}, [hlsState?.running, hlsState?.variants]);
|
@@ -8,7 +8,6 @@ import { Dropdown } from '../../../Dropdown';
|
|
8
8
|
import { Box, Flex } from '../../../Layout';
|
9
9
|
import { Dialog } from '../../../Modal';
|
10
10
|
import { Tooltip } from '../../../Tooltip';
|
11
|
-
import { PrebuiltDialogPortal } from '../PrebuiltDialogPortal';
|
12
11
|
import { EndSessionContent } from './EndSessionContent';
|
13
12
|
import { LeaveIconButton, MenuTriggerButton } from './LeaveAtoms';
|
14
13
|
import { LeaveCard } from './LeaveCard';
|
@@ -138,7 +137,7 @@ export const DesktopLeaveRoom = ({
|
|
138
137
|
)}
|
139
138
|
|
140
139
|
<Dialog.Root open={showEndStreamAlert} modal={false}>
|
141
|
-
<
|
140
|
+
<Dialog.Portal>
|
142
141
|
<Dialog.Overlay />
|
143
142
|
<Dialog.Content css={{ w: 'min(420px, 90%)', p: '$8', bg: '$surface_dim' }}>
|
144
143
|
<EndSessionContent
|
@@ -148,16 +147,16 @@ export const DesktopLeaveRoom = ({
|
|
148
147
|
isModal
|
149
148
|
/>
|
150
149
|
</Dialog.Content>
|
151
|
-
</
|
150
|
+
</Dialog.Portal>
|
152
151
|
</Dialog.Root>
|
153
152
|
|
154
153
|
<Dialog.Root open={showLeaveRoomAlert} modal={false}>
|
155
|
-
<
|
154
|
+
<Dialog.Portal>
|
156
155
|
<Dialog.Overlay />
|
157
156
|
<Dialog.Content css={{ w: 'min(420px, 90%)', p: '$8', bg: '$surface_dim' }}>
|
158
157
|
<LeaveSessionContent setShowLeaveRoomAlert={setShowLeaveRoomAlert} leaveRoom={leaveRoom} isModal />
|
159
158
|
</Dialog.Content>
|
160
|
-
</
|
159
|
+
</Dialog.Portal>
|
161
160
|
</Dialog.Root>
|
162
161
|
</Fragment>
|
163
162
|
);
|
@@ -18,7 +18,6 @@ import { config as cssConfig } from '../../../Theme';
|
|
18
18
|
import { ToastManager } from '../Toast/ToastManager';
|
19
19
|
import { DesktopLeaveRoom } from './DesktopLeaveRoom';
|
20
20
|
import { MwebLeaveRoom } from './MwebLeaveRoom';
|
21
|
-
import { useRedirectToLeave } from '../hooks/useRedirectToLeave';
|
22
21
|
|
23
22
|
export const LeaveRoom = ({ screenType }: { screenType: keyof ConferencingScreen }) => {
|
24
23
|
const isConnected = useHMSStore(selectIsConnectedToRoom);
|
@@ -34,7 +33,6 @@ export const LeaveRoom = ({ screenType }: { screenType: keyof ConferencingScreen
|
|
34
33
|
);
|
35
34
|
const hlsState = useHMSStore(selectHLSState);
|
36
35
|
const hmsActions = useHMSActions();
|
37
|
-
const { redirectToLeave } = useRedirectToLeave();
|
38
36
|
|
39
37
|
const stopStream = async () => {
|
40
38
|
try {
|
@@ -48,7 +46,6 @@ export const LeaveRoom = ({ screenType }: { screenType: keyof ConferencingScreen
|
|
48
46
|
};
|
49
47
|
const endRoom = () => {
|
50
48
|
hmsActions.endRoom(false, 'End Room');
|
51
|
-
redirectToLeave();
|
52
49
|
};
|
53
50
|
|
54
51
|
const leaveRoom = async ({ endstream = false }) => {
|
@@ -56,7 +53,6 @@ export const LeaveRoom = ({ screenType }: { screenType: keyof ConferencingScreen
|
|
56
53
|
await stopStream();
|
57
54
|
}
|
58
55
|
hmsActions.leave();
|
59
|
-
redirectToLeave();
|
60
56
|
};
|
61
57
|
|
62
58
|
if (!permissions || !isConnected) {
|
@@ -1,21 +1,18 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { useNavigate, useParams } from 'react-router-dom';
|
3
2
|
import { ExitIcon } from '@100mslive/react-icons';
|
3
|
+
// @ts-ignore: No implicit Any
|
4
4
|
import { ToastManager } from './Toast/ToastManager';
|
5
5
|
import { Button } from '../../Button';
|
6
6
|
import { Box, Flex } from '../../Layout';
|
7
7
|
import { Text } from '../../Text';
|
8
|
-
import {
|
8
|
+
import { useHMSAppStateContext } from '../AppStateContext';
|
9
9
|
import { Header } from './Header';
|
10
|
-
|
10
|
+
// @ts-ignore: No implicit Any
|
11
11
|
import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from './hooks/useUserPreferences';
|
12
12
|
import { textEllipsis } from '../../utils';
|
13
13
|
|
14
|
-
const
|
15
|
-
const
|
16
|
-
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
17
|
-
const { roomCode } = useHMSPrebuiltContext();
|
18
|
-
const { roomId, role } = useParams();
|
14
|
+
export const LeaveScreen = () => {
|
15
|
+
const { rejoin } = useHMSAppStateContext();
|
19
16
|
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
20
17
|
return (
|
21
18
|
<Flex direction="column" css={{ size: '100%' }}>
|
@@ -57,9 +54,7 @@ const PostLeave = () => {
|
|
57
54
|
</Text>
|
58
55
|
<Button
|
59
56
|
onClick={() => {
|
60
|
-
|
61
|
-
if (role && roomId) redirectUrl += '/' + role;
|
62
|
-
navigate(redirectUrl);
|
57
|
+
rejoin();
|
63
58
|
ToastManager.clearAllToast();
|
64
59
|
}}
|
65
60
|
data-testid="join_again_btn"
|
@@ -72,5 +67,3 @@ const PostLeave = () => {
|
|
72
67
|
</Flex>
|
73
68
|
);
|
74
69
|
};
|
75
|
-
|
76
|
-
export default PostLeave;
|
@@ -3,7 +3,6 @@ import { useMedia } from 'react-use';
|
|
3
3
|
import { selectLocalPeerName, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
4
4
|
import { config as cssConfig, Dialog } from '../../../';
|
5
5
|
import { Sheet } from '../../../Sheet';
|
6
|
-
import { PrebuiltDialogPortal } from '../PrebuiltDialogPortal';
|
7
6
|
import { ToastManager } from '../Toast/ToastManager';
|
8
7
|
import { ChangeNameContent } from './ChangeNameContent';
|
9
8
|
import { UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
|
@@ -59,12 +58,12 @@ export const ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
|
59
58
|
|
60
59
|
return (
|
61
60
|
<Dialog.Root defaultOpen onOpenChange={onOpenChange}>
|
62
|
-
<
|
61
|
+
<Dialog.Portal>
|
63
62
|
<Dialog.Overlay />
|
64
63
|
<Dialog.Content css={{ bg: '$surface_dim', width: 'min(400px,80%)', p: '$10' }}>
|
65
64
|
<ChangeNameContent {...props} />
|
66
65
|
</Dialog.Content>
|
67
|
-
</
|
66
|
+
</Dialog.Portal>
|
68
67
|
</Dialog.Root>
|
69
68
|
);
|
70
69
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { LinkIcon } from '@100mslive/react-icons';
|
3
3
|
import { Button, Dialog, Dropdown, Flex, Input, Text } from '../../../';
|
4
|
-
import { PrebuiltDialogPortal } from '../PrebuiltDialogPortal';
|
5
4
|
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
6
5
|
import { APP_DATA } from '../../common/constants';
|
7
6
|
|
@@ -31,7 +30,7 @@ export function EmbedUrlModal({ onOpenChange }) {
|
|
31
30
|
|
32
31
|
return (
|
33
32
|
<Dialog.Root defaultOpen onOpenChange={onOpenChange}>
|
34
|
-
<
|
33
|
+
<Dialog.Portal>
|
35
34
|
<Dialog.Overlay />
|
36
35
|
<Dialog.Content css={{ w: 'min(420px, 90%)', p: '$8', bg: '$surface_dim' }}>
|
37
36
|
<Dialog.Title
|
@@ -76,7 +75,7 @@ export function EmbedUrlModal({ onOpenChange }) {
|
|
76
75
|
</Button>
|
77
76
|
</Flex>
|
78
77
|
</Dialog.Content>
|
79
|
-
</
|
78
|
+
</Dialog.Portal>
|
80
79
|
</Dialog.Root>
|
81
80
|
);
|
82
81
|
}
|
@@ -18,6 +18,7 @@ import {
|
|
18
18
|
HandIcon,
|
19
19
|
HandRaiseSlashedIcon,
|
20
20
|
PeopleIcon,
|
21
|
+
QuizIcon,
|
21
22
|
RecordIcon,
|
22
23
|
SettingsIcon,
|
23
24
|
} from '@100mslive/react-icons';
|
@@ -40,7 +41,9 @@ import { ChangeNameModal } from '../ChangeNameModal';
|
|
40
41
|
// @ts-ignore: No implicit any
|
41
42
|
import { MuteAllModal } from '../MuteAllModal';
|
42
43
|
// @ts-ignore: No implicit any
|
43
|
-
import { useSidepaneToggle } from '../../AppData/useSidepane';
|
44
|
+
import { usePollViewToggle, useSidepaneToggle } from '../../AppData/useSidepane';
|
45
|
+
// @ts-ignore: No implicit Any
|
46
|
+
import { useShowPolls } from '../../AppData/useUISettings';
|
44
47
|
// @ts-ignore: No implicit any
|
45
48
|
import { useDropdownList } from '../../hooks/useDropdownList';
|
46
49
|
// @ts-ignore: No implicit any
|
@@ -82,6 +85,8 @@ export const MwebOptions = ({
|
|
82
85
|
const [showRecordingOn, setShowRecordingOn] = useState(false);
|
83
86
|
const [isRecordingLoading, setIsRecordingLoading] = useState(false);
|
84
87
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
88
|
+
const { showPolls } = useShowPolls();
|
89
|
+
const togglePollView = usePollViewToggle();
|
85
90
|
const peerCount = useHMSStore(selectPeerCount);
|
86
91
|
const emojiCardRef = useRef(null);
|
87
92
|
const { isBRBOn, toggleBRB, isHandRaised, toggleHandRaise } = useMyMetadata();
|
@@ -192,6 +197,18 @@ export const MwebOptions = ({
|
|
192
197
|
</ActionTile.Root>
|
193
198
|
)}
|
194
199
|
|
200
|
+
{showPolls && (
|
201
|
+
<ActionTile.Root
|
202
|
+
onClick={() => {
|
203
|
+
togglePollView();
|
204
|
+
setOpenOptionsSheet(false);
|
205
|
+
}}
|
206
|
+
>
|
207
|
+
<QuizIcon />
|
208
|
+
<ActionTile.Title>Polls and Quizzes</ActionTile.Title>
|
209
|
+
</ActionTile.Root>
|
210
|
+
)}
|
211
|
+
|
195
212
|
{elements?.brb && (
|
196
213
|
<ActionTile.Root
|
197
214
|
active={isBRBOn}
|
@@ -4,29 +4,28 @@ import { Button } from '../../Button';
|
|
4
4
|
import { Box, Flex } from '../../Layout';
|
5
5
|
import { Dialog } from '../../Modal';
|
6
6
|
import { Text } from '../../Text';
|
7
|
-
import { PrebuiltDialogPortal } from './PrebuiltDialogPortal';
|
8
|
-
import { isAndroid, isIOS } from '../common/constants';
|
9
7
|
|
10
8
|
export const MwebLandscapePrompt = () => {
|
11
|
-
const isMobile = isAndroid || isIOS;
|
12
9
|
const [showMwebLandscapePrompt, setShowMwebLandscapePrompt] = useState(false);
|
13
10
|
|
14
11
|
useEffect(() => {
|
15
|
-
const
|
16
|
-
|
12
|
+
const handleRotation = () => {
|
13
|
+
const angle = window.screen.orientation.angle;
|
14
|
+
const type = window.screen.orientation.type;
|
15
|
+
// Angle check needed to diff bw mobile and desktop
|
16
|
+
setShowMwebLandscapePrompt(angle >= 90 && type.includes('landscape'));
|
17
17
|
};
|
18
|
-
|
19
|
-
|
20
|
-
window.addEventListener('resize', handleResize);
|
18
|
+
handleRotation();
|
19
|
+
window.screen.orientation.addEventListener('change', handleRotation);
|
21
20
|
|
22
21
|
return () => {
|
23
|
-
window.removeEventListener('
|
22
|
+
window.screen.orientation.removeEventListener('change', handleRotation);
|
24
23
|
};
|
25
24
|
}, []);
|
26
25
|
|
27
26
|
return (
|
28
27
|
<Dialog.Root open={showMwebLandscapePrompt} onOpenChange={setShowMwebLandscapePrompt}>
|
29
|
-
<
|
28
|
+
<Dialog.Portal>
|
30
29
|
<Dialog.Overlay />
|
31
30
|
<Dialog.Content css={{ w: 'min(420px, 90%)', p: '$8', bg: '$surface_dim' }}>
|
32
31
|
<Box>
|
@@ -52,7 +51,7 @@ export const MwebLandscapePrompt = () => {
|
|
52
51
|
</Flex>
|
53
52
|
</Box>
|
54
53
|
</Dialog.Content>
|
55
|
-
</
|
54
|
+
</Dialog.Portal>
|
56
55
|
</Dialog.Root>
|
57
56
|
);
|
58
57
|
};
|
package/src/Prebuilt/components/Notifications/{AutoplayBlockedModal.jsx → AutoplayBlockedModal.tsx}
RENAMED
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useAutoplayError } from '@100mslive/react-sdk';
|
3
|
-
import { Button, Dialog, Text } from '
|
3
|
+
import { Button, Dialog, Text } from '../../..';
|
4
|
+
// @ts-ignore: No implicit Any
|
4
5
|
import { DialogContent, DialogRow } from '../../primitives/DialogContent';
|
5
6
|
|
6
7
|
export function AutoplayBlockedModal() {
|
@@ -1,33 +1,35 @@
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
2
|
-
import { selectHLSState, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
2
|
+
import { selectHLSState, useHMSActions, useHMSStore, useRecordingStreaming } from '@100mslive/react-sdk';
|
3
3
|
import { Button } from '../../../Button';
|
4
4
|
import { Flex } from '../../../Layout';
|
5
5
|
import { Dialog } from '../../../Modal';
|
6
6
|
import { Text } from '../../../Text';
|
7
|
-
|
7
|
+
// @ts-ignore: No implicit Any
|
8
8
|
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
9
|
+
// @ts-ignore: No implicit Any
|
9
10
|
import { APP_DATA } from '../../common/constants';
|
10
11
|
|
11
12
|
export function HLSFailureModal() {
|
12
|
-
const
|
13
|
+
const hlsError = useHMSStore(selectHLSState).error || false;
|
13
14
|
const [openModal, setOpenModal] = useState(!!hlsError);
|
14
15
|
const hmsActions = useHMSActions();
|
16
|
+
const { isRTMPRunning } = useRecordingStreaming();
|
15
17
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
16
18
|
const startHLS = useCallback(async () => {
|
17
19
|
try {
|
18
|
-
if (isHLSStarted) {
|
20
|
+
if (isHLSStarted || isRTMPRunning) {
|
19
21
|
return;
|
20
22
|
}
|
21
23
|
setHLSStarted(true);
|
22
24
|
await hmsActions.startHLSStreaming({});
|
23
25
|
} catch (error) {
|
24
|
-
if (error.message.includes('invalid input')) {
|
26
|
+
if ((error as Error).message.includes('invalid input')) {
|
25
27
|
await startHLS();
|
26
28
|
return;
|
27
29
|
}
|
28
30
|
setHLSStarted(false);
|
29
31
|
}
|
30
|
-
}, [hmsActions, isHLSStarted, setHLSStarted]);
|
32
|
+
}, [hmsActions, isHLSStarted, setHLSStarted, isRTMPRunning]);
|
31
33
|
|
32
34
|
return hlsError ? (
|
33
35
|
<Dialog.Root
|
@@ -38,7 +40,7 @@ export function HLSFailureModal() {
|
|
38
40
|
}
|
39
41
|
}}
|
40
42
|
>
|
41
|
-
<
|
43
|
+
<Dialog.Portal>
|
42
44
|
<Dialog.Overlay />
|
43
45
|
<Dialog.Content css={{ w: 'min(360px, 90%)' }}>
|
44
46
|
<Dialog.Title
|
@@ -66,7 +68,7 @@ export function HLSFailureModal() {
|
|
66
68
|
</Button>
|
67
69
|
</Flex>
|
68
70
|
</Dialog.Content>
|
69
|
-
</
|
71
|
+
</Dialog.Portal>
|
70
72
|
</Dialog.Root>
|
71
73
|
) : null;
|
72
74
|
}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
2
|
-
import {
|
2
|
+
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
3
|
+
import { Text } from '../../..';
|
4
|
+
// @ts-ignore: No implicit Any
|
3
5
|
import { ErrorDialog } from '../../primitives/DialogContent';
|
4
6
|
|
5
|
-
export const InitErrorModal = (
|
7
|
+
export const InitErrorModal = () => {
|
8
|
+
const notification = useHMSNotifications(HMSNotificationTypes.ERROR);
|
6
9
|
const [showModal, setShowModal] = useState(false);
|
7
10
|
const [info, setInfo] = useState({ title: 'Init Error', description: '' });
|
8
11
|
|