@100mslive/roomkit-react 0.1.5 → 0.1.6-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-P57IRMAR.js → HLSView-HNVYG5VE.js} +309 -151
- package/dist/HLSView-HNVYG5VE.js.map +7 -0
- package/dist/Prebuilt/App.d.ts +3 -0
- package/dist/Prebuilt/AppContext.d.ts +13 -0
- package/dist/Prebuilt/common/PeersSorter.d.ts +21 -0
- package/dist/Prebuilt/components/Chat/ChatFooter.d.ts +7 -0
- package/dist/Prebuilt/components/Connection/ConnectionIndicator.d.ts +6 -0
- package/dist/Prebuilt/components/Connection/TileConnection.d.ts +10 -0
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +4 -0
- package/dist/Prebuilt/components/Footer/Footer.d.ts +6 -0
- package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +14 -0
- package/dist/Prebuilt/components/Footer/RoleOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Header/Header.d.ts +2 -0
- package/dist/Prebuilt/components/Header/StreamActions.d.ts +11 -0
- package/dist/Prebuilt/components/InsetTile.d.ts +2 -0
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +8 -0
- package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +9 -0
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2196 -0
- package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +11 -0
- package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +5 -0
- package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +8 -0
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +8 -0
- package/dist/Prebuilt/components/MoreSettings/MoreSettings.d.ts +6 -0
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.d.ts +6 -0
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Pagination.d.ts +6 -0
- package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -0
- package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +10 -0
- package/dist/Prebuilt/components/Preview/PreviewJoin.d.ts +16 -0
- package/dist/Prebuilt/components/RoleChangeRequestModal.d.ts +2 -0
- package/dist/Prebuilt/components/SecondaryTiles.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +6 -0
- package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +12 -0
- package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +15 -0
- package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +9 -0
- package/dist/Prebuilt/components/hooks/useAutoStartStreaming.d.ts +1 -0
- package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +3 -0
- package/dist/Prebuilt/components/hooks/useRoleProminencePeers.d.ts +5 -0
- package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +13 -0
- package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +13 -0
- package/dist/Prebuilt/layouts/SidePane.d.ts +9 -0
- package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +7 -0
- package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +5 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +17 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +6 -1
- package/dist/{VirtualBackground-GGCQJ5JM.js → VirtualBackground-UM2FOUHQ.js} +5 -11
- package/dist/VirtualBackground-UM2FOUHQ.js.map +7 -0
- package/dist/{chunk-P5X32KOD.js → chunk-364HP22I.js} +8 -5
- package/dist/chunk-364HP22I.js.map +7 -0
- package/dist/{chunk-OSM4QEQG.js → chunk-LYSAET4G.js} +3742 -5462
- package/dist/chunk-LYSAET4G.js.map +7 -0
- package/dist/chunk-POE7H4IE.js +898 -0
- package/dist/chunk-POE7H4IE.js.map +7 -0
- package/dist/conference-UWLJHMB2.js +5727 -0
- package/dist/conference-UWLJHMB2.js.map +7 -0
- package/dist/index.cjs.js +9655 -15326
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +2513 -3456
- package/dist/meta.esbuild.json +2807 -3838
- package/package.json +8 -7
- package/src/Button/Button.tsx +2 -2
- package/src/Prebuilt/App.tsx +58 -53
- package/src/Prebuilt/{AppContext.jsx → AppContext.tsx} +11 -3
- package/src/Prebuilt/IconButton.jsx +11 -0
- package/src/Prebuilt/Prebuilt.stories.tsx +1 -0
- package/src/Prebuilt/common/{PeersSorter.js → PeersSorter.ts} +16 -11
- package/src/Prebuilt/common/constants.js +4 -114
- package/src/Prebuilt/common/hooks.js +34 -1
- package/src/Prebuilt/common/utils.js +1 -9
- package/src/Prebuilt/components/AppData/AppData.jsx +11 -15
- package/src/Prebuilt/components/AppData/useUISettings.js +6 -10
- package/src/Prebuilt/components/AudioVideoToggle.jsx +10 -2
- package/src/Prebuilt/components/AuthToken.jsx +11 -42
- package/src/Prebuilt/components/Chat/Chat.jsx +75 -27
- package/src/Prebuilt/components/Chat/ChatBody.jsx +95 -36
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +199 -0
- package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +84 -0
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +16 -17
- package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +81 -0
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +5 -4
- package/src/Prebuilt/components/Connection/{ConnectionIndicator.jsx → ConnectionIndicator.tsx} +12 -4
- package/src/Prebuilt/components/Connection/TileConnection.tsx +71 -0
- package/src/Prebuilt/components/EmojiReaction.jsx +19 -22
- package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +13 -9
- package/src/Prebuilt/components/Footer/Footer.tsx +98 -0
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +187 -179
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +94 -0
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +3 -2
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +63 -18
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
- package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
- package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +38 -9
- package/src/Prebuilt/components/Header/{ConferencingHeader.jsx → Header.tsx} +9 -7
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +13 -4
- package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +54 -67
- package/src/Prebuilt/components/Header/common.jsx +5 -2
- package/src/Prebuilt/components/Header/index.tsx +1 -0
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +23 -4
- package/src/Prebuilt/components/InsetTile.tsx +128 -0
- package/src/Prebuilt/components/{MoreSettings/SplitComponents/DesktopLeaveRoom.jsx → Leave/DesktopLeaveRoom.tsx} +67 -25
- package/src/Prebuilt/components/{EndSessionContent.jsx → Leave/EndSessionContent.tsx} +18 -11
- package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +26 -0
- package/src/Prebuilt/components/Leave/LeaveCard.tsx +36 -0
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +66 -0
- package/src/Prebuilt/components/{LeaveSessionContent.jsx → Leave/LeaveSessionContent.tsx} +20 -6
- package/src/Prebuilt/components/{MoreSettings/SplitComponents/MwebLeaveRoom.jsx → Leave/MwebLeaveRoom.tsx} +43 -18
- package/src/Prebuilt/components/MetaActions.jsx +15 -23
- package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +5 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +16 -7
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +1 -1
- package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +1 -4
- package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +27 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +216 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +107 -45
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -1
- package/src/Prebuilt/components/Notifications/Notifications.jsx +46 -30
- package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +14 -2
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +10 -4
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +7 -16
- package/src/Prebuilt/components/PIP/PIPManager.js +1 -0
- package/src/Prebuilt/components/Pagination.tsx +60 -0
- package/src/Prebuilt/components/Playlist/Playlist.jsx +1 -6
- package/src/Prebuilt/components/PostLeave.jsx +7 -7
- package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +16 -15
- package/src/Prebuilt/components/Preview/{PreviewForm.jsx → PreviewForm.tsx} +16 -8
- package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +48 -22
- package/src/Prebuilt/components/RaiseHand.jsx +0 -7
- package/src/Prebuilt/components/RoleChangeRequestModal.tsx +119 -0
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +4 -10
- package/src/Prebuilt/components/ScreenshareTile.jsx +43 -36
- package/src/Prebuilt/components/SecondaryTiles.tsx +36 -0
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +2 -12
- package/src/Prebuilt/components/Settings/NotificationSettings.jsx +3 -9
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -9
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -1
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +16 -17
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +33 -27
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +58 -15
- package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +65 -0
- package/src/Prebuilt/components/VideoLayouts/Grid.tsx +43 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +110 -0
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +74 -0
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +59 -0
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +52 -0
- package/src/Prebuilt/components/VideoLayouts/interface.ts +10 -0
- package/src/Prebuilt/components/VideoTile.jsx +116 -74
- package/src/Prebuilt/components/conference.jsx +86 -85
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -3
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
- package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +38 -0
- package/src/Prebuilt/components/hooks/useTileLayout.tsx +127 -0
- package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +26 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +5 -72
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +4 -45
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -17
- package/src/Prebuilt/components/peerTileUtils.jsx +1 -1
- package/src/Prebuilt/images/empty-chat.svg +12 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +17 -50
- package/src/Prebuilt/layouts/HLSView.jsx +138 -51
- package/src/Prebuilt/layouts/PDFView.jsx +1 -11
- package/src/Prebuilt/layouts/SidePane.tsx +108 -0
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +96 -0
- package/src/Prebuilt/layouts/WhiteboardView.jsx +10 -34
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -4
- package/src/Prebuilt/plugins/whiteboard/{ToggleWhiteboard.jsx → ToggleWhiteboard.tsx} +5 -9
- package/src/Prebuilt/primitives/DialogContent.jsx +15 -11
- package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +17 -2
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +36 -13
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +10 -0
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +65 -0
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +17 -6
- package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
- package/src/VideoTile/StyledVideoTile.tsx +1 -0
- package/dist/HLSView-P57IRMAR.js.map +0 -7
- package/dist/PinnedTrackView-4FYJEBTB.js +0 -102
- package/dist/PinnedTrackView-4FYJEBTB.js.map +0 -7
- package/dist/VirtualBackground-GGCQJ5JM.js.map +0 -7
- package/dist/chunk-IVTWKQI3.js +0 -827
- package/dist/chunk-IVTWKQI3.js.map +0 -7
- package/dist/chunk-OSM4QEQG.js.map +0 -7
- package/dist/chunk-P5X32KOD.js.map +0 -7
- package/dist/chunk-RVCZPPTL.js +0 -1100
- package/dist/chunk-RVCZPPTL.js.map +0 -7
- package/dist/conference-P6I6ESVF.js +0 -8995
- package/dist/conference-P6I6ESVF.js.map +0 -7
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
- package/src/Prebuilt/components/Chat/ChatFooter.jsx +0 -150
- package/src/Prebuilt/components/Chat/ChatHeader.jsx +0 -67
- package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -39
- package/src/Prebuilt/components/EqualProminence.jsx +0 -180
- package/src/Prebuilt/components/FirstPersonDisplay.jsx +0 -50
- package/src/Prebuilt/components/Footer/Footer.jsx +0 -73
- package/src/Prebuilt/components/Header/Header.jsx +0 -8
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +0 -54
- package/src/Prebuilt/components/LeaveCard.jsx +0 -19
- package/src/Prebuilt/components/LeaveRoom.jsx +0 -94
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +0 -10
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +0 -219
- package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +0 -25
- package/src/Prebuilt/components/Pagination.jsx +0 -29
- package/src/Prebuilt/components/RoleChangeRequestModal.jsx +0 -26
- package/src/Prebuilt/components/VideoList.jsx +0 -73
- package/src/Prebuilt/components/gridView.jsx +0 -85
- package/src/Prebuilt/components/hooks/useFeatures.js +0 -22
- package/src/Prebuilt/components/hooks/useNavigation.js +0 -19
- package/src/Prebuilt/components/hooks/useSkipPreview.jsx +0 -20
- package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +0 -29
- package/src/Prebuilt/images/Logo.svg +0 -8
- package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +0 -34
- package/src/Prebuilt/layouts/InsetView.jsx +0 -260
- package/src/Prebuilt/layouts/PinnedTrackView.jsx +0 -59
- package/src/Prebuilt/layouts/SidePane.jsx +0 -52
- package/src/Prebuilt/layouts/mainGridView.jsx +0 -98
- package/src/Prebuilt/layouts/mainView.jsx +0 -141
- package/src/Prebuilt/layouts/screenShareView.jsx +0 -183
- /package/{src/Prebuilt/components/Header/index.jsx → dist/Prebuilt/components/Header/index.d.ts} +0 -0
- /package/src/Prebuilt/components/{ScreenShare.jsx → ScreenShareToggle.jsx} +0 -0
- /package/src/{assets → Prebuilt/images}/android-perm-1.png +0 -0
- /package/src/{assets → Prebuilt/images}/ios-perm-0.png +0 -0
@@ -11,28 +11,31 @@ import {
|
|
11
11
|
useRecordingStreaming,
|
12
12
|
} from '@100mslive/react-sdk';
|
13
13
|
import { AlertTriangleIcon, CrossIcon, RecordIcon } from '@100mslive/react-icons';
|
14
|
-
import { Box, Button, config as cssConfig, Flex, HorizontalDivider, Loading, Popover, Text, Tooltip } from '
|
14
|
+
import { Box, Button, config as cssConfig, Flex, HorizontalDivider, Loading, Popover, Text, Tooltip } from '../../..';
|
15
15
|
import { Sheet } from '../../../Sheet';
|
16
|
-
|
17
|
-
import { getResolution } from '../Streaming/RTMPStreaming';
|
16
|
+
// @ts-ignore
|
18
17
|
import { ToastManager } from '../Toast/ToastManager';
|
18
|
+
// @ts-ignore
|
19
19
|
import { AdditionalRoomState, getRecordingText } from './AdditionalRoomState';
|
20
|
+
// @ts-ignore
|
20
21
|
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
22
|
+
// @ts-ignore
|
21
23
|
import { formatTime } from '../../common/utils';
|
22
|
-
|
24
|
+
// @ts-ignore
|
25
|
+
import { APP_DATA } from '../../common/constants';
|
23
26
|
|
24
27
|
export const LiveStatus = () => {
|
25
28
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming();
|
26
29
|
const hlsState = useHMSStore(selectHLSState);
|
27
30
|
const isMobile = useMedia(cssConfig.media.md);
|
28
|
-
const intervalRef = useRef(null);
|
31
|
+
const intervalRef = useRef<NodeJS.Timeout | null>(null);
|
29
32
|
|
30
33
|
const [liveTime, setLiveTime] = useState(0);
|
31
34
|
|
32
35
|
const startTimer = useCallback(() => {
|
33
36
|
intervalRef.current = setInterval(() => {
|
34
|
-
if (hlsState?.running) {
|
35
|
-
setLiveTime(Date.now() - hlsState
|
37
|
+
if (hlsState?.running && hlsState?.variants[0]?.startedAt) {
|
38
|
+
setLiveTime(Date.now() - hlsState.variants[0].startedAt.getTime());
|
36
39
|
}
|
37
40
|
}, 1000);
|
38
41
|
}, [hlsState?.running, hlsState?.variants]);
|
@@ -92,6 +95,7 @@ export const RecordingStatus = () => {
|
|
92
95
|
|
93
96
|
return (
|
94
97
|
<Tooltip
|
98
|
+
boxCss={{ zIndex: 1 }}
|
95
99
|
title={getRecordingText({
|
96
100
|
isBrowserRecordingOn,
|
97
101
|
isServerRecordingOn,
|
@@ -112,7 +116,6 @@ export const RecordingStatus = () => {
|
|
112
116
|
|
113
117
|
const StartRecording = () => {
|
114
118
|
const permissions = useHMSStore(selectPermissions);
|
115
|
-
const [resolution, setResolution] = useState(RTMP_RECORD_DEFAULT_RESOLUTION);
|
116
119
|
const [open, setOpen] = useState(false);
|
117
120
|
const [recordingStarted, setRecordingState] = useSetAppDataByKey(APP_DATA.recordingStarted);
|
118
121
|
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming();
|
@@ -133,7 +136,7 @@ const StartRecording = () => {
|
|
133
136
|
</Popover.Trigger>
|
134
137
|
<Popover.Portal>
|
135
138
|
<Popover.Content align="end" sideOffset={8} css={{ w: '$64' }}>
|
136
|
-
<Text variant="
|
139
|
+
<Text variant="body1" css={{ color: '$on_surface_medium' }}>
|
137
140
|
Are you sure you want to end the recording?
|
138
141
|
</Text>
|
139
142
|
<Button
|
@@ -145,8 +148,9 @@ const StartRecording = () => {
|
|
145
148
|
try {
|
146
149
|
await hmsActions.stopRTMPAndRecording();
|
147
150
|
} catch (error) {
|
151
|
+
const err = error as Error;
|
148
152
|
ToastManager.addToast({
|
149
|
-
title:
|
153
|
+
title: err.message,
|
150
154
|
variant: 'error',
|
151
155
|
});
|
152
156
|
}
|
@@ -161,62 +165,39 @@ const StartRecording = () => {
|
|
161
165
|
);
|
162
166
|
}
|
163
167
|
return (
|
164
|
-
<
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
record: true,
|
198
|
-
});
|
199
|
-
} catch (error) {
|
200
|
-
if (error.message.includes('stream already running')) {
|
201
|
-
ToastManager.addToast({
|
202
|
-
title: 'Recording already running',
|
203
|
-
variant: 'error',
|
204
|
-
});
|
205
|
-
} else {
|
206
|
-
ToastManager.addToast({
|
207
|
-
title: error.message,
|
208
|
-
variant: 'error',
|
209
|
-
});
|
210
|
-
}
|
211
|
-
setRecordingState(false);
|
212
|
-
}
|
213
|
-
setOpen(false);
|
214
|
-
}}
|
215
|
-
>
|
216
|
-
Start
|
217
|
-
</Button>
|
218
|
-
</Popover.Content>
|
219
|
-
</Popover.Root>
|
168
|
+
<Button
|
169
|
+
data-testid="start_recording"
|
170
|
+
variant="standard"
|
171
|
+
icon
|
172
|
+
disabled={recordingStarted || isStreamingOn}
|
173
|
+
onClick={async () => {
|
174
|
+
try {
|
175
|
+
setRecordingState(true);
|
176
|
+
await hmsActions.startRTMPOrRecording({
|
177
|
+
record: true,
|
178
|
+
});
|
179
|
+
} catch (error) {
|
180
|
+
const err = error as Error;
|
181
|
+
if (err.message.includes('stream already running')) {
|
182
|
+
ToastManager.addToast({
|
183
|
+
title: 'Recording already running',
|
184
|
+
variant: 'error',
|
185
|
+
});
|
186
|
+
} else {
|
187
|
+
ToastManager.addToast({
|
188
|
+
title: err.message,
|
189
|
+
variant: 'error',
|
190
|
+
});
|
191
|
+
}
|
192
|
+
setRecordingState(false);
|
193
|
+
}
|
194
|
+
}}
|
195
|
+
>
|
196
|
+
{recordingStarted ? <Loading size={24} color="currentColor" /> : <RecordIcon />}
|
197
|
+
<Text as="span" css={{ '@md': { display: 'none' }, color: 'currentColor' }}>
|
198
|
+
{recordingStarted ? 'Starting' : 'Start'} Recording
|
199
|
+
</Text>
|
200
|
+
</Button>
|
220
201
|
);
|
221
202
|
};
|
222
203
|
|
@@ -242,7 +223,13 @@ export const StreamActions = () => {
|
|
242
223
|
);
|
243
224
|
};
|
244
225
|
|
245
|
-
export const StopRecordingInSheet = ({
|
226
|
+
export const StopRecordingInSheet = ({
|
227
|
+
onStopRecording,
|
228
|
+
onClose,
|
229
|
+
}: {
|
230
|
+
onStopRecording: () => void;
|
231
|
+
onClose: () => void;
|
232
|
+
}) => {
|
246
233
|
return (
|
247
234
|
<Sheet.Root open={true}>
|
248
235
|
<Sheet.Content>
|
@@ -25,11 +25,13 @@ export const CamaraFlipActions = () => {
|
|
25
25
|
|
26
26
|
const videoTrackId = useHMSStore(selectLocalVideoTrackID);
|
27
27
|
const localVideoTrack = useHMSStore(selectVideoTrackByID(videoTrackId));
|
28
|
-
|
28
|
+
if (!videoInput || !videoInput?.length || !localVideoTrack?.facingMode) {
|
29
|
+
return null;
|
30
|
+
}
|
29
31
|
return (
|
30
32
|
<Box>
|
31
33
|
<IconButton
|
32
|
-
disabled={!
|
34
|
+
disabled={!isVideoOn}
|
33
35
|
onClick={async () => {
|
34
36
|
try {
|
35
37
|
await actions.switchCamera();
|
@@ -117,6 +119,7 @@ const AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, ch
|
|
117
119
|
{outputDevices.map(audioDevice => {
|
118
120
|
return (
|
119
121
|
<SelectWithLabel
|
122
|
+
key={audioDevice.deviceId}
|
120
123
|
label={audioDevice.label}
|
121
124
|
id={audioDevice.deviceId}
|
122
125
|
checked={audioDevice.deviceId === outputSelected}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Header } from './Header';
|
@@ -14,6 +14,10 @@ const IconSection = styled(IconButton, {
|
|
14
14
|
borderTopRightRadius: 0,
|
15
15
|
borderColor: '$border_default',
|
16
16
|
borderBottomRightRadius: 0,
|
17
|
+
position: 'relative',
|
18
|
+
'&:not([disabled]):focus-visible': {
|
19
|
+
zIndex: 1,
|
20
|
+
},
|
17
21
|
'@md': {
|
18
22
|
mx: 0,
|
19
23
|
borderTopRightRadius: '$1',
|
@@ -30,8 +34,9 @@ const OptionsSection = styled(IconButton, {
|
|
30
34
|
borderColor: '$border_default',
|
31
35
|
borderBottomLeftRadius: 0,
|
32
36
|
borderLeftWidth: 0,
|
37
|
+
position: 'relative',
|
33
38
|
'&:not([disabled]):focus-visible': {
|
34
|
-
|
39
|
+
zIndex: 1,
|
35
40
|
},
|
36
41
|
'@md': {
|
37
42
|
display: 'none',
|
@@ -39,6 +44,10 @@ const OptionsSection = styled(IconButton, {
|
|
39
44
|
});
|
40
45
|
|
41
46
|
export const IconButtonWithOptions = ({
|
47
|
+
disabled = false,
|
48
|
+
onDisabledClick = () => {
|
49
|
+
return;
|
50
|
+
},
|
42
51
|
tooltipMessage = '',
|
43
52
|
icon,
|
44
53
|
options = [],
|
@@ -47,8 +56,9 @@ export const IconButtonWithOptions = ({
|
|
47
56
|
return;
|
48
57
|
},
|
49
58
|
}) => {
|
50
|
-
const bgCss = { backgroundColor: active ? '$transparent' : '$secondary_dim' };
|
51
|
-
const iconCss = { color: active ? '$on_surface_high' : '$on_primary_high' };
|
59
|
+
const bgCss = { backgroundColor: disabled ? '$surface_brighter' : active ? '$transparent' : '$secondary_dim' };
|
60
|
+
const iconCss = { color: disabled ? '$on_surface_low' : active ? '$on_surface_high' : '$on_primary_high' };
|
61
|
+
|
52
62
|
return (
|
53
63
|
<Flex>
|
54
64
|
<IconSection css={bgCss} onClick={onClick}>
|
@@ -59,7 +69,16 @@ export const IconButtonWithOptions = ({
|
|
59
69
|
</Tooltip>
|
60
70
|
</IconSection>
|
61
71
|
<Dropdown.Root>
|
62
|
-
<Dropdown.Trigger
|
72
|
+
<Dropdown.Trigger
|
73
|
+
asChild
|
74
|
+
// onClick does not work
|
75
|
+
onPointerDown={e => {
|
76
|
+
if (disabled) {
|
77
|
+
e.preventDefault();
|
78
|
+
onDisabledClick();
|
79
|
+
}
|
80
|
+
}}
|
81
|
+
>
|
63
82
|
<OptionsSection css={bgCss}>
|
64
83
|
<Tooltip title="View Options">
|
65
84
|
<Box css={iconCss}>
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
2
|
+
import Draggable from 'react-draggable';
|
3
|
+
import { useMedia } from 'react-use';
|
4
|
+
import { selectIsAllowedToPublish, selectLocalPeer, selectVideoTrackByID, useHMSStore } from '@100mslive/react-sdk';
|
5
|
+
import { ExpandIcon } from '@100mslive/react-icons';
|
6
|
+
import { Box, Flex } from '../../Layout';
|
7
|
+
import { Text } from '../../Text';
|
8
|
+
import { config as cssConfig } from '../../Theme';
|
9
|
+
// @ts-ignore: No implicit Any
|
10
|
+
import IconButton from '../IconButton';
|
11
|
+
// @ts-ignore: No implicit Any
|
12
|
+
import { AudioVideoToggle } from './AudioVideoToggle';
|
13
|
+
// @ts-ignore: No implicit Any
|
14
|
+
import VideoTile from './VideoTile';
|
15
|
+
// @ts-ignore: No implicit Any
|
16
|
+
import { useSetAppDataByKey } from './AppData/useUISettings';
|
17
|
+
import { useVideoTileContext } from './hooks/useVideoTileLayout';
|
18
|
+
// @ts-ignore: No implicit Any
|
19
|
+
import { APP_DATA } from '../common/constants';
|
20
|
+
|
21
|
+
const MinimisedTile = ({ setMinimised }: { setMinimised: (value: boolean) => void }) => {
|
22
|
+
return (
|
23
|
+
<Flex align="center" css={{ gap: '$6', r: '$1', bg: '$surface_default', p: '$4', color: '$on_surface_high' }}>
|
24
|
+
<AudioVideoToggle hideOptions={true} />
|
25
|
+
<Text>You</Text>
|
26
|
+
<IconButton
|
27
|
+
className="__cancel-drag-event"
|
28
|
+
onClick={() => setMinimised(false)}
|
29
|
+
css={{ bg: 'transparent', border: 'transparent' }}
|
30
|
+
>
|
31
|
+
<ExpandIcon />
|
32
|
+
</IconButton>
|
33
|
+
</Flex>
|
34
|
+
);
|
35
|
+
};
|
36
|
+
|
37
|
+
const insetHeightPx = 180;
|
38
|
+
const insetMaxWidthPx = 240;
|
39
|
+
const defaultMobileAspectRatio = 9 / 16;
|
40
|
+
const desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
41
|
+
|
42
|
+
export const InsetTile = () => {
|
43
|
+
const isMobile = useMedia(cssConfig.media.md);
|
44
|
+
const isLandscape = useMedia(cssConfig.media.ls);
|
45
|
+
const localPeer = useHMSStore(selectLocalPeer);
|
46
|
+
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
47
|
+
const videoTrack = useHMSStore(selectVideoTrackByID(localPeer?.videoTrack));
|
48
|
+
const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
|
49
|
+
const videoTileProps = useVideoTileContext();
|
50
|
+
let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;
|
51
|
+
if (videoTrack?.width && videoTrack?.height && !isMobile) {
|
52
|
+
aspectRatio = videoTrack.width / videoTrack.height;
|
53
|
+
}
|
54
|
+
let height = insetHeightPx;
|
55
|
+
let width = height * aspectRatio;
|
56
|
+
// Convert to 16/9 in landscape mode with a max width of 240
|
57
|
+
if (isLandscape && width > insetMaxWidthPx) {
|
58
|
+
width = 240;
|
59
|
+
height = width / aspectRatio;
|
60
|
+
}
|
61
|
+
|
62
|
+
const nodeRef = useRef<HTMLDivElement>(null);
|
63
|
+
|
64
|
+
useEffect(() => {
|
65
|
+
const node = nodeRef.current;
|
66
|
+
if (!node || !window.ResizeObserver) {
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
const resizeObserver = new ResizeObserver(entries => {
|
70
|
+
entries.forEach(entry => {
|
71
|
+
if (entry.target === node.parentElement) {
|
72
|
+
// reset to original position on resize
|
73
|
+
node.style.transform = `translate(0,0)`;
|
74
|
+
}
|
75
|
+
});
|
76
|
+
});
|
77
|
+
node.parentElement && resizeObserver.observe(node.parentElement);
|
78
|
+
return () => {
|
79
|
+
node?.parentElement && resizeObserver?.unobserve(node.parentElement);
|
80
|
+
resizeObserver?.disconnect();
|
81
|
+
};
|
82
|
+
}, []);
|
83
|
+
|
84
|
+
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
85
|
+
return null;
|
86
|
+
}
|
87
|
+
|
88
|
+
return (
|
89
|
+
<Draggable bounds="parent" nodeRef={nodeRef} cancel=".__cancel-drag-event">
|
90
|
+
<Box
|
91
|
+
ref={nodeRef}
|
92
|
+
css={{
|
93
|
+
position: 'absolute',
|
94
|
+
bottom: 0,
|
95
|
+
right: 0,
|
96
|
+
zIndex: 11,
|
97
|
+
boxShadow: '0 0 8px 0 rgba(0,0,0,0.3)',
|
98
|
+
r: '$2',
|
99
|
+
...(!minimised
|
100
|
+
? {
|
101
|
+
aspectRatio: aspectRatio,
|
102
|
+
h: height,
|
103
|
+
}
|
104
|
+
: {}),
|
105
|
+
}}
|
106
|
+
>
|
107
|
+
{minimised ? (
|
108
|
+
<MinimisedTile setMinimised={setMinimised} />
|
109
|
+
) : (
|
110
|
+
<VideoTile
|
111
|
+
peerId={localPeer?.id}
|
112
|
+
trackid={localPeer?.videoTrack}
|
113
|
+
rootCSS={{
|
114
|
+
size: '100%',
|
115
|
+
padding: 0,
|
116
|
+
}}
|
117
|
+
width={width}
|
118
|
+
height={height}
|
119
|
+
containerCSS={{ background: '$surface_default' }}
|
120
|
+
canMinimise
|
121
|
+
isDragabble
|
122
|
+
{...videoTileProps}
|
123
|
+
/>
|
124
|
+
)}
|
125
|
+
</Box>
|
126
|
+
</Draggable>
|
127
|
+
);
|
128
|
+
};
|
@@ -1,31 +1,34 @@
|
|
1
1
|
import React, { Fragment, useState } from 'react';
|
2
|
+
import { ConferencingScreen } from '@100mslive/types-prebuilt';
|
2
3
|
import { selectIsConnectedToRoom, selectPermissions, useHMSStore, useRecordingStreaming } from '@100mslive/react-sdk';
|
3
4
|
import { ExitIcon, StopIcon, VerticalMenuIcon } from '@100mslive/react-icons';
|
4
|
-
import { Dropdown } from '
|
5
|
-
import { Box, Flex } from '
|
6
|
-
import { Dialog } from '
|
7
|
-
import { Tooltip } from '
|
8
|
-
import { EndSessionContent } from '
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
5
|
+
import { Dropdown } from '../../../Dropdown';
|
6
|
+
import { Box, Flex } from '../../../Layout';
|
7
|
+
import { Dialog } from '../../../Modal';
|
8
|
+
import { Tooltip } from '../../../Tooltip';
|
9
|
+
import { EndSessionContent } from './EndSessionContent';
|
10
|
+
import { LeaveIconButton, MenuTriggerButton } from './LeaveAtoms';
|
11
|
+
import { LeaveCard } from './LeaveCard';
|
12
|
+
import { LeaveSessionContent } from './LeaveSessionContent';
|
13
|
+
// @ts-ignore: No implicit Any
|
14
|
+
import { useDropdownList } from '../hooks/useDropdownList';
|
12
15
|
|
13
16
|
export const DesktopLeaveRoom = ({
|
14
|
-
menuTriggerButton: MenuTriggerButton,
|
15
|
-
leaveIconButton: LeaveIconButton,
|
16
17
|
leaveRoom,
|
17
|
-
|
18
|
+
screenType,
|
19
|
+
}: {
|
20
|
+
leaveRoom: (args: { endstream: boolean }) => void;
|
21
|
+
screenType: keyof ConferencingScreen;
|
18
22
|
}) => {
|
19
23
|
const [open, setOpen] = useState(false);
|
24
|
+
const [showLeaveRoomAlert, setShowLeaveRoomAlert] = useState(false);
|
20
25
|
const [showEndStreamAlert, setShowEndStreamAlert] = useState(false);
|
21
26
|
const isConnected = useHMSStore(selectIsConnectedToRoom);
|
22
27
|
const permissions = useHMSStore(selectPermissions);
|
23
28
|
const { isStreamingOn } = useRecordingStreaming();
|
24
|
-
const
|
29
|
+
const showStream = permissions?.hlsStreaming && isStreamingOn;
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
useDropdownList({ open, name: 'LeaveRoom' });
|
31
|
+
useDropdownList({ open: open || showEndStreamAlert || showLeaveRoomAlert, name: 'LeaveRoom' });
|
29
32
|
|
30
33
|
if (!permissions || !isConnected) {
|
31
34
|
return null;
|
@@ -36,14 +39,19 @@ export const DesktopLeaveRoom = ({
|
|
36
39
|
{permissions.hlsStreaming ? (
|
37
40
|
<Flex>
|
38
41
|
<LeaveIconButton
|
39
|
-
variant="danger"
|
40
42
|
key="LeaveRoom"
|
41
43
|
data-testid="leave_room_btn"
|
42
44
|
css={{
|
43
45
|
borderTopRightRadius: 0,
|
44
46
|
borderBottomRightRadius: 0,
|
45
47
|
}}
|
46
|
-
onClick={
|
48
|
+
onClick={() => {
|
49
|
+
if (screenType === 'hls_live_streaming') {
|
50
|
+
setShowLeaveRoomAlert(true);
|
51
|
+
} else {
|
52
|
+
leaveRoom({ endstream: false });
|
53
|
+
}
|
54
|
+
}}
|
47
55
|
>
|
48
56
|
<Tooltip title="Leave Room">
|
49
57
|
<Box>
|
@@ -60,12 +68,20 @@ export const DesktopLeaveRoom = ({
|
|
60
68
|
},
|
61
69
|
}}
|
62
70
|
>
|
63
|
-
<MenuTriggerButton
|
71
|
+
<MenuTriggerButton data-testid="leave_end_dropdown_trigger">
|
64
72
|
<VerticalMenuIcon />
|
65
73
|
</MenuTriggerButton>
|
66
74
|
</Dropdown.Trigger>
|
67
75
|
<Dropdown.Content css={{ p: 0, w: '$100' }} alignOffset={-50} sideOffset={10}>
|
68
|
-
<Dropdown.Item
|
76
|
+
<Dropdown.Item
|
77
|
+
css={{
|
78
|
+
bg: '$surface_dim',
|
79
|
+
color: '$on_surface_low',
|
80
|
+
'&:hover': { bg: '$surface_default', color: '$on_surface_high' },
|
81
|
+
}}
|
82
|
+
onClick={() => leaveRoom({ endstream: false })}
|
83
|
+
data-testid="just_leave_btn"
|
84
|
+
>
|
69
85
|
<LeaveCard
|
70
86
|
title={showStream ? 'Leave Stream' : 'Leave Session'}
|
71
87
|
subtitle={`Others will continue after you leave. You can join the ${
|
@@ -73,14 +89,20 @@ export const DesktopLeaveRoom = ({
|
|
73
89
|
} again.`}
|
74
90
|
bg=""
|
75
91
|
titleColor="$on_surface_high"
|
76
|
-
subtitleColor="$on_surface_low"
|
77
92
|
icon={<ExitIcon height={24} width={24} style={{ transform: 'rotate(180deg)' }} />}
|
78
|
-
onClick={leaveRoom}
|
93
|
+
onClick={() => leaveRoom({ endstream: false })}
|
79
94
|
css={{ p: 0 }}
|
80
95
|
/>
|
81
96
|
</Dropdown.Item>
|
82
97
|
{isStreamingOn && permissions?.hlsStreaming ? (
|
83
|
-
<Dropdown.Item
|
98
|
+
<Dropdown.Item
|
99
|
+
css={{
|
100
|
+
bg: '$alert_error_dim',
|
101
|
+
color: '$alert_error_bright',
|
102
|
+
'&:hover': { bg: '$alert_error_dim', color: '$alert_error_brighter' },
|
103
|
+
}}
|
104
|
+
data-testid="end_room_btn"
|
105
|
+
>
|
84
106
|
<LeaveCard
|
85
107
|
title={showStream ? 'End Stream' : 'End Session'}
|
86
108
|
subtitle={`The ${
|
@@ -88,7 +110,6 @@ export const DesktopLeaveRoom = ({
|
|
88
110
|
} will end for everyone. You can't undo this action.`}
|
89
111
|
bg=""
|
90
112
|
titleColor="$alert_error_brighter"
|
91
|
-
subtitleColor="$alert_error_bright"
|
92
113
|
icon={<StopIcon height={24} width={24} />}
|
93
114
|
onClick={() => {
|
94
115
|
setOpen(false);
|
@@ -102,7 +123,17 @@ export const DesktopLeaveRoom = ({
|
|
102
123
|
</Dropdown.Root>
|
103
124
|
</Flex>
|
104
125
|
) : (
|
105
|
-
<LeaveIconButton
|
126
|
+
<LeaveIconButton
|
127
|
+
onClick={() => {
|
128
|
+
if (screenType === 'hls_live_streaming') {
|
129
|
+
setShowLeaveRoomAlert(true);
|
130
|
+
} else {
|
131
|
+
leaveRoom({ endstream: false });
|
132
|
+
}
|
133
|
+
}}
|
134
|
+
key="LeaveRoom"
|
135
|
+
data-testid="leave_room_btn"
|
136
|
+
>
|
106
137
|
<Tooltip title="Leave Room">
|
107
138
|
<Box>
|
108
139
|
<ExitIcon style={{ transform: 'rotate(180deg)' }} />
|
@@ -117,13 +148,24 @@ export const DesktopLeaveRoom = ({
|
|
117
148
|
<Dialog.Content css={{ w: 'min(420px, 90%)', p: '$8', bg: '$surface_dim' }}>
|
118
149
|
<EndSessionContent
|
119
150
|
setShowEndStreamAlert={setShowEndStreamAlert}
|
120
|
-
stopStream={stopStream}
|
121
151
|
leaveRoom={leaveRoom}
|
152
|
+
isStreamingOn={isStreamingOn}
|
122
153
|
isModal
|
123
154
|
/>
|
124
155
|
</Dialog.Content>
|
125
156
|
</Dialog.Portal>
|
126
157
|
</Dialog.Root>
|
158
|
+
|
159
|
+
{screenType === 'hls_live_streaming' ? (
|
160
|
+
<Dialog.Root open={showLeaveRoomAlert} modal={false}>
|
161
|
+
<Dialog.Portal>
|
162
|
+
<Dialog.Overlay />
|
163
|
+
<Dialog.Content css={{ w: 'min(420px, 90%)', p: '$8', bg: '$surface_dim' }}>
|
164
|
+
<LeaveSessionContent setShowLeaveRoomAlert={setShowLeaveRoomAlert} leaveRoom={leaveRoom} isModal />
|
165
|
+
</Dialog.Content>
|
166
|
+
</Dialog.Portal>
|
167
|
+
</Dialog.Root>
|
168
|
+
) : null}
|
127
169
|
</Fragment>
|
128
170
|
);
|
129
171
|
};
|
@@ -1,12 +1,20 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { AlertTriangleIcon, CrossIcon } from '@100mslive/react-icons';
|
3
|
-
import { Button } from '
|
4
|
-
import { Box, Flex } from '
|
5
|
-
import { Text } from '
|
6
|
-
import { useShowStreamingUI } from '../common/hooks';
|
3
|
+
import { Button } from '../../../Button';
|
4
|
+
import { Box, Flex } from '../../../Layout';
|
5
|
+
import { Text } from '../../../Text';
|
7
6
|
|
8
|
-
export const EndSessionContent = ({
|
9
|
-
|
7
|
+
export const EndSessionContent = ({
|
8
|
+
setShowEndStreamAlert,
|
9
|
+
leaveRoom,
|
10
|
+
isModal = false,
|
11
|
+
isStreamingOn = false,
|
12
|
+
}: {
|
13
|
+
setShowEndStreamAlert: (value: boolean) => void;
|
14
|
+
leaveRoom: (args: { endstream: boolean }) => void;
|
15
|
+
isModal?: boolean;
|
16
|
+
isStreamingOn: boolean;
|
17
|
+
}) => {
|
10
18
|
return (
|
11
19
|
<Box>
|
12
20
|
<Flex
|
@@ -18,7 +26,7 @@ export const EndSessionContent = ({ setShowEndStreamAlert, stopStream, leaveRoom
|
|
18
26
|
>
|
19
27
|
<AlertTriangleIcon style={{ marginRight: '0.5rem' }} />
|
20
28
|
<Text variant="lg" css={{ color: 'inherit', fontWeight: '$semiBold' }}>
|
21
|
-
End {
|
29
|
+
End {isStreamingOn ? 'Stream' : 'Session'}
|
22
30
|
</Text>
|
23
31
|
{isModal ? null : (
|
24
32
|
<Box css={{ color: '$on_surface_high', ml: 'auto' }} onClick={() => setShowEndStreamAlert(false)}>
|
@@ -27,7 +35,7 @@ export const EndSessionContent = ({ setShowEndStreamAlert, stopStream, leaveRoom
|
|
27
35
|
)}
|
28
36
|
</Flex>
|
29
37
|
<Text variant="sm" css={{ color: '$on_surface_medium', mb: '$8', mt: '$4' }}>
|
30
|
-
The {
|
38
|
+
The {isStreamingOn ? 'stream' : 'session'} will end for everyone. You can't undo this action.
|
31
39
|
</Text>
|
32
40
|
<Flex align="center" justify="between" css={{ w: '100%', gap: '$8' }}>
|
33
41
|
<Button
|
@@ -42,14 +50,13 @@ export const EndSessionContent = ({ setShowEndStreamAlert, stopStream, leaveRoom
|
|
42
50
|
variant="danger"
|
43
51
|
css={{ w: '100%' }}
|
44
52
|
onClick={async () => {
|
45
|
-
await
|
46
|
-
leaveRoom();
|
53
|
+
await leaveRoom({ endstream: true });
|
47
54
|
setShowEndStreamAlert(false);
|
48
55
|
}}
|
49
56
|
id="stopStream"
|
50
57
|
data-testid="stop_stream_btn"
|
51
58
|
>
|
52
|
-
End {
|
59
|
+
End {isStreamingOn ? 'Stream' : 'Session'}
|
53
60
|
</Button>
|
54
61
|
</Flex>
|
55
62
|
</Box>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { IconButton } from '../../../IconButton';
|
2
|
+
import { styled } from '../../../Theme';
|
3
|
+
|
4
|
+
export const LeaveIconButton = styled(IconButton, {
|
5
|
+
color: '$on_primary_high',
|
6
|
+
h: '$14',
|
7
|
+
px: '$4',
|
8
|
+
r: '$1',
|
9
|
+
bg: '$alert_error_default',
|
10
|
+
'&:not([disabled]):hover': {
|
11
|
+
bg: '$alert_error_bright',
|
12
|
+
},
|
13
|
+
'&:not([disabled]):active': {
|
14
|
+
bg: '$alert_error_default',
|
15
|
+
},
|
16
|
+
'@md': {
|
17
|
+
mx: 0,
|
18
|
+
},
|
19
|
+
});
|
20
|
+
|
21
|
+
export const MenuTriggerButton = styled(LeaveIconButton, {
|
22
|
+
borderLeft: '1px solid $alert_error_dim',
|
23
|
+
borderTopLeftRadius: 0,
|
24
|
+
borderBottomLeftRadius: 0,
|
25
|
+
px: '$2',
|
26
|
+
});
|