@100mslive/roomkit-react 0.1.6-alpha.0 → 0.1.6-alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-PY2FKWX3.js → HLSView-QMU5JK7U.js} +208 -118
- package/dist/HLSView-QMU5JK7U.js.map +7 -0
- package/dist/Prebuilt/AppContext.d.ts +1 -1
- 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 +2 -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/StreamActions.d.ts +11 -0
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +4 -3
- package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +4 -3
- package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +1 -2
- package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +3 -1
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +4 -3
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -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 +1 -1
- package/dist/Prebuilt/components/SidePaneTabs.d.ts +7 -0
- package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +1 -0
- package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +5 -3
- package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +6 -3
- package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +1 -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/useTileLayout.d.ts +2 -1
- package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +2 -0
- package/dist/Prebuilt/layouts/SidePane.d.ts +4 -1
- package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +2 -1
- package/dist/{VirtualBackground-AYDHYLIZ.js → VirtualBackground-37FXUPYO.js} +6 -6
- package/dist/VirtualBackground-37FXUPYO.js.map +7 -0
- package/dist/{chunk-GQD2AGWW.js → chunk-KBVIZGYW.js} +12 -2
- package/dist/{chunk-GQD2AGWW.js.map → chunk-KBVIZGYW.js.map} +2 -2
- package/dist/{chunk-RXTHJUMZ.js → chunk-WVGGQZK4.js} +986 -436
- package/dist/chunk-WVGGQZK4.js.map +7 -0
- package/dist/{chunk-E2M2ZSOL.js → chunk-ZKE2N5LH.js} +2 -2
- package/dist/{conference-V2XZGTKU.js → conference-FJJQ4TXX.js} +1136 -1301
- package/dist/conference-FJJQ4TXX.js.map +7 -0
- package/dist/index.cjs.js +3565 -3092
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +773 -525
- package/dist/meta.esbuild.json +833 -579
- package/package.json +8 -7
- package/src/Prebuilt/App.tsx +10 -21
- package/src/Prebuilt/AppContext.tsx +1 -1
- package/src/Prebuilt/IconButton.jsx +10 -0
- package/src/Prebuilt/common/PeersSorter.ts +1 -1
- package/src/Prebuilt/common/constants.js +1 -2
- package/src/Prebuilt/common/utils.js +1 -1
- package/src/Prebuilt/components/AppData/AppData.jsx +8 -2
- package/src/Prebuilt/components/AppData/useUISettings.js +6 -6
- package/src/Prebuilt/components/AudioVideoToggle.jsx +8 -6
- package/src/Prebuilt/components/Chat/Chat.jsx +24 -11
- package/src/Prebuilt/components/Chat/ChatBody.jsx +20 -21
- package/src/Prebuilt/components/Chat/{ChatFooter.jsx → ChatFooter.tsx} +38 -13
- 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.jsx → TileConnection.tsx} +20 -6
- package/src/Prebuilt/components/EmojiReaction.jsx +2 -6
- package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +4 -1
- package/src/Prebuilt/components/Footer/Footer.tsx +30 -5
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +15 -49
- package/src/Prebuilt/components/Footer/{RoleAccordion.jsx → RoleAccordion.tsx} +33 -17
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +1 -0
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +39 -17
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +1 -1
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +8 -1
- package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +23 -9
- package/src/Prebuilt/components/Header/common.jsx +5 -2
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +6 -1
- package/src/Prebuilt/components/InsetTile.tsx +15 -8
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +21 -11
- package/src/Prebuilt/components/Leave/EndSessionContent.tsx +2 -5
- package/src/Prebuilt/components/Leave/LeaveCard.tsx +1 -3
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +28 -25
- package/src/Prebuilt/components/Leave/LeaveSessionContent.tsx +8 -2
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +8 -8
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +4 -0
- package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +1 -1
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +9 -23
- package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +89 -28
- package/src/Prebuilt/components/Notifications/Notifications.jsx +44 -28
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
- package/src/Prebuilt/components/Pagination.tsx +14 -12
- package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +11 -2
- package/src/Prebuilt/components/Preview/PreviewForm.tsx +6 -8
- package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +44 -21
- package/src/Prebuilt/components/{RoleChangeRequestModal.jsx → RoleChangeRequestModal.tsx} +36 -17
- package/src/Prebuilt/components/ScreenshareTile.jsx +6 -7
- package/src/Prebuilt/components/SecondaryTiles.tsx +12 -10
- package/src/Prebuilt/components/SidePaneTabs.tsx +120 -0
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +1 -1
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +14 -10
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +5 -4
- package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +13 -10
- package/src/Prebuilt/components/VideoLayouts/Grid.tsx +36 -34
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +33 -15
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +45 -31
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +12 -9
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +25 -9
- package/src/Prebuilt/components/VideoLayouts/interface.ts +1 -0
- package/src/Prebuilt/components/VideoTile.jsx +45 -53
- package/src/Prebuilt/components/conference.jsx +71 -74
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -28
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
- package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +1 -1
- package/src/Prebuilt/components/hooks/useTileLayout.tsx +24 -18
- package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +4 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +1 -11
- package/src/Prebuilt/layouts/HLSView.jsx +152 -82
- package/src/Prebuilt/layouts/SidePane.tsx +25 -11
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +11 -47
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +3 -3
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +2 -2
- package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
- package/src/VideoTile/StyledVideoTile.tsx +1 -0
- package/dist/HLSView-PY2FKWX3.js.map +0 -7
- package/dist/VirtualBackground-AYDHYLIZ.js.map +0 -7
- package/dist/chunk-RXTHJUMZ.js.map +0 -7
- package/dist/conference-V2XZGTKU.js.map +0 -7
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
- package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +0 -73
- package/src/Prebuilt/components/VideoList.jsx +0 -73
- /package/dist/{chunk-E2M2ZSOL.js.map → chunk-ZKE2N5LH.js.map} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
ActionTile
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-ZKE2N5LH.js";
|
4
4
|
import {
|
5
5
|
APP_DATA,
|
6
6
|
Accordion,
|
@@ -25,6 +25,7 @@ import {
|
|
25
25
|
HorizontalDivider,
|
26
26
|
Input,
|
27
27
|
Label,
|
28
|
+
PictureInPicture,
|
28
29
|
Popover,
|
29
30
|
PreviewControls,
|
30
31
|
PreviewTile,
|
@@ -51,6 +52,7 @@ import {
|
|
51
52
|
VideoTileStats,
|
52
53
|
VideoTile_default,
|
53
54
|
getFormattedCount,
|
55
|
+
getMetadata,
|
54
56
|
getVideoTileLabel,
|
55
57
|
isAndroid,
|
56
58
|
isChrome,
|
@@ -58,31 +60,31 @@ import {
|
|
58
60
|
isIPadOS,
|
59
61
|
isInternalRole,
|
60
62
|
isMacOS,
|
61
|
-
isSafari,
|
62
63
|
isScreenshareSupported,
|
63
64
|
useAuthToken,
|
64
65
|
useDropdownList,
|
65
66
|
useDropdownSelection,
|
67
|
+
useFilteredRoles,
|
66
68
|
useHMSPrebuiltContext,
|
67
|
-
useIsHeadless,
|
68
69
|
useIsSidepaneTypeOpen,
|
69
70
|
useMyMetadata,
|
70
71
|
usePDFAnnotator,
|
72
|
+
useParticipants,
|
71
73
|
usePinnedTrack,
|
72
|
-
|
74
|
+
useRedirectToLeave,
|
73
75
|
useRoomLayoutConferencingScreen,
|
74
|
-
useRoomLayoutLeaveScreen,
|
75
76
|
useRoomLayoutPreviewScreen,
|
76
77
|
useSetAppDataByKey,
|
77
78
|
useSetSubscribedChatSelector,
|
78
79
|
useSetUiSettings,
|
80
|
+
useSidepaneReset,
|
79
81
|
useSidepaneToggle,
|
80
82
|
useTheme,
|
81
83
|
useUISettings,
|
82
84
|
useUrlToEmbed,
|
83
85
|
useUserPreferences,
|
84
86
|
useWaitingViewerRole
|
85
|
-
} from "./chunk-
|
87
|
+
} from "./chunk-WVGGQZK4.js";
|
86
88
|
import {
|
87
89
|
Box,
|
88
90
|
Flex,
|
@@ -101,27 +103,28 @@ import {
|
|
101
103
|
slideLeftAndFade,
|
102
104
|
styled,
|
103
105
|
textEllipsis
|
104
|
-
} from "./chunk-
|
106
|
+
} from "./chunk-KBVIZGYW.js";
|
105
107
|
|
106
108
|
// src/Prebuilt/components/conference.jsx
|
107
|
-
import
|
108
|
-
import { useNavigate
|
109
|
+
import React62, { useEffect as useEffect25, useRef as useRef14, useState as useState35 } from "react";
|
110
|
+
import { useNavigate, useParams } from "react-router-dom";
|
109
111
|
import { usePrevious } from "react-use";
|
110
112
|
import {
|
111
113
|
HMSRoomState,
|
112
114
|
selectAppData as selectAppData4,
|
113
|
-
selectIsConnectedToRoom as
|
115
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom7,
|
114
116
|
selectRoomState,
|
115
|
-
useHMSActions as
|
117
|
+
useHMSActions as useHMSActions22,
|
116
118
|
useHMSStore as useHMSStore36
|
117
119
|
} from "@100mslive/react-sdk";
|
118
120
|
|
119
121
|
// src/Prebuilt/components/Footer/Footer.tsx
|
120
|
-
import React36 from "react";
|
122
|
+
import React36, { Suspense, useEffect as useEffect6 } from "react";
|
121
123
|
import { useMedia as useMedia5 } from "react-use";
|
124
|
+
import { Chat_ChatState } from "@100mslive/types-prebuilt/elements/chat";
|
122
125
|
|
123
126
|
// src/Prebuilt/components/EmojiReaction.jsx
|
124
|
-
import React2, { Fragment,
|
127
|
+
import React2, { Fragment, useState } from "react";
|
125
128
|
import { useMedia } from "react-use";
|
126
129
|
import data from "@emoji-mart/data/sets/14/apple.json";
|
127
130
|
import { init } from "emoji-mart";
|
@@ -165,20 +168,18 @@ var EmojiReaction = () => {
|
|
165
168
|
const roles = useHMSStore(selectAvailableRoleNames);
|
166
169
|
const localPeerId = useHMSStore(selectLocalPeerID);
|
167
170
|
const isMobile = useMedia(config.media.md);
|
168
|
-
const onEmojiEvent = useCallback((data3) => {
|
169
|
-
window.showFlyingEmoji(data3 == null ? void 0 : data3.emojiId, data3 == null ? void 0 : data3.senderId);
|
170
|
-
}, []);
|
171
171
|
const { sendEvent } = useCustomEvent({
|
172
|
-
type: EMOJI_REACTION_TYPE
|
173
|
-
onEvent: onEmojiEvent
|
172
|
+
type: EMOJI_REACTION_TYPE
|
174
173
|
});
|
175
174
|
const sendReaction = (emojiId) => __async(void 0, null, function* () {
|
175
|
+
var _a;
|
176
176
|
const data3 = {
|
177
177
|
type: EMOJI_REACTION_TYPE,
|
178
178
|
emojiId,
|
179
179
|
senderId: localPeerId
|
180
180
|
};
|
181
181
|
sendEvent(data3, { roleNames: roles });
|
182
|
+
(_a = window.showFlyingEmoji) == null ? void 0 : _a.call(window, { emojiId, senderId: localPeerId });
|
182
183
|
});
|
183
184
|
if (!isConnected) {
|
184
185
|
return null;
|
@@ -188,405 +189,16 @@ var EmojiReaction = () => {
|
|
188
189
|
|
189
190
|
// src/Prebuilt/components/Leave/LeaveRoom.tsx
|
190
191
|
import React8 from "react";
|
191
|
-
import { useNavigate, useParams } from "react-router-dom";
|
192
192
|
import { useMedia as useMedia2 } from "react-use";
|
193
|
-
import {
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
if (!CANVAS_FILL_COLOR) {
|
203
|
-
CANVAS_FILL_COLOR = window.getComputedStyle(document.documentElement).getPropertyValue("--hms-ui-colors-surface_bright");
|
204
|
-
}
|
205
|
-
if (!CANVAS_STROKE_COLOR) {
|
206
|
-
CANVAS_STROKE_COLOR = window.getComputedStyle(document.documentElement).getPropertyValue("--hms-ui-colors-border_bright");
|
207
|
-
}
|
208
|
-
}
|
209
|
-
function resetPIPCanvasColors() {
|
210
|
-
CANVAS_FILL_COLOR = "";
|
211
|
-
CANVAS_STROKE_COLOR = "";
|
212
|
-
}
|
213
|
-
function drawVideoElementsOnCanvas(videoElements, canvas) {
|
214
|
-
let videoTiles = videoElements.filter((videoElement) => videoElement.srcObject !== null);
|
215
|
-
const ctx = canvas.getContext("2d");
|
216
|
-
setPIPCanvasColors();
|
217
|
-
ctx.fillStyle = CANVAS_FILL_COLOR;
|
218
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
219
|
-
if (videoTiles.length === 0) {
|
220
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
221
|
-
return;
|
222
|
-
}
|
223
|
-
fillGridTiles(videoTiles.slice(0, 4), ctx, canvas);
|
224
|
-
}
|
225
|
-
function dummyChangeInCanvas(canvas) {
|
226
|
-
const ctx = canvas.getContext("2d");
|
227
|
-
setPIPCanvasColors();
|
228
|
-
ctx.fillStyle = CANVAS_FILL_COLOR;
|
229
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
230
|
-
}
|
231
|
-
function fillGridTiles(videoElements, ctx, canvas) {
|
232
|
-
const offset = 8;
|
233
|
-
canvas.width = 480;
|
234
|
-
canvas.height = 320;
|
235
|
-
ctx.fillStyle = CANVAS_FILL_COLOR;
|
236
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
237
|
-
if (videoElements.length > 0) {
|
238
|
-
ctx.strokeStyle = CANVAS_STROKE_COLOR;
|
239
|
-
ctx.lineWidth = offset / 2;
|
240
|
-
ctx.strokeRect(0, 0, canvas.width, canvas.height);
|
241
|
-
}
|
242
|
-
if (videoElements.length === 1) {
|
243
|
-
const video = videoElements[0];
|
244
|
-
const { width, height } = getRenderDimensions(video, canvas.width - offset, canvas.height - offset);
|
245
|
-
const xOffset = (canvas.width - width) / 2;
|
246
|
-
const yOffset = (canvas.height - height) / 2;
|
247
|
-
ctx.drawImage(video, xOffset, yOffset, width, height);
|
248
|
-
}
|
249
|
-
if (videoElements.length === 2) {
|
250
|
-
videoElements.forEach((video, index) => {
|
251
|
-
const { width, height } = getRenderDimensions(
|
252
|
-
video,
|
253
|
-
canvas.width / 2 - offset,
|
254
|
-
// This will be the max available width for each tile
|
255
|
-
canvas.height - offset
|
256
|
-
);
|
257
|
-
const xOffset = (canvas.width / 2 - width) / 2 + canvas.width / 2 * index;
|
258
|
-
const yOffset = (canvas.height - height) / 2;
|
259
|
-
ctx.drawImage(video, xOffset, yOffset, width, height);
|
260
|
-
});
|
261
|
-
const path = new Path2D();
|
262
|
-
path.moveTo(canvas.width / 2, 0);
|
263
|
-
path.lineTo(canvas.width / 2, canvas.height);
|
264
|
-
ctx.stroke(path);
|
265
|
-
}
|
266
|
-
if (videoElements.length === 3) {
|
267
|
-
videoElements.forEach((video, index) => {
|
268
|
-
const { width, height } = getRenderDimensions(video, canvas.width / 2 - offset, canvas.height / 2 - offset);
|
269
|
-
const xOffset = index < 2 ? (canvas.width / 2 - width) / 2 + canvas.width / 2 * index : canvas.width / 2 - width / 2;
|
270
|
-
const yOffset = (index < 2 ? 0 : canvas.height / 2) + (canvas.height / 2 - height) / 2;
|
271
|
-
ctx.drawImage(video, xOffset, yOffset, width, height);
|
272
|
-
});
|
273
|
-
const path = new Path2D();
|
274
|
-
path.moveTo(canvas.width / 2, 0);
|
275
|
-
path.lineTo(canvas.width / 2, canvas.height / 2);
|
276
|
-
ctx.stroke(path);
|
277
|
-
path.moveTo(0, canvas.height / 2);
|
278
|
-
path.lineTo(canvas.width, canvas.height / 2);
|
279
|
-
ctx.stroke(path);
|
280
|
-
}
|
281
|
-
if (videoElements.length === 4) {
|
282
|
-
videoElements.forEach((video, index) => {
|
283
|
-
const { width, height } = getRenderDimensions(video, canvas.width / 2 - offset, canvas.height / 2 - offset);
|
284
|
-
const xOffset = (canvas.width / 2 - width) / 2 + canvas.width / 2 * (index % 2);
|
285
|
-
const yOffset = (index < 2 ? 0 : canvas.height / 2) + (canvas.height / 2 - height) / 2;
|
286
|
-
ctx.drawImage(video, xOffset, yOffset, width, height);
|
287
|
-
});
|
288
|
-
const path = new Path2D();
|
289
|
-
path.moveTo(canvas.width / 2, 0);
|
290
|
-
path.lineTo(canvas.width / 2, canvas.height);
|
291
|
-
ctx.stroke(path);
|
292
|
-
path.moveTo(0, canvas.height / 2);
|
293
|
-
path.lineTo(canvas.width, canvas.height / 2);
|
294
|
-
ctx.stroke(path);
|
295
|
-
}
|
296
|
-
}
|
297
|
-
function getRenderDimensions(video, width, height) {
|
298
|
-
let finalWidth = video.videoWidth / video.videoHeight * height;
|
299
|
-
let finalHeight = height;
|
300
|
-
if (finalWidth > width) {
|
301
|
-
finalWidth = width;
|
302
|
-
finalHeight = video.videoHeight / video.videoWidth * width;
|
303
|
-
}
|
304
|
-
return { width: finalWidth, height: finalHeight };
|
305
|
-
}
|
306
|
-
|
307
|
-
// src/Prebuilt/components/PIP/PIPManager.js
|
308
|
-
var MAX_NUMBER_OF_TILES_IN_PIP = 4;
|
309
|
-
var DEFAULT_FPS = 30;
|
310
|
-
var DEFAULT_CANVAS_WIDTH = 480;
|
311
|
-
var DEFAULT_CANVAS_HEIGHT = 320;
|
312
|
-
var LEAVE_EVENT_NAME = "leavepictureinpicture";
|
313
|
-
var PIPStates = {
|
314
|
-
starting: "starting",
|
315
|
-
started: "started",
|
316
|
-
stopping: "stopping",
|
317
|
-
stopped: "stopped"
|
318
|
-
};
|
319
|
-
var PipManager = class {
|
320
|
-
constructor() {
|
321
|
-
__publicField(this, "listeners", /* @__PURE__ */ new Set());
|
322
|
-
__publicField(this, "stop", () => __async(this, null, function* () {
|
323
|
-
var _a;
|
324
|
-
if (this.state === PIPStates.stopped) {
|
325
|
-
return;
|
326
|
-
}
|
327
|
-
this.state = PIPStates.stopping;
|
328
|
-
(_a = this.pipVideo) == null ? void 0 : _a.removeEventListener(LEAVE_EVENT_NAME, this.stop);
|
329
|
-
if (this.timeoutRef) {
|
330
|
-
workerTimers.clearTimeout(this.timeoutRef);
|
331
|
-
this.timeoutRef = null;
|
332
|
-
}
|
333
|
-
if (this.isOn()) {
|
334
|
-
this.exitPIP();
|
335
|
-
}
|
336
|
-
yield this.detachOldAttachNewTracks(this.tracksToShow, []);
|
337
|
-
this.onStateChange(false);
|
338
|
-
this.callListeners(false);
|
339
|
-
this.reset();
|
340
|
-
this.state = PIPStates.stopped;
|
341
|
-
}));
|
342
|
-
// ------- Private function --------------
|
343
|
-
/**
|
344
|
-
* @private {boolean} on - whether pip is on/off
|
345
|
-
*/
|
346
|
-
__publicField(this, "callListeners", (on) => {
|
347
|
-
this.listeners.forEach((listener) => listener == null ? void 0 : listener(on));
|
348
|
-
});
|
349
|
-
this.reset();
|
350
|
-
}
|
351
|
-
listenToStateChange(cb) {
|
352
|
-
this.listeners.add(cb);
|
353
|
-
}
|
354
|
-
/**
|
355
|
-
* @private
|
356
|
-
*/
|
357
|
-
reset() {
|
358
|
-
console.debug("resetting PIP state");
|
359
|
-
resetPIPCanvasColors();
|
360
|
-
this.canvas = null;
|
361
|
-
this.pipVideo = null;
|
362
|
-
this.timeoutRef = null;
|
363
|
-
this.hmsActions = null;
|
364
|
-
this.videoElements = [];
|
365
|
-
this.tracksToShow = [];
|
366
|
-
this.onStateChange = () => {
|
367
|
-
};
|
368
|
-
this.state = PIPStates.stopped;
|
369
|
-
}
|
370
|
-
/**
|
371
|
-
* check if PIP is supported in this browser env
|
372
|
-
*/
|
373
|
-
isSupported() {
|
374
|
-
return !!document.pictureInPictureEnabled && !isIOS && !(isMacOS && isSafari);
|
375
|
-
}
|
376
|
-
/**
|
377
|
-
* check if pip is currently turned on
|
378
|
-
*/
|
379
|
-
isOn() {
|
380
|
-
return !!document.pictureInPictureElement;
|
381
|
-
}
|
382
|
-
/**
|
383
|
-
* request browser to start pip and start the render loop updating the pip
|
384
|
-
* video element with peer tracks.
|
385
|
-
* @param hmsActions
|
386
|
-
* @param onStateChangeFn {function(bool):void} callback called to notify change in pip state
|
387
|
-
*/
|
388
|
-
start(hmsActions, onStateChangeFn) {
|
389
|
-
return __async(this, null, function* () {
|
390
|
-
if (!this.isSupported()) {
|
391
|
-
throw new Error("pip is not supported on this browser");
|
392
|
-
}
|
393
|
-
console.debug("starting PIP, current state", this.state);
|
394
|
-
if (this.state === PIPStates.started) {
|
395
|
-
yield this.stop();
|
396
|
-
} else if (this.state === PIPStates.starting) {
|
397
|
-
return;
|
398
|
-
}
|
399
|
-
this.state = PIPStates.starting;
|
400
|
-
try {
|
401
|
-
yield this.init(hmsActions, onStateChangeFn);
|
402
|
-
this.pipVideo.addEventListener(LEAVE_EVENT_NAME, this.stop);
|
403
|
-
this.renderLoop();
|
404
|
-
if (!this.isOn()) {
|
405
|
-
yield this.requestPIP();
|
406
|
-
}
|
407
|
-
console.debug("pip started");
|
408
|
-
this.state = PIPStates.started;
|
409
|
-
this.onStateChange(true);
|
410
|
-
this.callListeners(true);
|
411
|
-
} catch (err) {
|
412
|
-
console.error("error in request pip", err);
|
413
|
-
this.state = PIPStates.stopped;
|
414
|
-
}
|
415
|
-
});
|
416
|
-
}
|
417
|
-
/**
|
418
|
-
* @param peers {Array} All Remote Peers present in call.
|
419
|
-
* @param tracksMap {Object} map of track id to track
|
420
|
-
* */
|
421
|
-
updatePeersAndTracks(peers, tracksMap) {
|
422
|
-
return __async(this, null, function* () {
|
423
|
-
if (!this.canvas) {
|
424
|
-
return;
|
425
|
-
}
|
426
|
-
const newTracksToShowUnordered = this.pickTracksToShow(peers, tracksMap);
|
427
|
-
const currentTracksShowing = this.tracksToShow;
|
428
|
-
this.tracksToShow = this.orderNewTracksToShow(newTracksToShowUnordered, currentTracksShowing);
|
429
|
-
try {
|
430
|
-
yield this.detachOldAttachNewTracks(currentTracksShowing, this.tracksToShow, tracksMap);
|
431
|
-
} catch (error) {
|
432
|
-
console.error("error in detaching/attaching tracks", error);
|
433
|
-
}
|
434
|
-
});
|
435
|
-
}
|
436
|
-
/**
|
437
|
-
* @private
|
438
|
-
*/
|
439
|
-
init(hmsActions, onStateChangeFn) {
|
440
|
-
return __async(this, null, function* () {
|
441
|
-
yield this.initMediaElements();
|
442
|
-
this.hmsActions = hmsActions;
|
443
|
-
this.onStateChange = onStateChangeFn;
|
444
|
-
});
|
445
|
-
}
|
446
|
-
initMediaElements() {
|
447
|
-
return __async(this, null, function* () {
|
448
|
-
if (!this.canvas) {
|
449
|
-
const { canvas, pipVideo } = this.initializeCanvasAndVideoElement();
|
450
|
-
this.canvas = canvas;
|
451
|
-
this.pipVideo = pipVideo;
|
452
|
-
this.videoElements = this.initializeVideoElements();
|
453
|
-
const videoPlayPromise = this.pipVideo.play();
|
454
|
-
dummyChangeInCanvas(this.canvas);
|
455
|
-
yield videoPlayPromise;
|
456
|
-
}
|
457
|
-
});
|
458
|
-
}
|
459
|
-
initializeCanvasAndVideoElement() {
|
460
|
-
const canvas = document.createElement("canvas");
|
461
|
-
canvas.width = DEFAULT_CANVAS_WIDTH;
|
462
|
-
canvas.height = DEFAULT_CANVAS_HEIGHT;
|
463
|
-
const pipVideo = document.createElement("video");
|
464
|
-
pipVideo.width = DEFAULT_CANVAS_WIDTH;
|
465
|
-
pipVideo.height = DEFAULT_CANVAS_HEIGHT;
|
466
|
-
pipVideo.muted = true;
|
467
|
-
pipVideo.srcObject = canvas.captureStream();
|
468
|
-
return { canvas, pipVideo };
|
469
|
-
}
|
470
|
-
initializeVideoElements() {
|
471
|
-
let videoElements = [];
|
472
|
-
for (let i = 0; i < MAX_NUMBER_OF_TILES_IN_PIP; i++) {
|
473
|
-
const videoElement = document.createElement("video");
|
474
|
-
videoElement.autoplay = true;
|
475
|
-
videoElement.playsinline = true;
|
476
|
-
videoElements.push(videoElement);
|
477
|
-
}
|
478
|
-
return videoElements;
|
479
|
-
}
|
480
|
-
/**
|
481
|
-
* render loop is responsible for rendering the video elements on canvas/pip.
|
482
|
-
* in each loop current video elements are stitched and painted on canvas
|
483
|
-
*/
|
484
|
-
renderLoop() {
|
485
|
-
const delay = 1e3 / DEFAULT_FPS;
|
486
|
-
this.timeoutRef = workerTimers.setTimeout(() => {
|
487
|
-
if (this.state === PIPStates.stopping || this.state === PIPStates.stopped) {
|
488
|
-
return;
|
489
|
-
}
|
490
|
-
if (this.state === PIPStates.started) {
|
491
|
-
drawVideoElementsOnCanvas(this.videoElements, this.canvas);
|
492
|
-
}
|
493
|
-
this.renderLoop();
|
494
|
-
}, delay);
|
495
|
-
}
|
496
|
-
requestPIP() {
|
497
|
-
return __async(this, null, function* () {
|
498
|
-
try {
|
499
|
-
if (this.isOn()) {
|
500
|
-
this.exitPIP();
|
501
|
-
}
|
502
|
-
yield this.pipVideo.requestPictureInPicture();
|
503
|
-
} catch (error) {
|
504
|
-
console.error("error in requestpip", error, "state", this.state);
|
505
|
-
throw error;
|
506
|
-
}
|
507
|
-
});
|
508
|
-
}
|
509
|
-
exitPIP() {
|
510
|
-
document.exitPictureInPicture();
|
511
|
-
}
|
512
|
-
/**
|
513
|
-
* Logic - pick only enabled video tracks
|
514
|
-
* @param peers {Array<any>}
|
515
|
-
* @param tracksMap {Record<string, any>}
|
516
|
-
*/
|
517
|
-
pickTracksToShow(peers, tracksMap) {
|
518
|
-
var _a;
|
519
|
-
const tracksToShow = [];
|
520
|
-
for (const peer of peers) {
|
521
|
-
if (tracksToShow.length === MAX_NUMBER_OF_TILES_IN_PIP) {
|
522
|
-
break;
|
523
|
-
} else if (peer.videoTrack && ((_a = tracksMap[peer.videoTrack]) == null ? void 0 : _a.enabled)) {
|
524
|
-
tracksToShow.push(peer.videoTrack);
|
525
|
-
}
|
526
|
-
}
|
527
|
-
return tracksToShow;
|
528
|
-
}
|
529
|
-
/**
|
530
|
-
* there has to be a smart reordering of new tracks based on currently showing
|
531
|
-
* ones to reduce unnecessary displacement. If someone was showing up both
|
532
|
-
* earlier and now, it's a better UX to keep their position same instead
|
533
|
-
* of letting it change.
|
534
|
-
* The returned array is a shuffled version of newTracks with position of
|
535
|
-
* tracks present in the old tracks intact.
|
536
|
-
* eg. old = [1,5,9,3], new = [3,8,2,9], result = [8,2,9,3]
|
537
|
-
* @param oldTracks {Array}
|
538
|
-
* @param newTracks {Array}
|
539
|
-
* @return {Array}
|
540
|
-
*/
|
541
|
-
orderNewTracksToShow(newTracks, oldTracks) {
|
542
|
-
const betterNewTracks = [];
|
543
|
-
const leftOvers = [];
|
544
|
-
newTracks.forEach((track) => {
|
545
|
-
const oldPosition = oldTracks.indexOf(track);
|
546
|
-
if (oldPosition !== -1 && oldPosition < newTracks.length) {
|
547
|
-
betterNewTracks[oldPosition] = track;
|
548
|
-
} else {
|
549
|
-
leftOvers.push(track);
|
550
|
-
}
|
551
|
-
});
|
552
|
-
for (let i = 0; i < newTracks.length; i++) {
|
553
|
-
if (!betterNewTracks[i]) {
|
554
|
-
betterNewTracks[i] = leftOvers.shift();
|
555
|
-
}
|
556
|
-
}
|
557
|
-
return betterNewTracks;
|
558
|
-
}
|
559
|
-
/**
|
560
|
-
* call detach for tracks which no longer need to be shown and attach for
|
561
|
-
* new ones which are to be shown now.
|
562
|
-
* Note: oldTracks and newTracks are not necessarily of same length
|
563
|
-
* @param oldTracks {Array<String>}
|
564
|
-
* @param newTracks {Array<String>}
|
565
|
-
* @param tracksMap {Record<String, any>}
|
566
|
-
*/
|
567
|
-
// eslint-disable-next-line complexity
|
568
|
-
detachOldAttachNewTracks(oldTracks, newTracks, tracksMap = null) {
|
569
|
-
return __async(this, null, function* () {
|
570
|
-
const numTracks = Math.max(oldTracks.length, newTracks.length);
|
571
|
-
for (let i = 0; i < numTracks; i++) {
|
572
|
-
if (oldTracks[i] === newTracks[i]) {
|
573
|
-
continue;
|
574
|
-
} else if (oldTracks[i]) {
|
575
|
-
if (!tracksMap || tracksMap[oldTracks[i]]) {
|
576
|
-
yield this.hmsActions.detachVideo(oldTracks[i], this.videoElements[i]);
|
577
|
-
}
|
578
|
-
if (this.videoElements[i]) {
|
579
|
-
this.videoElements[i].srcObject = null;
|
580
|
-
}
|
581
|
-
}
|
582
|
-
if (newTracks[i]) {
|
583
|
-
yield this.hmsActions.attachVideo(newTracks[i], this.videoElements[i]);
|
584
|
-
}
|
585
|
-
}
|
586
|
-
});
|
587
|
-
}
|
588
|
-
};
|
589
|
-
var PictureInPicture = new PipManager();
|
193
|
+
import {
|
194
|
+
selectHLSState,
|
195
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom4,
|
196
|
+
selectPeersByCondition,
|
197
|
+
selectPermissions as selectPermissions3,
|
198
|
+
selectRolesMap,
|
199
|
+
useHMSActions,
|
200
|
+
useHMSStore as useHMSStore4
|
201
|
+
} from "@100mslive/react-sdk";
|
590
202
|
|
591
203
|
// src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx
|
592
204
|
import React6, { Fragment as Fragment2, useState as useState2 } from "react";
|
@@ -598,7 +210,6 @@ import React3 from "react";
|
|
598
210
|
import { AlertTriangleIcon, CrossIcon } from "@100mslive/react-icons";
|
599
211
|
var EndSessionContent = ({
|
600
212
|
setShowEndStreamAlert,
|
601
|
-
stopStream,
|
602
213
|
leaveRoom,
|
603
214
|
isModal = false,
|
604
215
|
isStreamingOn = false
|
@@ -630,8 +241,7 @@ var EndSessionContent = ({
|
|
630
241
|
variant: "danger",
|
631
242
|
css: { w: "100%" },
|
632
243
|
onClick: () => __async(void 0, null, function* () {
|
633
|
-
yield
|
634
|
-
leaveRoom();
|
244
|
+
yield leaveRoom({ endstream: true });
|
635
245
|
setShowEndStreamAlert(false);
|
636
246
|
}),
|
637
247
|
id: "stopStream",
|
@@ -675,10 +285,9 @@ var LeaveCard = ({
|
|
675
285
|
onClick,
|
676
286
|
bg,
|
677
287
|
titleColor,
|
678
|
-
subtitleColor,
|
679
288
|
css = {}
|
680
289
|
}) => {
|
681
|
-
return /* @__PURE__ */ React4.createElement(Flex, { css: __spreadValues({ p: "$10", flexGrow: 1, gap: "$8", bg }, css), onClick }, /* @__PURE__ */ React4.createElement(Box, { css: { color: titleColor } }, icon), /* @__PURE__ */ React4.createElement(Box, { css: { gap: "$2" } }, /* @__PURE__ */ React4.createElement(Text, { variant: "lg", css: { color: titleColor } }, title), /* @__PURE__ */ React4.createElement(Text, { variant: "sm", css: {
|
290
|
+
return /* @__PURE__ */ React4.createElement(Flex, { css: __spreadValues({ p: "$10", flexGrow: 1, gap: "$8", bg }, css), onClick }, /* @__PURE__ */ React4.createElement(Box, { css: { color: titleColor } }, icon), /* @__PURE__ */ React4.createElement(Box, { css: { gap: "$2" } }, /* @__PURE__ */ React4.createElement(Text, { variant: "lg", css: { color: titleColor } }, title), /* @__PURE__ */ React4.createElement(Text, { variant: "sm", css: { c: "inherit" } }, subtitle)));
|
682
291
|
};
|
683
292
|
|
684
293
|
// src/Prebuilt/components/Leave/LeaveSessionContent.tsx
|
@@ -710,13 +319,22 @@ var LeaveSessionContent = ({
|
|
710
319
|
onClick: () => setShowLeaveRoomAlert(false)
|
711
320
|
},
|
712
321
|
"Cancel"
|
713
|
-
), /* @__PURE__ */ React5.createElement(
|
322
|
+
), /* @__PURE__ */ React5.createElement(
|
323
|
+
Button,
|
324
|
+
{
|
325
|
+
variant: "danger",
|
326
|
+
css: { w: "100%" },
|
327
|
+
onClick: () => leaveRoom({ endstream: false }),
|
328
|
+
id: "leaveRoom",
|
329
|
+
"data-testid": "leave_room"
|
330
|
+
},
|
331
|
+
"Leave Session"
|
332
|
+
)));
|
714
333
|
};
|
715
334
|
|
716
335
|
// src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx
|
717
336
|
var DesktopLeaveRoom = ({
|
718
337
|
leaveRoom,
|
719
|
-
stopStream,
|
720
338
|
screenType
|
721
339
|
}) => {
|
722
340
|
const [open, setOpen] = useState2(false);
|
@@ -743,7 +361,7 @@ var DesktopLeaveRoom = ({
|
|
743
361
|
if (screenType === "hls_live_streaming") {
|
744
362
|
setShowLeaveRoomAlert(true);
|
745
363
|
} else {
|
746
|
-
leaveRoom();
|
364
|
+
leaveRoom({ endstream: false });
|
747
365
|
}
|
748
366
|
}
|
749
367
|
},
|
@@ -759,41 +377,62 @@ var DesktopLeaveRoom = ({
|
|
759
377
|
}
|
760
378
|
},
|
761
379
|
/* @__PURE__ */ React6.createElement(MenuTriggerButton, { "data-testid": "leave_end_dropdown_trigger" }, /* @__PURE__ */ React6.createElement(VerticalMenuIcon, null))
|
762
|
-
), /* @__PURE__ */ React6.createElement(Dropdown.Content, { css: { p: 0, w: "$100" }, alignOffset: -50, sideOffset: 10 }, /* @__PURE__ */ React6.createElement(
|
763
|
-
|
380
|
+
), /* @__PURE__ */ React6.createElement(Dropdown.Content, { css: { p: 0, w: "$100" }, alignOffset: -50, sideOffset: 10 }, /* @__PURE__ */ React6.createElement(
|
381
|
+
Dropdown.Item,
|
764
382
|
{
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
383
|
+
css: {
|
384
|
+
bg: "$surface_dim",
|
385
|
+
color: "$on_surface_low",
|
386
|
+
"&:hover": { bg: "$surface_default", color: "$on_surface_high" }
|
387
|
+
},
|
388
|
+
onClick: () => leaveRoom({ endstream: false }),
|
389
|
+
"data-testid": "just_leave_btn"
|
390
|
+
},
|
391
|
+
/* @__PURE__ */ React6.createElement(
|
392
|
+
LeaveCard,
|
393
|
+
{
|
394
|
+
title: showStream ? "Leave Stream" : "Leave Session",
|
395
|
+
subtitle: `Others will continue after you leave. You can join the ${showStream ? "stream" : "session"} again.`,
|
396
|
+
bg: "",
|
397
|
+
titleColor: "$on_surface_high",
|
398
|
+
icon: /* @__PURE__ */ React6.createElement(ExitIcon, { height: 24, width: 24, style: { transform: "rotate(180deg)" } }),
|
399
|
+
onClick: () => leaveRoom({ endstream: false }),
|
400
|
+
css: { p: 0 }
|
401
|
+
}
|
402
|
+
)
|
403
|
+
), isStreamingOn && (permissions == null ? void 0 : permissions.hlsStreaming) ? /* @__PURE__ */ React6.createElement(
|
404
|
+
Dropdown.Item,
|
776
405
|
{
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
subtitleColor: "$alert_error_bright",
|
782
|
-
icon: /* @__PURE__ */ React6.createElement(StopIcon, { height: 24, width: 24 }),
|
783
|
-
onClick: () => {
|
784
|
-
setOpen(false);
|
785
|
-
setShowEndStreamAlert(true);
|
406
|
+
css: {
|
407
|
+
bg: "$alert_error_dim",
|
408
|
+
color: "$alert_error_bright",
|
409
|
+
"&:hover": { bg: "$alert_error_dim", color: "$alert_error_brighter" }
|
786
410
|
},
|
787
|
-
|
788
|
-
}
|
789
|
-
|
411
|
+
"data-testid": "end_room_btn"
|
412
|
+
},
|
413
|
+
/* @__PURE__ */ React6.createElement(
|
414
|
+
LeaveCard,
|
415
|
+
{
|
416
|
+
title: showStream ? "End Stream" : "End Session",
|
417
|
+
subtitle: `The ${showStream ? "stream" : "session"} will end for everyone. You can't undo this action.`,
|
418
|
+
bg: "",
|
419
|
+
titleColor: "$alert_error_brighter",
|
420
|
+
icon: /* @__PURE__ */ React6.createElement(StopIcon, { height: 24, width: 24 }),
|
421
|
+
onClick: () => {
|
422
|
+
setOpen(false);
|
423
|
+
setShowEndStreamAlert(true);
|
424
|
+
},
|
425
|
+
css: { p: 0 }
|
426
|
+
}
|
427
|
+
)
|
428
|
+
) : null))) : /* @__PURE__ */ React6.createElement(
|
790
429
|
LeaveIconButton,
|
791
430
|
{
|
792
431
|
onClick: () => {
|
793
432
|
if (screenType === "hls_live_streaming") {
|
794
433
|
setShowLeaveRoomAlert(true);
|
795
434
|
} else {
|
796
|
-
leaveRoom();
|
435
|
+
leaveRoom({ endstream: false });
|
797
436
|
}
|
798
437
|
},
|
799
438
|
key: "LeaveRoom",
|
@@ -804,7 +443,6 @@ var DesktopLeaveRoom = ({
|
|
804
443
|
EndSessionContent,
|
805
444
|
{
|
806
445
|
setShowEndStreamAlert,
|
807
|
-
stopStream,
|
808
446
|
leaveRoom,
|
809
447
|
isStreamingOn,
|
810
448
|
isModal: true
|
@@ -818,7 +456,6 @@ import { selectIsConnectedToRoom as selectIsConnectedToRoom3, selectPermissions
|
|
818
456
|
import { ExitIcon as ExitIcon2, StopIcon as StopIcon2 } from "@100mslive/react-icons";
|
819
457
|
var MwebLeaveRoom = ({
|
820
458
|
leaveRoom,
|
821
|
-
stopStream,
|
822
459
|
screenType
|
823
460
|
}) => {
|
824
461
|
const [open, setOpen] = useState3(false);
|
@@ -850,10 +487,9 @@ var MwebLeaveRoom = ({
|
|
850
487
|
subtitle: `Others will continue after you leave. You can join the ${showStream ? "stream" : "session"} again.`,
|
851
488
|
bg: "$surface_default",
|
852
489
|
titleColor: "$on_surface_high",
|
853
|
-
subtitleColor: "$on_surface_low",
|
854
490
|
icon: /* @__PURE__ */ React7.createElement(ExitIcon2, { height: 24, width: 24, style: { transform: "rotate(180deg)" } }),
|
855
|
-
onClick: leaveRoom,
|
856
|
-
css: { pt: 0, mt: "$10" }
|
491
|
+
onClick: () => leaveRoom({ endstream: false }),
|
492
|
+
css: { pt: 0, mt: "$10", color: "$on_surface_low", "&:hover": { color: "$on_surface_high" } }
|
857
493
|
}
|
858
494
|
), isStreamingOn && (permissions == null ? void 0 : permissions.hlsStreaming) ? /* @__PURE__ */ React7.createElement(
|
859
495
|
LeaveCard,
|
@@ -862,7 +498,7 @@ var MwebLeaveRoom = ({
|
|
862
498
|
subtitle: `The will end the ${showStream ? "stream" : "session"} for everyone. You can't undo this action.`,
|
863
499
|
bg: "$alert_error_dim",
|
864
500
|
titleColor: "$alert_error_brighter",
|
865
|
-
|
501
|
+
css: { color: "$alert_error_bright", "&:hover": { color: "$alert_error_brighter" } },
|
866
502
|
icon: /* @__PURE__ */ React7.createElement(StopIcon2, { height: 24, width: 24 }),
|
867
503
|
onClick: () => {
|
868
504
|
setOpen(false);
|
@@ -877,6 +513,8 @@ var MwebLeaveRoom = ({
|
|
877
513
|
onClick: () => {
|
878
514
|
if (screenType === "hls_live_streaming") {
|
879
515
|
setShowLeaveRoomAlert(true);
|
516
|
+
} else {
|
517
|
+
leaveRoom({ endstream: false });
|
880
518
|
}
|
881
519
|
}
|
882
520
|
},
|
@@ -885,7 +523,6 @@ var MwebLeaveRoom = ({
|
|
885
523
|
EndSessionContent,
|
886
524
|
{
|
887
525
|
setShowEndStreamAlert,
|
888
|
-
stopStream,
|
889
526
|
leaveRoom,
|
890
527
|
isStreamingOn
|
891
528
|
}
|
@@ -894,14 +531,20 @@ var MwebLeaveRoom = ({
|
|
894
531
|
|
895
532
|
// src/Prebuilt/components/Leave/LeaveRoom.tsx
|
896
533
|
var LeaveRoom = ({ screenType }) => {
|
897
|
-
const navigate = useNavigate();
|
898
|
-
const params = useParams();
|
899
534
|
const isConnected = useHMSStore4(selectIsConnectedToRoom4);
|
900
535
|
const permissions = useHMSStore4(selectPermissions3);
|
901
536
|
const isMobile = useMedia2(config.media.md);
|
537
|
+
const rolesMap = useHMSStore4(selectRolesMap);
|
538
|
+
const streamingPermissionRoles = Object.keys(rolesMap).filter((roleName) => {
|
539
|
+
const roleObj = rolesMap[roleName];
|
540
|
+
return roleObj.permissions.hlsStreaming;
|
541
|
+
});
|
542
|
+
const peersWithStreamingRights = useHMSStore4(
|
543
|
+
selectPeersByCondition((peer) => streamingPermissionRoles.includes(peer.roleName || ""))
|
544
|
+
);
|
545
|
+
const hlsState = useHMSStore4(selectHLSState);
|
902
546
|
const hmsActions = useHMSActions();
|
903
|
-
const {
|
904
|
-
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
547
|
+
const { redirectToLeave } = useRedirectToLeave();
|
905
548
|
const stopStream = () => __async(void 0, null, function* () {
|
906
549
|
try {
|
907
550
|
console.log("Stopping HLS stream");
|
@@ -912,25 +555,17 @@ var LeaveRoom = ({ screenType }) => {
|
|
912
555
|
ToastManager.addToast({ title: "Error in stopping the stream", type: "error" });
|
913
556
|
}
|
914
557
|
});
|
915
|
-
const
|
916
|
-
|
917
|
-
|
918
|
-
navigate(prefix + params.roomId + "/" + params.role);
|
919
|
-
} else {
|
920
|
-
navigate(prefix + params.roomId);
|
558
|
+
const leaveRoom = (_0) => __async(void 0, [_0], function* ({ endstream = false }) {
|
559
|
+
if (endstream || hlsState.running && peersWithStreamingRights.length === 1) {
|
560
|
+
yield stopStream();
|
921
561
|
}
|
922
|
-
PictureInPicture.stop().catch(() => console.error("stopping pip"));
|
923
|
-
ToastManager.clearAllToast();
|
924
|
-
onLeave == null ? void 0 : onLeave();
|
925
|
-
};
|
926
|
-
const leaveRoom = () => {
|
927
562
|
hmsActions.leave();
|
928
|
-
|
929
|
-
};
|
563
|
+
redirectToLeave();
|
564
|
+
});
|
930
565
|
if (!permissions || !isConnected) {
|
931
566
|
return null;
|
932
567
|
}
|
933
|
-
return isMobile ? /* @__PURE__ */ React8.createElement(MwebLeaveRoom, { leaveRoom,
|
568
|
+
return isMobile ? /* @__PURE__ */ React8.createElement(MwebLeaveRoom, { leaveRoom, screenType }) : /* @__PURE__ */ React8.createElement(DesktopLeaveRoom, { leaveRoom, screenType });
|
934
569
|
};
|
935
570
|
|
936
571
|
// src/Prebuilt/components/MoreSettings/MoreSettings.tsx
|
@@ -938,16 +573,16 @@ import React23 from "react";
|
|
938
573
|
import { useMedia as useMedia3 } from "react-use";
|
939
574
|
|
940
575
|
// src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx
|
941
|
-
import React21, { Fragment as Fragment4, useState as
|
576
|
+
import React21, { Fragment as Fragment4, useState as useState13 } from "react";
|
942
577
|
import { HMSHLSPlayer } from "@100mslive/hls-player";
|
943
|
-
import { selectAppData, selectLocalPeerID as selectLocalPeerID3, useHMSActions as useHMSActions8, useHMSStore as
|
944
|
-
import { BrbIcon, CheckIcon as CheckIcon3, DragHandleIcon,
|
578
|
+
import { selectAppData, selectLocalPeerID as selectLocalPeerID3, useHMSActions as useHMSActions8, useHMSStore as useHMSStore10 } from "@100mslive/react-sdk";
|
579
|
+
import { BrbIcon, CheckIcon as CheckIcon3, DragHandleIcon, InfoIcon as InfoIcon2, PipIcon as PipIcon2, SettingsIcon as SettingsIcon2 } from "@100mslive/react-icons";
|
945
580
|
|
946
581
|
// src/Prebuilt/components/PIP/index.jsx
|
947
582
|
import React10 from "react";
|
948
583
|
|
949
584
|
// src/Prebuilt/components/PIP/PIPComponent.jsx
|
950
|
-
import React9, { useCallback
|
585
|
+
import React9, { useCallback, useEffect, useState as useState4 } from "react";
|
951
586
|
import { selectPeers, selectTracksMap, useHMSActions as useHMSActions2, useHMSStore as useHMSStore5, useHMSVanillaStore } from "@100mslive/react-sdk";
|
952
587
|
import { PipIcon } from "@100mslive/react-icons";
|
953
588
|
|
@@ -1010,7 +645,7 @@ var PIPComponent = ({ content = null }) => {
|
|
1010
645
|
const [isPipOn, setIsPipOn] = useState4(PictureInPicture.isOn());
|
1011
646
|
const hmsActions = useHMSActions2();
|
1012
647
|
const store = useHMSVanillaStore();
|
1013
|
-
const onPipToggle =
|
648
|
+
const onPipToggle = useCallback(() => {
|
1014
649
|
if (!isPipOn) {
|
1015
650
|
PictureInPicture.start(hmsActions, setIsPipOn).catch((err) => console.error("error in starting pip", err));
|
1016
651
|
MediaSession.setup(hmsActions, store);
|
@@ -1053,57 +688,9 @@ var PIP = ({ content = null }) => {
|
|
1053
688
|
};
|
1054
689
|
|
1055
690
|
// src/Prebuilt/components/RoleChangeModal.jsx
|
1056
|
-
import React11, { forwardRef, useRef
|
1057
|
-
import { selectPeerByID, useHMSActions as useHMSActions3, useHMSStore as
|
691
|
+
import React11, { forwardRef, useRef, useState as useState5 } from "react";
|
692
|
+
import { selectPeerByID, useHMSActions as useHMSActions3, useHMSStore as useHMSStore6 } from "@100mslive/react-sdk";
|
1058
693
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "@100mslive/react-icons";
|
1059
|
-
|
1060
|
-
// src/Prebuilt/common/hooks.js
|
1061
|
-
import { useEffect as useEffect2, useRef, useState as useState5 } from "react";
|
1062
|
-
import { JoinForm_JoinBtnType } from "@100mslive/types-prebuilt/elements/join_form";
|
1063
|
-
import {
|
1064
|
-
selectAvailableRoleNames as selectAvailableRoleNames2,
|
1065
|
-
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
1066
|
-
selectPeerCount,
|
1067
|
-
selectPeerMetadata,
|
1068
|
-
selectPeers as selectPeers2,
|
1069
|
-
selectRemotePeers,
|
1070
|
-
useHMSStore as useHMSStore6,
|
1071
|
-
useHMSVanillaStore as useHMSVanillaStore2
|
1072
|
-
} from "@100mslive/react-sdk";
|
1073
|
-
var useFilteredRoles = () => {
|
1074
|
-
const roles = useHMSStore6(selectAvailableRoleNames2).filter((role) => !isInternalRole(role));
|
1075
|
-
return roles;
|
1076
|
-
};
|
1077
|
-
var useShowStreamingUI = () => {
|
1078
|
-
var _a, _b, _c;
|
1079
|
-
const layout = useRoomLayout();
|
1080
|
-
const { join_form } = ((_c = (_b = (_a = layout == null ? void 0 : layout.screens) == null ? void 0 : _a.preview) == null ? void 0 : _b.default) == null ? void 0 : _c.elements) || {};
|
1081
|
-
return (join_form == null ? void 0 : join_form.join_btn_type) === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE;
|
1082
|
-
};
|
1083
|
-
var useParticipants = (params) => {
|
1084
|
-
var _a;
|
1085
|
-
const isConnected = useHMSStore6(selectIsConnectedToRoom5);
|
1086
|
-
const peerCount = useHMSStore6(selectPeerCount);
|
1087
|
-
const availableRoles = useHMSStore6(selectAvailableRoleNames2);
|
1088
|
-
let participantList = useHMSStore6(isConnected ? selectPeers2 : selectRemotePeers);
|
1089
|
-
const rolesWithParticipants = Array.from(new Set(participantList.map((peer) => peer.roleName)));
|
1090
|
-
const vanillaStore = useHMSVanillaStore2();
|
1091
|
-
if ((_a = params == null ? void 0 : params.metadata) == null ? void 0 : _a.isHandRaised) {
|
1092
|
-
participantList = participantList.filter((peer) => {
|
1093
|
-
return vanillaStore.getState(selectPeerMetadata(peer.id)).isHandRaised;
|
1094
|
-
});
|
1095
|
-
}
|
1096
|
-
if ((params == null ? void 0 : params.role) && availableRoles.includes(params.role)) {
|
1097
|
-
participantList = participantList.filter((peer) => peer.roleName === params.role);
|
1098
|
-
}
|
1099
|
-
if (params == null ? void 0 : params.search) {
|
1100
|
-
const search = params.search;
|
1101
|
-
participantList = participantList.filter((peer) => peer.name.toLowerCase().includes(search));
|
1102
|
-
}
|
1103
|
-
return { participants: participantList, isConnected, peerCount, rolesWithParticipants };
|
1104
|
-
};
|
1105
|
-
|
1106
|
-
// src/Prebuilt/components/RoleChangeModal.jsx
|
1107
694
|
var PeerName = forwardRef((_a, ref) => {
|
1108
695
|
var _b = _a, { children, maxWidth } = _b, rest = __objRest(_b, ["children", "maxWidth"]);
|
1109
696
|
return /* @__PURE__ */ React11.createElement(
|
@@ -1123,15 +710,15 @@ var PeerName = forwardRef((_a, ref) => {
|
|
1123
710
|
});
|
1124
711
|
var RoleChangeModal = ({ peerId, onOpenChange }) => {
|
1125
712
|
var _a;
|
1126
|
-
const peer =
|
713
|
+
const peer = useHMSStore6(selectPeerByID(peerId));
|
1127
714
|
const roles = useFilteredRoles();
|
1128
|
-
const [selectedRole, setRole] =
|
1129
|
-
const [requestPermission, setRequestPermission] =
|
715
|
+
const [selectedRole, setRole] = useState5(peer == null ? void 0 : peer.roleName);
|
716
|
+
const [requestPermission, setRequestPermission] = useState5(true);
|
1130
717
|
const hmsActions = useHMSActions3();
|
1131
|
-
const [open, setOpen] =
|
718
|
+
const [open, setOpen] = useState5(false);
|
1132
719
|
const selectionBg = useDropdownSelection();
|
1133
|
-
const [peerNameRef, setPeerNameRef] =
|
1134
|
-
const ref =
|
720
|
+
const [peerNameRef, setPeerNameRef] = useState5();
|
721
|
+
const ref = useRef();
|
1135
722
|
if (!peer) {
|
1136
723
|
return null;
|
1137
724
|
}
|
@@ -1233,16 +820,16 @@ var RoleChangeModal = ({ peerId, onOpenChange }) => {
|
|
1233
820
|
};
|
1234
821
|
|
1235
822
|
// src/Prebuilt/components/Settings/StartRecording.jsx
|
1236
|
-
import React15, { useState as
|
1237
|
-
import { selectPermissions as selectPermissions5, useHMSActions as useHMSActions5, useHMSStore as
|
823
|
+
import React15, { useState as useState8 } from "react";
|
824
|
+
import { selectPermissions as selectPermissions5, useHMSActions as useHMSActions5, useHMSStore as useHMSStore8, useRecordingStreaming as useRecordingStreaming4 } from "@100mslive/react-sdk";
|
1238
825
|
import { AlertTriangleIcon as AlertTriangleIcon3 } from "@100mslive/react-icons";
|
1239
826
|
|
1240
827
|
// src/Prebuilt/components/Streaming/ResolutionInput.jsx
|
1241
|
-
import React12, { useCallback as
|
828
|
+
import React12, { useCallback as useCallback2, useState as useState6 } from "react";
|
1242
829
|
import { InfoIcon } from "@100mslive/react-icons";
|
1243
830
|
var ResolutionInput = ({ onResolutionChange, disabled, tooltipText, css, testId }) => {
|
1244
|
-
const [resolution, setResolution] =
|
1245
|
-
const resolutionChangeHandler =
|
831
|
+
const [resolution, setResolution] = useState6(RTMP_RECORD_DEFAULT_RESOLUTION);
|
832
|
+
const resolutionChangeHandler = useCallback2(
|
1246
833
|
(event) => {
|
1247
834
|
const { name, value } = event.target;
|
1248
835
|
let width = name === "resWidth" ? Number(value) : resolution.width;
|
@@ -1302,13 +889,13 @@ var ResolutionInput = ({ onResolutionChange, disabled, tooltipText, css, testId
|
|
1302
889
|
};
|
1303
890
|
|
1304
891
|
// src/Prebuilt/components/Streaming/RTMPStreaming.jsx
|
1305
|
-
import React14, { useEffect as
|
892
|
+
import React14, { useEffect as useEffect2, useRef as useRef2, useState as useState7 } from "react";
|
1306
893
|
import { useHMSActions as useHMSActions4, useRecordingStreaming as useRecordingStreaming3 } from "@100mslive/react-sdk";
|
1307
894
|
import { AddCircleIcon, EndStreamIcon, GoLiveIcon, PencilIcon, SettingsIcon, TrashIcon } from "@100mslive/react-icons";
|
1308
895
|
|
1309
896
|
// src/Prebuilt/components/Streaming/Common.jsx
|
1310
897
|
import React13 from "react";
|
1311
|
-
import { selectPermissions as selectPermissions4, useHMSStore as
|
898
|
+
import { selectPermissions as selectPermissions4, useHMSStore as useHMSStore7 } from "@100mslive/react-sdk";
|
1312
899
|
import { ChevronLeftIcon, ChevronRightIcon, CrossIcon as CrossIcon3, RecordIcon } from "@100mslive/react-icons";
|
1313
900
|
var StreamCard = ({ title, subtitle, Icon, imgSrc = "", css = {}, onClick, testId }) => {
|
1314
901
|
return /* @__PURE__ */ React13.createElement(
|
@@ -1378,7 +965,7 @@ var ContentBody = ({ Icon, title, removeVerticalPadding = false, children }) =>
|
|
1378
965
|
return /* @__PURE__ */ React13.createElement(Box, { css: { p: removeVerticalPadding ? "$0 $10" : "$10" } }, /* @__PURE__ */ React13.createElement(Text, { css: { display: "flex", alignItems: "center", mb: "$4" } }, /* @__PURE__ */ React13.createElement(Icon, null), /* @__PURE__ */ React13.createElement(Text, { as: "span", css: { fontWeight: "$semiBold", ml: "$4" } }, title)), /* @__PURE__ */ React13.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium" } }, children));
|
1379
966
|
};
|
1380
967
|
var RecordStream = ({ record, setRecord, testId }) => {
|
1381
|
-
const permissions =
|
968
|
+
const permissions = useHMSStore7(selectPermissions4);
|
1382
969
|
return (permissions == null ? void 0 : permissions.browserRecording) ? /* @__PURE__ */ React13.createElement(Flex, { align: "center", css: { bg: "$surface_bright", m: "$8 $10", p: "$8", r: "$0" } }, /* @__PURE__ */ React13.createElement(Text, { css: { color: "$alert_error_default" } }, /* @__PURE__ */ React13.createElement(RecordIcon, null)), /* @__PURE__ */ React13.createElement(Text, { variant: "sm", css: { flex: "1 1 0", mx: "$8" } }, "Record the stream"), /* @__PURE__ */ React13.createElement(Switch, { checked: record, onCheckedChange: setRecord, "data-testid": testId })) : null;
|
1383
970
|
};
|
1384
971
|
var ErrorText = ({ error }) => {
|
@@ -1395,7 +982,7 @@ var RTMPStreaming = ({ onBack }) => {
|
|
1395
982
|
};
|
1396
983
|
var StartRTMP = () => {
|
1397
984
|
const [rtmpPreference = [], setRTMPPreference] = useUserPreferences(UserPreferencesKeys.RTMP_URLS);
|
1398
|
-
const [rtmpStreams, setRTMPStreams] =
|
985
|
+
const [rtmpStreams, setRTMPStreams] = useState7(
|
1399
986
|
rtmpPreference.length > 0 ? rtmpPreference : [
|
1400
987
|
{
|
1401
988
|
name: "Stream",
|
@@ -1406,9 +993,9 @@ var StartRTMP = () => {
|
|
1406
993
|
]
|
1407
994
|
);
|
1408
995
|
const hmsActions = useHMSActions4();
|
1409
|
-
const [error, setError] =
|
1410
|
-
const [record, setRecord] =
|
1411
|
-
const [resolution, setResolution] =
|
996
|
+
const [error, setError] = useState7(false);
|
997
|
+
const [record, setRecord] = useState7(false);
|
998
|
+
const [resolution, setResolution] = useState7(RTMP_RECORD_DEFAULT_RESOLUTION);
|
1412
999
|
const [isRTMPStarted, setRTMPStarted] = useSetAppDataByKey(APP_DATA.rtmpStarted);
|
1413
1000
|
const hasRTMPURL = rtmpStreams.some((value) => value.rtmpURL && value.streamKey);
|
1414
1001
|
return /* @__PURE__ */ React14.createElement(
|
@@ -1512,10 +1099,10 @@ var StartRTMP = () => {
|
|
1512
1099
|
};
|
1513
1100
|
var EndRTMP = () => {
|
1514
1101
|
const hmsActions = useHMSActions4();
|
1515
|
-
const [inProgress, setInProgress] =
|
1516
|
-
const [error, setError] =
|
1102
|
+
const [inProgress, setInProgress] = useState7(false);
|
1103
|
+
const [error, setError] = useState7("");
|
1517
1104
|
const { isRTMPRunning } = useRecordingStreaming3();
|
1518
|
-
|
1105
|
+
useEffect2(() => {
|
1519
1106
|
if (inProgress && !isRTMPRunning) {
|
1520
1107
|
setInProgress(false);
|
1521
1108
|
}
|
@@ -1550,7 +1137,7 @@ var FormLabel = ({ id, children }) => {
|
|
1550
1137
|
return /* @__PURE__ */ React14.createElement(Label, { htmlFor: id, css: { color: "$on_surface_high", my: "$4", fontSize: "$sm" } }, children);
|
1551
1138
|
};
|
1552
1139
|
var RTMPForm = ({ rtmpURL, id, streamKey, setRTMPStreams, testId }) => {
|
1553
|
-
const formRef =
|
1140
|
+
const formRef = useRef2(null);
|
1554
1141
|
return /* @__PURE__ */ React14.createElement(Flex, { id, direction: "column", css: { mb: "$8", px: "$8" }, ref: formRef }, /* @__PURE__ */ React14.createElement(FormLabel, { id: "rtmpURL" }, "RTMP URL", /* @__PURE__ */ React14.createElement(Asterik, null)), /* @__PURE__ */ React14.createElement(
|
1555
1142
|
Input,
|
1556
1143
|
{
|
@@ -1597,7 +1184,7 @@ var Asterik = () => {
|
|
1597
1184
|
return /* @__PURE__ */ React14.createElement(Text, { variant: "sm", as: "span", css: { color: "$alert_error_default", mx: "$2" } }, "*");
|
1598
1185
|
};
|
1599
1186
|
var AccordionHeader = ({ rtmp, setRTMPStreams }) => {
|
1600
|
-
const [edit, setEdit] =
|
1187
|
+
const [edit, setEdit] = useState7(false);
|
1601
1188
|
return /* @__PURE__ */ React14.createElement(Accordion.Header, { css: { px: "$8" } }, edit ? /* @__PURE__ */ React14.createElement(
|
1602
1189
|
Input,
|
1603
1190
|
{
|
@@ -1660,8 +1247,8 @@ function getResolution(recordingResolution) {
|
|
1660
1247
|
|
1661
1248
|
// src/Prebuilt/components/Settings/StartRecording.jsx
|
1662
1249
|
var StartRecording = ({ open, onOpenChange }) => {
|
1663
|
-
const permissions =
|
1664
|
-
const [resolution, setResolution] =
|
1250
|
+
const permissions = useHMSStore8(selectPermissions5);
|
1251
|
+
const [resolution, setResolution] = useState8(RTMP_RECORD_DEFAULT_RESOLUTION);
|
1665
1252
|
const [recordingStarted, setRecordingState] = useSetAppDataByKey(APP_DATA.recordingStarted);
|
1666
1253
|
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming4();
|
1667
1254
|
const hmsActions = useHMSActions5();
|
@@ -1748,14 +1335,14 @@ var StartRecording = ({ open, onOpenChange }) => {
|
|
1748
1335
|
var StartRecording_default = StartRecording;
|
1749
1336
|
|
1750
1337
|
// src/Prebuilt/components/StatsForNerds.jsx
|
1751
|
-
import React16, { useEffect as
|
1338
|
+
import React16, { useEffect as useEffect3, useMemo, useRef as useRef3, useState as useState9 } from "react";
|
1752
1339
|
import {
|
1753
1340
|
selectHMSStats,
|
1754
1341
|
selectLocalPeerID as selectLocalPeerID2,
|
1755
1342
|
selectPeersMap,
|
1756
1343
|
selectTracksMap as selectTracksMap2,
|
1757
1344
|
useHMSStatsStore,
|
1758
|
-
useHMSStore as
|
1345
|
+
useHMSStore as useHMSStore9
|
1759
1346
|
} from "@100mslive/react-sdk";
|
1760
1347
|
var StatsForNerds = ({ onOpenChange }) => {
|
1761
1348
|
var _a;
|
@@ -1764,12 +1351,12 @@ var StatsForNerds = ({ onOpenChange }) => {
|
|
1764
1351
|
() => [{ id: "local-peer", label: "Local Peer Stats" }, ...tracksWithLabels],
|
1765
1352
|
[tracksWithLabels]
|
1766
1353
|
);
|
1767
|
-
const [selectedStat, setSelectedStat] =
|
1354
|
+
const [selectedStat, setSelectedStat] = useState9(statsOptions[0]);
|
1768
1355
|
const [showStatsOnTiles, setShowStatsOnTiles] = useSetUiSettings(UI_SETTINGS.showStatsOnTiles);
|
1769
|
-
const [open, setOpen] =
|
1770
|
-
const ref =
|
1356
|
+
const [open, setOpen] = useState9(false);
|
1357
|
+
const ref = useRef3();
|
1771
1358
|
const selectionBg = useDropdownSelection();
|
1772
|
-
|
1359
|
+
useEffect3(() => {
|
1773
1360
|
if (selectedStat.id !== "local-peer" && !tracksWithLabels.find((track) => track.id === selectedStat.id)) {
|
1774
1361
|
setSelectedStat("local-peer");
|
1775
1362
|
}
|
@@ -1829,9 +1416,9 @@ var StatsForNerds = ({ onOpenChange }) => {
|
|
1829
1416
|
)));
|
1830
1417
|
};
|
1831
1418
|
var useTracksWithLabel = () => {
|
1832
|
-
const tracksMap =
|
1833
|
-
const peersMap =
|
1834
|
-
const localPeerID =
|
1419
|
+
const tracksMap = useHMSStore9(selectTracksMap2);
|
1420
|
+
const peersMap = useHMSStore9(selectPeersMap);
|
1421
|
+
const localPeerID = useHMSStore9(selectLocalPeerID2);
|
1835
1422
|
const tracksWithLabels = useMemo(
|
1836
1423
|
() => Object.values(tracksMap).reduce((res, track) => {
|
1837
1424
|
var _a, _b;
|
@@ -1922,22 +1509,22 @@ var formatBytes = (bytes, unit = "B", decimals = 2) => {
|
|
1922
1509
|
};
|
1923
1510
|
|
1924
1511
|
// src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx
|
1925
|
-
import React17, { useCallback as
|
1512
|
+
import React17, { useCallback as useCallback3, useRef as useRef4, useState as useState10 } from "react";
|
1926
1513
|
import { useHMSActions as useHMSActions6 } from "@100mslive/react-sdk";
|
1927
1514
|
import { AlertTriangleIcon as AlertTriangleIcon4, ChangeRoleIcon, CheckIcon as CheckIcon2 } from "@100mslive/react-icons";
|
1928
1515
|
var BulkRoleChangeModal = ({ onOpenChange }) => {
|
1929
1516
|
var _a, _b;
|
1930
1517
|
const roles = useFilteredRoles();
|
1931
1518
|
const hmsActions = useHMSActions6();
|
1932
|
-
const ref =
|
1933
|
-
const roleRef =
|
1934
|
-
const [selectedBulkRole, setBulkRole] =
|
1935
|
-
const [selectedRole, setRole] =
|
1936
|
-
const [bulkRoleDialog, setBulkRoleDialog] =
|
1937
|
-
const [roleDialog, setRoleDialog] =
|
1938
|
-
const [errorMessage, setErrorMessage] =
|
1939
|
-
const [isSubmiting, setIsSubmiting] =
|
1940
|
-
const changeBulkRole =
|
1519
|
+
const ref = useRef4(null);
|
1520
|
+
const roleRef = useRef4(null);
|
1521
|
+
const [selectedBulkRole, setBulkRole] = useState10([]);
|
1522
|
+
const [selectedRole, setRole] = useState10("");
|
1523
|
+
const [bulkRoleDialog, setBulkRoleDialog] = useState10(false);
|
1524
|
+
const [roleDialog, setRoleDialog] = useState10(false);
|
1525
|
+
const [errorMessage, setErrorMessage] = useState10("");
|
1526
|
+
const [isSubmiting, setIsSubmiting] = useState10(false);
|
1527
|
+
const changeBulkRole = useCallback3(() => __async(void 0, null, function* () {
|
1941
1528
|
if (selectedBulkRole.length > 0 && selectedRole) {
|
1942
1529
|
try {
|
1943
1530
|
setIsSubmiting(true);
|
@@ -2033,11 +1620,11 @@ import React18 from "react";
|
|
2033
1620
|
import { ExpandIcon } from "@100mslive/react-icons";
|
2034
1621
|
|
2035
1622
|
// src/Prebuilt/components/hooks/useFullscreen.js
|
2036
|
-
import { useCallback as
|
1623
|
+
import { useCallback as useCallback4, useEffect as useEffect4, useState as useState11 } from "react";
|
2037
1624
|
import screenfull from "screenfull";
|
2038
1625
|
var useFullscreen = () => {
|
2039
|
-
const [isFullScreenEnabled, setIsFullScreenEnabled] =
|
2040
|
-
const toggle =
|
1626
|
+
const [isFullScreenEnabled, setIsFullScreenEnabled] = useState11(screenfull.isFullscreen);
|
1627
|
+
const toggle = useCallback4(() => __async(void 0, null, function* () {
|
2041
1628
|
if (!screenfull.isEnabled) {
|
2042
1629
|
ToastManager.addToast({ title: "Fullscreen feature not supported" });
|
2043
1630
|
return;
|
@@ -2052,7 +1639,7 @@ var useFullscreen = () => {
|
|
2052
1639
|
ToastManager.addToast({ title: err.message });
|
2053
1640
|
}
|
2054
1641
|
}), [isFullScreenEnabled]);
|
2055
|
-
|
1642
|
+
useEffect4(() => {
|
2056
1643
|
const onChange = () => {
|
2057
1644
|
setIsFullScreenEnabled(screenfull.isFullscreen);
|
2058
1645
|
};
|
@@ -2092,7 +1679,7 @@ var FullScreenItem = () => {
|
|
2092
1679
|
};
|
2093
1680
|
|
2094
1681
|
// src/Prebuilt/components/MoreSettings/MuteAllModal.jsx
|
2095
|
-
import React20, { useCallback as
|
1682
|
+
import React20, { useCallback as useCallback5, useState as useState12 } from "react";
|
2096
1683
|
import { useHMSActions as useHMSActions7 } from "@100mslive/react-sdk";
|
2097
1684
|
import { MicOffIcon } from "@100mslive/react-icons";
|
2098
1685
|
|
@@ -2149,11 +1736,11 @@ var trackTypeOptions = [
|
|
2149
1736
|
var MuteAllModal = ({ onOpenChange, isMobile = false }) => {
|
2150
1737
|
const roles = useFilteredRoles();
|
2151
1738
|
const hmsActions = useHMSActions7();
|
2152
|
-
const [enabled, setEnabled] =
|
2153
|
-
const [trackType, setTrackType] =
|
2154
|
-
const [selectedRole, setRole] =
|
2155
|
-
const [selectedSource, setSource] =
|
2156
|
-
const muteAll =
|
1739
|
+
const [enabled, setEnabled] = useState12(false);
|
1740
|
+
const [trackType, setTrackType] = useState12();
|
1741
|
+
const [selectedRole, setRole] = useState12();
|
1742
|
+
const [selectedSource, setSource] = useState12();
|
1743
|
+
const muteAll = useCallback5(() => __async(void 0, null, function* () {
|
2157
1744
|
yield hmsActions.setRemoteTracksEnabled({
|
2158
1745
|
enabled,
|
2159
1746
|
type: trackType,
|
@@ -2199,11 +1786,11 @@ var DesktopOptions = ({
|
|
2199
1786
|
elements,
|
2200
1787
|
screenType
|
2201
1788
|
}) => {
|
2202
|
-
const localPeerId =
|
1789
|
+
const localPeerId = useHMSStore10(selectLocalPeerID3);
|
2203
1790
|
const hmsActions = useHMSActions8();
|
2204
|
-
const enablHlsStats =
|
2205
|
-
const [openModals, setOpenModals] =
|
2206
|
-
const {
|
1791
|
+
const enablHlsStats = useHMSStore10(selectAppData(APP_DATA.hlsStats));
|
1792
|
+
const [openModals, setOpenModals] = useState13(/* @__PURE__ */ new Set());
|
1793
|
+
const { isBRBOn, toggleBRB } = useMyMetadata();
|
2207
1794
|
const isPipOn = PictureInPicture.isOn();
|
2208
1795
|
const isBRBEnabled = !!(elements == null ? void 0 : elements.brb);
|
2209
1796
|
useDropdownList({ open: openModals.size > 0, name: "MoreSettings" });
|
@@ -2226,7 +1813,7 @@ var DesktopOptions = ({
|
|
2226
1813
|
onOpenChange: (value) => updateState(MODALS.MORE_SETTINGS, value),
|
2227
1814
|
modal: false
|
2228
1815
|
},
|
2229
|
-
/* @__PURE__ */ React21.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "more_settings_btn" }, /* @__PURE__ */ React21.createElement(IconButton_default, null, /* @__PURE__ */ React21.createElement(
|
1816
|
+
/* @__PURE__ */ React21.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React21.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "more_settings_btn" }, /* @__PURE__ */ React21.createElement(IconButton_default, null, /* @__PURE__ */ React21.createElement(DragHandleIcon, null)))),
|
2230
1817
|
/* @__PURE__ */ React21.createElement(
|
2231
1818
|
Dropdown.Content,
|
2232
1819
|
{
|
@@ -2241,9 +1828,7 @@ var DesktopOptions = ({
|
|
2241
1828
|
}
|
2242
1829
|
}
|
2243
1830
|
},
|
2244
|
-
screenType !== "hls_live_streaming" ? /* @__PURE__ */ React21.createElement(Dropdown.Item, { onClick:
|
2245
|
-
isBRBEnabled && screenType === "hls_live_streaming" ? /* @__PURE__ */ React21.createElement(Dropdown.Item, { onClick: toggleBRB, "data-testid": "brb_btn" }, /* @__PURE__ */ React21.createElement(BrbIcon, null), /* @__PURE__ */ React21.createElement(Text, { variant: "sm", css: { ml: "$4", color: "$on_surface_high" } }, "Be Right Back"), /* @__PURE__ */ React21.createElement(Flex, { justify: "end", css: { color: "$on_surface_high", flexGrow: "1" } }, isBRBOn ? /* @__PURE__ */ React21.createElement(CheckIcon3, null) : null)) : null,
|
2246
|
-
isBRBEnabled && screenType === "hls_live_streaming" ? /* @__PURE__ */ React21.createElement(Dropdown.ItemSeparator, { css: { mx: "0" } }) : null,
|
1831
|
+
isBRBEnabled && screenType !== "hls_live_streaming" ? /* @__PURE__ */ React21.createElement(Dropdown.Item, { onClick: toggleBRB, "data-testid": "brb_btn" }, /* @__PURE__ */ React21.createElement(BrbIcon, null), /* @__PURE__ */ React21.createElement(Text, { variant: "sm", css: { ml: "$4", color: "$on_surface_high" } }, "Be Right Back"), /* @__PURE__ */ React21.createElement(Flex, { justify: "end", css: { color: "$on_surface_high", flexGrow: "1" } }, isBRBOn ? /* @__PURE__ */ React21.createElement(CheckIcon3, null) : null)) : null,
|
2247
1832
|
screenType !== "hls_live_streaming" ? /* @__PURE__ */ React21.createElement(Dropdown.Item, null, /* @__PURE__ */ React21.createElement(
|
2248
1833
|
PIP,
|
2249
1834
|
{
|
@@ -2287,18 +1872,28 @@ var DesktopOptions = ({
|
|
2287
1872
|
));
|
2288
1873
|
};
|
2289
1874
|
|
2290
|
-
// src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.
|
2291
|
-
import React22, { useRef as
|
1875
|
+
// src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx
|
1876
|
+
import React22, { useRef as useRef5, useState as useState14 } from "react";
|
2292
1877
|
import { useClickAway } from "react-use";
|
2293
1878
|
import {
|
2294
|
-
selectIsConnectedToRoom as
|
2295
|
-
selectPeerCount
|
1879
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
1880
|
+
selectPeerCount,
|
2296
1881
|
selectPermissions as selectPermissions6,
|
2297
1882
|
useHMSActions as useHMSActions9,
|
2298
|
-
useHMSStore as
|
1883
|
+
useHMSStore as useHMSStore11,
|
2299
1884
|
useRecordingStreaming as useRecordingStreaming5
|
2300
1885
|
} from "@100mslive/react-sdk";
|
2301
|
-
import {
|
1886
|
+
import {
|
1887
|
+
BrbIcon as BrbIcon2,
|
1888
|
+
CrossIcon as CrossIcon4,
|
1889
|
+
DragHandleIcon as DragHandleIcon2,
|
1890
|
+
EmojiIcon as EmojiIcon2,
|
1891
|
+
HandIcon,
|
1892
|
+
HandRaiseSlashedIcon,
|
1893
|
+
PeopleIcon,
|
1894
|
+
RecordIcon as RecordIcon2,
|
1895
|
+
SettingsIcon as SettingsIcon3
|
1896
|
+
} from "@100mslive/react-icons";
|
2302
1897
|
var MODALS2 = {
|
2303
1898
|
CHANGE_NAME: "changeName",
|
2304
1899
|
SELF_ROLE_CHANGE: "selfRoleChange",
|
@@ -2310,20 +1905,24 @@ var MODALS2 = {
|
|
2310
1905
|
MUTE_ALL: "muteAll",
|
2311
1906
|
EMBED_URL: "embedUrl"
|
2312
1907
|
};
|
2313
|
-
var MwebOptions = ({
|
1908
|
+
var MwebOptions = ({
|
1909
|
+
elements,
|
1910
|
+
screenType
|
1911
|
+
}) => {
|
2314
1912
|
const hmsActions = useHMSActions9();
|
2315
|
-
const permissions =
|
2316
|
-
const isConnected =
|
1913
|
+
const permissions = useHMSStore11(selectPermissions6);
|
1914
|
+
const isConnected = useHMSStore11(selectIsConnectedToRoom5);
|
2317
1915
|
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming5();
|
2318
|
-
const [openModals, setOpenModals] =
|
2319
|
-
const [openOptionsSheet, setOpenOptionsSheet] =
|
2320
|
-
const [openSettingsSheet, setOpenSettingsSheet] =
|
2321
|
-
const [showEmojiCard, setShowEmojiCard] =
|
2322
|
-
const [showRecordingOn, setShowRecordingOn] =
|
2323
|
-
const [isRecordingLoading, setIsRecordingLoading] =
|
1916
|
+
const [openModals, setOpenModals] = useState14(/* @__PURE__ */ new Set());
|
1917
|
+
const [openOptionsSheet, setOpenOptionsSheet] = useState14(false);
|
1918
|
+
const [openSettingsSheet, setOpenSettingsSheet] = useState14(false);
|
1919
|
+
const [showEmojiCard, setShowEmojiCard] = useState14(false);
|
1920
|
+
const [showRecordingOn, setShowRecordingOn] = useState14(false);
|
1921
|
+
const [isRecordingLoading, setIsRecordingLoading] = useState14(false);
|
2324
1922
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2325
|
-
const peerCount =
|
2326
|
-
const emojiCardRef =
|
1923
|
+
const peerCount = useHMSStore11(selectPeerCount);
|
1924
|
+
const emojiCardRef = useRef5(null);
|
1925
|
+
const { isBRBOn, toggleBRB, isHandRaised, toggleHandRaise } = useMyMetadata();
|
2327
1926
|
useDropdownList({ open: openModals.size > 0 || openOptionsSheet || openSettingsSheet, name: "MoreSettings" });
|
2328
1927
|
const updateState = (modalName, value) => {
|
2329
1928
|
setOpenModals((modals) => {
|
@@ -2337,7 +1936,7 @@ var MwebOptions = ({ elements }) => {
|
|
2337
1936
|
});
|
2338
1937
|
};
|
2339
1938
|
useClickAway(emojiCardRef, () => setShowEmojiCard(false));
|
2340
|
-
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Sheet.Root, { open: openOptionsSheet, onOpenChange: setOpenOptionsSheet }, /* @__PURE__ */ React22.createElement(Sheet.Trigger, { asChild: true, "data-testid": "more_settings_btn" }, /* @__PURE__ */ React22.createElement(IconButton_default, null, /* @__PURE__ */ React22.createElement(
|
1939
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Sheet.Root, { open: openOptionsSheet, onOpenChange: setOpenOptionsSheet }, /* @__PURE__ */ React22.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React22.createElement(Sheet.Trigger, { asChild: true, "data-testid": "more_settings_btn" }, /* @__PURE__ */ React22.createElement(IconButton_default, null, /* @__PURE__ */ React22.createElement(DragHandleIcon2, null)))), /* @__PURE__ */ React22.createElement(Sheet.Content, { css: { bg: "$surface_dim", pb: "$14" } }, /* @__PURE__ */ React22.createElement(
|
2341
1940
|
Sheet.Title,
|
2342
1941
|
{
|
2343
1942
|
css: {
|
@@ -2368,7 +1967,7 @@ var MwebOptions = ({ elements }) => {
|
|
2368
1967
|
px: "$9"
|
2369
1968
|
}
|
2370
1969
|
},
|
2371
|
-
/* @__PURE__ */ React22.createElement(
|
1970
|
+
(elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React22.createElement(
|
2372
1971
|
ActionTile.Root,
|
2373
1972
|
{
|
2374
1973
|
onClick: () => {
|
@@ -2380,6 +1979,18 @@ var MwebOptions = ({ elements }) => {
|
|
2380
1979
|
/* @__PURE__ */ React22.createElement(PeopleIcon, null),
|
2381
1980
|
/* @__PURE__ */ React22.createElement(ActionTile.Title, null, "Participants")
|
2382
1981
|
),
|
1982
|
+
screenType !== "hls_live_streaming" ? /* @__PURE__ */ React22.createElement(
|
1983
|
+
ActionTile.Root,
|
1984
|
+
{
|
1985
|
+
active: isHandRaised,
|
1986
|
+
onClick: () => {
|
1987
|
+
toggleHandRaise();
|
1988
|
+
setOpenOptionsSheet(false);
|
1989
|
+
}
|
1990
|
+
},
|
1991
|
+
isHandRaised ? /* @__PURE__ */ React22.createElement(HandRaiseSlashedIcon, null) : /* @__PURE__ */ React22.createElement(HandIcon, null),
|
1992
|
+
/* @__PURE__ */ React22.createElement(ActionTile.Title, null, isHandRaised ? "Lower" : "Raise", " Hand")
|
1993
|
+
) : null,
|
2383
1994
|
(elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React22.createElement(
|
2384
1995
|
ActionTile.Root,
|
2385
1996
|
{
|
@@ -2391,6 +2002,18 @@ var MwebOptions = ({ elements }) => {
|
|
2391
2002
|
/* @__PURE__ */ React22.createElement(EmojiIcon2, null),
|
2392
2003
|
/* @__PURE__ */ React22.createElement(ActionTile.Title, null, "Emoji Reactions")
|
2393
2004
|
),
|
2005
|
+
(elements == null ? void 0 : elements.brb) && /* @__PURE__ */ React22.createElement(
|
2006
|
+
ActionTile.Root,
|
2007
|
+
{
|
2008
|
+
active: isBRBOn,
|
2009
|
+
onClick: () => {
|
2010
|
+
toggleBRB();
|
2011
|
+
setOpenOptionsSheet(false);
|
2012
|
+
}
|
2013
|
+
},
|
2014
|
+
/* @__PURE__ */ React22.createElement(BrbIcon2, null),
|
2015
|
+
/* @__PURE__ */ React22.createElement(ActionTile.Title, null, "Be Right Back")
|
2016
|
+
),
|
2394
2017
|
/* @__PURE__ */ React22.createElement(
|
2395
2018
|
ActionTile.Root,
|
2396
2019
|
{
|
@@ -2429,6 +2052,7 @@ var MwebOptions = ({ elements }) => {
|
|
2429
2052
|
});
|
2430
2053
|
} else {
|
2431
2054
|
ToastManager.addToast({
|
2055
|
+
// @ts-ignore
|
2432
2056
|
title: error.message,
|
2433
2057
|
variant: "error"
|
2434
2058
|
});
|
@@ -2444,7 +2068,7 @@ var MwebOptions = ({ elements }) => {
|
|
2444
2068
|
isRecordingLoading ? /* @__PURE__ */ React22.createElement(Loading, null) : /* @__PURE__ */ React22.createElement(RecordIcon2, null),
|
2445
2069
|
/* @__PURE__ */ React22.createElement(ActionTile.Title, null, isBrowserRecordingOn ? "Recording On" : isRecordingLoading ? "Starting Recording" : "Start Recording")
|
2446
2070
|
) : null
|
2447
|
-
))), /* @__PURE__ */ React22.createElement(SettingsModal_default, { open: openSettingsSheet, onOpenChange: setOpenSettingsSheet }), openModals.has(MODALS2.MUTE_ALL) && /* @__PURE__ */ React22.createElement(MuteAllModal, { onOpenChange: (value) => updateState(MODALS2.MUTE_ALL, value), isMobile: true }), openModals.has(MODALS2.CHANGE_NAME) && /* @__PURE__ */ React22.createElement(
|
2071
|
+
))), /* @__PURE__ */ React22.createElement(SettingsModal_default, { open: openSettingsSheet, onOpenChange: setOpenSettingsSheet, screenType }), openModals.has(MODALS2.MUTE_ALL) && /* @__PURE__ */ React22.createElement(MuteAllModal, { onOpenChange: (value) => updateState(MODALS2.MUTE_ALL, value), isMobile: true }), openModals.has(MODALS2.CHANGE_NAME) && /* @__PURE__ */ React22.createElement(
|
2448
2072
|
ChangeNameModal,
|
2449
2073
|
{
|
2450
2074
|
onOpenChange: (value) => updateState(MODALS2.CHANGE_NAME, value),
|
@@ -2481,6 +2105,7 @@ var MwebOptions = ({ elements }) => {
|
|
2481
2105
|
setShowRecordingOn(false);
|
2482
2106
|
} catch (error) {
|
2483
2107
|
ToastManager.addToast({
|
2108
|
+
// @ts-ignore
|
2484
2109
|
title: error.message,
|
2485
2110
|
variant: "error"
|
2486
2111
|
});
|
@@ -2496,28 +2121,28 @@ var MoreSettings = ({
|
|
2496
2121
|
screenType
|
2497
2122
|
}) => {
|
2498
2123
|
const isMobile = useMedia3(config.media.md);
|
2499
|
-
return isMobile ? /* @__PURE__ */ React23.createElement(MwebOptions, { elements,
|
2124
|
+
return isMobile ? /* @__PURE__ */ React23.createElement(MwebOptions, { elements, screenType }) : /* @__PURE__ */ React23.createElement(DesktopOptions, { elements, screenType });
|
2500
2125
|
};
|
2501
2126
|
|
2502
2127
|
// src/Prebuilt/components/RaiseHand.jsx
|
2503
2128
|
import React24 from "react";
|
2504
|
-
import { selectLocalPeer, selectPeerMetadata
|
2129
|
+
import { selectLocalPeer, selectPeerMetadata, useHMSStore as useHMSStore12 } from "@100mslive/react-sdk";
|
2505
2130
|
import { HandIcon as HandIcon2 } from "@100mslive/react-icons";
|
2506
2131
|
var RaiseHand = () => {
|
2507
2132
|
var _a;
|
2508
2133
|
const { toggleHandRaise } = useMyMetadata();
|
2509
|
-
const localPeer =
|
2510
|
-
const isHandRaised = ((_a =
|
2134
|
+
const localPeer = useHMSStore12(selectLocalPeer);
|
2135
|
+
const isHandRaised = ((_a = useHMSStore12(selectPeerMetadata(localPeer.id))) == null ? void 0 : _a.isHandRaised) || false;
|
2511
2136
|
return /* @__PURE__ */ React24.createElement(Tooltip, { title: isHandRaised ? "Lower hand" : "Raise hand" }, /* @__PURE__ */ React24.createElement(IconButton_default, { active: !isHandRaised, onClick: toggleHandRaise }, /* @__PURE__ */ React24.createElement(HandIcon2, null)));
|
2512
2137
|
};
|
2513
2138
|
|
2514
2139
|
// src/Prebuilt/components/ScreenShareToggle.jsx
|
2515
2140
|
import React31, { Fragment as Fragment6 } from "react";
|
2516
|
-
import { selectIsAllowedToPublish, useHMSStore as
|
2141
|
+
import { selectIsAllowedToPublish, useHMSStore as useHMSStore13, useScreenShare as useScreenShare2 } from "@100mslive/react-sdk";
|
2517
2142
|
import { ShareScreenIcon } from "@100mslive/react-icons";
|
2518
2143
|
|
2519
2144
|
// src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
|
2520
|
-
import React30, { Fragment as Fragment5, useState as
|
2145
|
+
import React30, { Fragment as Fragment5, useState as useState16 } from "react";
|
2521
2146
|
import { useScreenShare } from "@100mslive/react-sdk";
|
2522
2147
|
import { StarIcon, VerticalMenuIcon as VerticalMenuIcon2 } from "@100mslive/react-icons";
|
2523
2148
|
|
@@ -2553,7 +2178,7 @@ var ShareMenuIcon = styled(ScreenShareButton, {
|
|
2553
2178
|
});
|
2554
2179
|
|
2555
2180
|
// src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
|
2556
|
-
import React29, { useState as
|
2181
|
+
import React29, { useState as useState15 } from "react";
|
2557
2182
|
|
2558
2183
|
// src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx
|
2559
2184
|
import React25 from "react";
|
@@ -2726,7 +2351,7 @@ var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
|
2726
2351
|
|
2727
2352
|
// src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
|
2728
2353
|
function PDFFileOptions({ onOpenChange }) {
|
2729
|
-
const [pdfFile, setPDFFile] =
|
2354
|
+
const [pdfFile, setPDFFile] = useState15(null);
|
2730
2355
|
return !pdfFile ? /* @__PURE__ */ React29.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React29.createElement(Dialog.Portal, null, /* @__PURE__ */ React29.createElement(Dialog.Overlay, null), /* @__PURE__ */ React29.createElement(
|
2731
2356
|
Dialog.Content,
|
2732
2357
|
{
|
@@ -2758,7 +2383,7 @@ var MODALS3 = {
|
|
2758
2383
|
PDF_SHARE: "pdfShare"
|
2759
2384
|
};
|
2760
2385
|
function ShareScreenOptions() {
|
2761
|
-
const [openModals, setOpenModals] =
|
2386
|
+
const [openModals, setOpenModals] = useState16(/* @__PURE__ */ new Set());
|
2762
2387
|
const { amIScreenSharing } = useScreenShare();
|
2763
2388
|
const updateState = (modalName, value) => {
|
2764
2389
|
setOpenModals((modals) => {
|
@@ -2995,7 +2620,7 @@ function ShareScreenOptions() {
|
|
2995
2620
|
|
2996
2621
|
// src/Prebuilt/components/ScreenShareToggle.jsx
|
2997
2622
|
var ScreenshareToggle = ({ css = {} }) => {
|
2998
|
-
const isAllowedToPublish =
|
2623
|
+
const isAllowedToPublish = useHMSStore13(selectIsAllowedToPublish);
|
2999
2624
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
3000
2625
|
const { amIScreenSharing, screenShareVideoTrackId: video, toggleScreenShare } = useScreenShare2();
|
3001
2626
|
const isVideoScreenshare = amIScreenSharing && !!video;
|
@@ -3018,152 +2643,196 @@ var ScreenshareToggle = ({ css = {} }) => {
|
|
3018
2643
|
), /* @__PURE__ */ React31.createElement(ShareScreenOptions, null)));
|
3019
2644
|
};
|
3020
2645
|
|
3021
|
-
// src/Prebuilt/components/Footer/ChatToggle.
|
2646
|
+
// src/Prebuilt/components/Footer/ChatToggle.tsx
|
3022
2647
|
import React32 from "react";
|
3023
|
-
import { selectUnreadHMSMessagesCount, useHMSStore as
|
2648
|
+
import { selectUnreadHMSMessagesCount, useHMSStore as useHMSStore14 } from "@100mslive/react-sdk";
|
3024
2649
|
import { ChatIcon, ChatUnreadIcon } from "@100mslive/react-icons";
|
3025
2650
|
var ChatToggle = () => {
|
3026
|
-
const countUnreadMessages =
|
2651
|
+
const countUnreadMessages = useHMSStore14(selectUnreadHMSMessagesCount);
|
3027
2652
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3028
2653
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3029
2654
|
return /* @__PURE__ */ React32.createElement(Tooltip, { key: "chat", title: `${isChatOpen ? "Close" : "Open"} chat` }, /* @__PURE__ */ React32.createElement(IconButton_default, { onClick: toggleChat, active: !isChatOpen, "data-testid": "chat_btn" }, countUnreadMessages === 0 ? /* @__PURE__ */ React32.createElement(ChatIcon, null) : /* @__PURE__ */ React32.createElement(ChatUnreadIcon, { "data-testid": "chat_unread_btn" })));
|
3030
2655
|
};
|
3031
2656
|
|
3032
2657
|
// src/Prebuilt/components/Footer/ParticipantList.jsx
|
3033
|
-
import React35, { Fragment as Fragment7, useCallback as
|
2658
|
+
import React35, { Fragment as Fragment7, useCallback as useCallback6, useEffect as useEffect5, useState as useState18 } from "react";
|
3034
2659
|
import { useDebounce, useMedia as useMedia4 } from "react-use";
|
3035
2660
|
import {
|
3036
2661
|
selectIsPeerAudioEnabled,
|
3037
2662
|
selectLocalPeerID as selectLocalPeerID4,
|
3038
|
-
selectPeerCount as
|
3039
|
-
selectPeerMetadata as
|
3040
|
-
selectPeersByCondition,
|
3041
|
-
selectPermissions as
|
3042
|
-
useHMSActions as
|
3043
|
-
useHMSStore as
|
2663
|
+
selectPeerCount as selectPeerCount2,
|
2664
|
+
selectPeerMetadata as selectPeerMetadata2,
|
2665
|
+
selectPeersByCondition as selectPeersByCondition2,
|
2666
|
+
selectPermissions as selectPermissions8,
|
2667
|
+
useHMSActions as useHMSActions11,
|
2668
|
+
useHMSStore as useHMSStore16
|
3044
2669
|
} from "@100mslive/react-sdk";
|
3045
2670
|
import {
|
3046
2671
|
ChangeRoleIcon as ChangeRoleIcon2,
|
3047
2672
|
HandIcon as HandIcon3,
|
3048
|
-
MicOffIcon as
|
2673
|
+
MicOffIcon as MicOffIcon3,
|
3049
2674
|
PeopleIcon as PeopleIcon2,
|
3050
2675
|
PeopleRemoveIcon,
|
3051
2676
|
SearchIcon,
|
3052
|
-
VerticalMenuIcon as
|
2677
|
+
VerticalMenuIcon as VerticalMenuIcon4
|
3053
2678
|
} from "@100mslive/react-icons";
|
3054
2679
|
|
3055
|
-
// src/Prebuilt/components/
|
3056
|
-
import
|
3057
|
-
import {
|
3058
|
-
import {
|
3059
|
-
|
3060
|
-
|
3061
|
-
|
3062
|
-
|
3063
|
-
|
3064
|
-
|
3065
|
-
|
3066
|
-
|
3067
|
-
|
3068
|
-
|
3069
|
-
|
3070
|
-
|
3071
|
-
|
3072
|
-
|
3073
|
-
|
2680
|
+
// src/Prebuilt/components/Footer/RoleAccordion.tsx
|
2681
|
+
import React34 from "react";
|
2682
|
+
import { useMeasure } from "react-use";
|
2683
|
+
import { FixedSizeList } from "react-window";
|
2684
|
+
|
2685
|
+
// src/Prebuilt/components/Footer/RoleOptions.tsx
|
2686
|
+
import React33, { useState as useState17 } from "react";
|
2687
|
+
import { selectPermissions as selectPermissions7, useHMSActions as useHMSActions10, useHMSStore as useHMSStore15, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2688
|
+
import {
|
2689
|
+
MicOffIcon as MicOffIcon2,
|
2690
|
+
MicOnIcon,
|
2691
|
+
PersonRectangleIcon,
|
2692
|
+
RemoveUserIcon,
|
2693
|
+
VerticalMenuIcon as VerticalMenuIcon3,
|
2694
|
+
VideoOffIcon,
|
2695
|
+
VideoOnIcon
|
2696
|
+
} from "@100mslive/react-icons";
|
2697
|
+
var dropdownItemCSS = { backgroundColor: "$surface_default", gap: "$4", p: "$8" };
|
2698
|
+
var optionTextCSS = { fontWeight: "$semiBold", color: "$on_surface_high", textTransform: "none" };
|
2699
|
+
var RoleOptions = ({ roleName, peerList }) => {
|
2700
|
+
const [openOptions, setOpenOptions] = useState17(false);
|
2701
|
+
const permissions = useHMSStore15(selectPermissions7);
|
2702
|
+
const hmsActions = useHMSActions10();
|
2703
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
2704
|
+
const { on_stage_role, off_stage_roles = [] } = (elements == null ? void 0 : elements.on_stage_exp) || {};
|
2705
|
+
const vanillaStore = useHMSVanillaStore2();
|
2706
|
+
const store = vanillaStore.getState();
|
2707
|
+
let allPeersHaveVideoOn = true;
|
2708
|
+
let allPeersHaveAudioOn = true;
|
2709
|
+
peerList.forEach((peer) => {
|
2710
|
+
var _a, _b;
|
2711
|
+
const isAudioOn = !!peer.audioTrack && ((_a = store.tracks[peer.audioTrack]) == null ? void 0 : _a.enabled);
|
2712
|
+
const isVideoOn = !!peer.videoTrack && ((_b = store.tracks[peer.videoTrack]) == null ? void 0 : _b.enabled);
|
2713
|
+
allPeersHaveAudioOn = allPeersHaveAudioOn && isAudioOn;
|
2714
|
+
allPeersHaveVideoOn = allPeersHaveVideoOn && isVideoOn;
|
2715
|
+
});
|
2716
|
+
const canMuteRole = (permissions == null ? void 0 : permissions.mute) && roleName === on_stage_role;
|
2717
|
+
const canRemoveRoleFromStage = (permissions == null ? void 0 : permissions.changeRole) && roleName === on_stage_role;
|
2718
|
+
const canRemoveRoleFromRoom = (permissions == null ? void 0 : permissions.removeOthers) && (on_stage_role === roleName || (off_stage_roles == null ? void 0 : off_stage_roles.includes(roleName)));
|
2719
|
+
if (!(canMuteRole || canRemoveRoleFromStage || canRemoveRoleFromRoom)) {
|
2720
|
+
return null;
|
2721
|
+
}
|
2722
|
+
const removeAllFromStage = () => {
|
2723
|
+
peerList.forEach((peer) => {
|
2724
|
+
const prevRole = getMetadata(peer.metadata).prevRole;
|
2725
|
+
if (prevRole) {
|
2726
|
+
hmsActions.changeRoleOfPeer(peer.id, prevRole, true);
|
2727
|
+
}
|
2728
|
+
});
|
2729
|
+
};
|
2730
|
+
const setTrackEnabled = (type, enabled = false) => __async(void 0, null, function* () {
|
2731
|
+
try {
|
2732
|
+
yield hmsActions.setRemoteTracksEnabled({ roles: [roleName], source: "regular", type, enabled });
|
2733
|
+
} catch (e) {
|
2734
|
+
console.error(e);
|
2735
|
+
}
|
2736
|
+
});
|
2737
|
+
const removePeersFromRoom = () => __async(void 0, null, function* () {
|
2738
|
+
try {
|
2739
|
+
peerList.forEach((peer) => __async(void 0, null, function* () {
|
2740
|
+
yield hmsActions.removePeer(peer.id, "");
|
2741
|
+
}));
|
2742
|
+
} catch (e) {
|
2743
|
+
console.error(e);
|
2744
|
+
}
|
2745
|
+
});
|
2746
|
+
return /* @__PURE__ */ React33.createElement(Dropdown.Root, { open: openOptions, onOpenChange: setOpenOptions }, /* @__PURE__ */ React33.createElement(
|
2747
|
+
Dropdown.Trigger,
|
3074
2748
|
{
|
3075
|
-
|
2749
|
+
onClick: (e) => e.stopPropagation(),
|
2750
|
+
className: "role_actions",
|
2751
|
+
asChild: true,
|
3076
2752
|
css: {
|
3077
|
-
|
3078
|
-
|
2753
|
+
p: "$1",
|
2754
|
+
r: "$0",
|
2755
|
+
c: "$on_surface_high",
|
2756
|
+
visibility: openOptions ? "visible" : "hidden",
|
2757
|
+
"&:hover": {
|
2758
|
+
c: "$on_surface_medium"
|
2759
|
+
},
|
2760
|
+
"@md": {
|
2761
|
+
visibility: "visible"
|
2762
|
+
}
|
3079
2763
|
}
|
3080
2764
|
},
|
3081
|
-
/* @__PURE__ */ React33.createElement(Flex,
|
3082
|
-
|
2765
|
+
/* @__PURE__ */ React33.createElement(Flex, null, /* @__PURE__ */ React33.createElement(VerticalMenuIcon3, null))
|
2766
|
+
), /* @__PURE__ */ React33.createElement(
|
2767
|
+
Dropdown.Content,
|
2768
|
+
{
|
2769
|
+
onClick: (e) => e.stopPropagation(),
|
2770
|
+
css: { w: "max-content", maxWidth: "$64", bg: "$surface_default", py: 0 },
|
2771
|
+
align: "end"
|
2772
|
+
},
|
2773
|
+
canRemoveRoleFromStage && /* @__PURE__ */ React33.createElement(
|
2774
|
+
Dropdown.Item,
|
3083
2775
|
{
|
3084
|
-
|
3085
|
-
onClick:
|
3086
|
-
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
3087
|
-
color: activeTab !== SIDE_PANE_OPTIONS.CHAT ? "$on_surface_low" : "$on_surface_high"
|
3088
|
-
})
|
2776
|
+
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderBottom: "1px solid $border_bright" }),
|
2777
|
+
onClick: removeAllFromStage
|
3089
2778
|
},
|
3090
|
-
|
3091
|
-
|
3092
|
-
|
2779
|
+
/* @__PURE__ */ React33.createElement(PersonRectangleIcon, null),
|
2780
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: optionTextCSS }, "Remove all from Stage")
|
2781
|
+
),
|
2782
|
+
canMuteRole && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Dropdown.Item, { css: dropdownItemCSS, onClick: () => setTrackEnabled("audio", !allPeersHaveAudioOn) }, allPeersHaveAudioOn ? /* @__PURE__ */ React33.createElement(MicOffIcon2, null) : /* @__PURE__ */ React33.createElement(MicOnIcon, null), /* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveAudioOn ? "Mute" : "Unmute", " Audio")), /* @__PURE__ */ React33.createElement(
|
2783
|
+
Dropdown.Item,
|
3093
2784
|
{
|
3094
|
-
|
3095
|
-
onClick:
|
3096
|
-
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
3097
|
-
color: activeTab !== SIDE_PANE_OPTIONS.PARTICIPANTS ? "$on_surface_low" : "$on_surface_high"
|
3098
|
-
})
|
2785
|
+
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright" }),
|
2786
|
+
onClick: () => setTrackEnabled("video", !allPeersHaveVideoOn)
|
3099
2787
|
},
|
3100
|
-
|
3101
|
-
|
3102
|
-
|
3103
|
-
|
3104
|
-
|
3105
|
-
IconButton,
|
2788
|
+
allPeersHaveVideoOn ? /* @__PURE__ */ React33.createElement(VideoOffIcon, null) : /* @__PURE__ */ React33.createElement(VideoOnIcon, null),
|
2789
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveVideoOn ? "Mute" : "Unmute", " Video")
|
2790
|
+
)),
|
2791
|
+
canRemoveRoleFromRoom && /* @__PURE__ */ React33.createElement(
|
2792
|
+
Dropdown.Item,
|
3106
2793
|
{
|
3107
|
-
css: {
|
3108
|
-
onClick:
|
3109
|
-
e.stopPropagation();
|
3110
|
-
if (activeTab === SIDE_PANE_OPTIONS.CHAT) {
|
3111
|
-
toggleChat();
|
3112
|
-
} else {
|
3113
|
-
toggleParticipants();
|
3114
|
-
}
|
3115
|
-
},
|
3116
|
-
"data-testid": "close_chat"
|
2794
|
+
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright", color: "$alert_error_default" }),
|
2795
|
+
onClick: removePeersFromRoom
|
3117
2796
|
},
|
3118
|
-
/* @__PURE__ */ React33.createElement(
|
2797
|
+
/* @__PURE__ */ React33.createElement(RemoveUserIcon, null),
|
2798
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, optionTextCSS), { color: "inherit" }) }, "Remove all from Room")
|
3119
2799
|
)
|
3120
|
-
);
|
3121
|
-
}
|
2800
|
+
));
|
2801
|
+
};
|
3122
2802
|
|
3123
|
-
// src/Prebuilt/components/Footer/RoleAccordion.
|
3124
|
-
import React34 from "react";
|
3125
|
-
import { useMeasure } from "react-use";
|
3126
|
-
import { FixedSizeList } from "react-window";
|
2803
|
+
// src/Prebuilt/components/Footer/RoleAccordion.tsx
|
3127
2804
|
var ROW_HEIGHT = 50;
|
3128
2805
|
function itemKey(index, data3) {
|
3129
2806
|
return data3.peerList[index].id;
|
3130
2807
|
}
|
3131
2808
|
var VirtualizedParticipantItem = React34.memo(({ index, data: data3 }) => {
|
3132
|
-
return /* @__PURE__ */ React34.createElement(
|
3133
|
-
Participant,
|
3134
|
-
{
|
3135
|
-
key: data3.peerList[index].id,
|
3136
|
-
peer: data3.peerList[index],
|
3137
|
-
isConnected: data3.isConnected,
|
3138
|
-
setSelectedPeerId: data3.setSelectedPeerId
|
3139
|
-
}
|
3140
|
-
);
|
2809
|
+
return /* @__PURE__ */ React34.createElement(Participant, { key: data3.peerList[index].id, peer: data3.peerList[index], isConnected: data3.isConnected });
|
3141
2810
|
});
|
3142
2811
|
var RoleAccordion = ({
|
3143
2812
|
peerList = [],
|
3144
2813
|
roleName,
|
3145
|
-
setSelectedPeerId,
|
3146
2814
|
isConnected,
|
3147
2815
|
filter,
|
3148
2816
|
isHandRaisedAccordion = false
|
3149
2817
|
}) => {
|
3150
2818
|
const [ref, { width }] = useMeasure();
|
3151
|
-
const height = ROW_HEIGHT * peerList.length;
|
3152
2819
|
const showAcordion = (filter == null ? void 0 : filter.search) ? peerList.some((peer) => peer.name.toLowerCase().includes(filter.search)) : true;
|
3153
2820
|
if (!showAcordion || isHandRaisedAccordion && (filter == null ? void 0 : filter.search) || peerList.length === 0) {
|
3154
2821
|
return null;
|
3155
2822
|
}
|
3156
|
-
|
2823
|
+
const height = ROW_HEIGHT * peerList.length;
|
2824
|
+
return /* @__PURE__ */ React34.createElement(Flex, { direction: "column", css: { flexGrow: 1, "&:hover .role_actions": { visibility: "visible" } }, ref }, /* @__PURE__ */ React34.createElement(
|
3157
2825
|
Accordion.Root,
|
3158
2826
|
{
|
3159
2827
|
type: "single",
|
3160
2828
|
collapsible: true,
|
3161
2829
|
defaultValue: roleName,
|
3162
|
-
css: { borderRadius: "$
|
2830
|
+
css: { borderRadius: "$1", border: "1px solid $border_bright" }
|
3163
2831
|
},
|
3164
2832
|
/* @__PURE__ */ React34.createElement(Accordion.Item, { value: roleName }, /* @__PURE__ */ React34.createElement(
|
3165
2833
|
Accordion.Header,
|
3166
2834
|
{
|
2835
|
+
iconStyles: { c: "$on_surface_high" },
|
3167
2836
|
css: {
|
3168
2837
|
textTransform: "capitalize",
|
3169
2838
|
p: "$6 $8",
|
@@ -3172,14 +2841,21 @@ var RoleAccordion = ({
|
|
3172
2841
|
c: "$on_surface_medium"
|
3173
2842
|
}
|
3174
2843
|
},
|
3175
|
-
|
3176
|
-
|
3177
|
-
|
2844
|
+
/* @__PURE__ */ React34.createElement(Flex, { justify: "between", css: { flexGrow: 1, pr: "$6" } }, /* @__PURE__ */ React34.createElement(
|
2845
|
+
Text,
|
2846
|
+
{
|
2847
|
+
variant: "sm",
|
2848
|
+
css: { fontWeight: "$semiBold", textTransform: "capitalize", color: "$on_surface_medium" }
|
2849
|
+
},
|
2850
|
+
roleName,
|
2851
|
+
" ",
|
2852
|
+
`(${getFormattedCount(peerList.length)})`
|
2853
|
+
), /* @__PURE__ */ React34.createElement(RoleOptions, { roleName, peerList }))
|
3178
2854
|
), /* @__PURE__ */ React34.createElement(Accordion.Content, null, /* @__PURE__ */ React34.createElement(Box, { css: { borderTop: "1px solid $border_default" } }), /* @__PURE__ */ React34.createElement(
|
3179
2855
|
FixedSizeList,
|
3180
2856
|
{
|
3181
2857
|
itemSize: ROW_HEIGHT,
|
3182
|
-
itemData: { peerList, isConnected
|
2858
|
+
itemData: { peerList, isConnected },
|
3183
2859
|
itemKey,
|
3184
2860
|
itemCount: peerList.length,
|
3185
2861
|
width,
|
@@ -3192,10 +2868,10 @@ var RoleAccordion = ({
|
|
3192
2868
|
|
3193
2869
|
// src/Prebuilt/components/Footer/ParticipantList.jsx
|
3194
2870
|
var ParticipantList = () => {
|
3195
|
-
const [filter, setFilter] =
|
2871
|
+
const [filter, setFilter] = useState18();
|
3196
2872
|
const { participants, isConnected, peerCount } = useParticipants(filter);
|
3197
2873
|
const peersOrderedByRoles = {};
|
3198
|
-
const handRaisedPeers =
|
2874
|
+
const handRaisedPeers = useHMSStore16(selectPeersByCondition2((peer) => {
|
3199
2875
|
var _a;
|
3200
2876
|
return (_a = JSON.parse(peer.metadata || "{}")) == null ? void 0 : _a.isHandRaised;
|
3201
2877
|
}));
|
@@ -3205,8 +2881,7 @@ var ParticipantList = () => {
|
|
3205
2881
|
}
|
3206
2882
|
peersOrderedByRoles[participant.roleName].push(participant);
|
3207
2883
|
});
|
3208
|
-
const
|
3209
|
-
const onSearch = useCallback7((value) => {
|
2884
|
+
const onSearch = useCallback6((value) => {
|
3210
2885
|
setFilter((filterValue) => {
|
3211
2886
|
if (!filterValue) {
|
3212
2887
|
filterValue = {};
|
@@ -3218,30 +2893,21 @@ var ParticipantList = () => {
|
|
3218
2893
|
if (peerCount === 0) {
|
3219
2894
|
return null;
|
3220
2895
|
}
|
3221
|
-
return /* @__PURE__ */ React35.createElement(Fragment7, null, /* @__PURE__ */ React35.createElement(Flex, { direction: "column", css: { size: "100%", gap: "$4" } },
|
2896
|
+
return /* @__PURE__ */ React35.createElement(Fragment7, null, /* @__PURE__ */ React35.createElement(Flex, { direction: "column", css: { size: "100%", gap: "$4" } }, !(filter == null ? void 0 : filter.search) && participants.length === 0 ? null : /* @__PURE__ */ React35.createElement(ParticipantSearch, { onSearch, inSidePane: true }), participants.length === 0 ? /* @__PURE__ */ React35.createElement(Flex, { align: "center", justify: "center", css: { w: "100%", p: "$8 0" } }, /* @__PURE__ */ React35.createElement(Text, { variant: "sm" }, !filter ? "No participants" : "No matching participants")) : null, /* @__PURE__ */ React35.createElement(
|
3222
2897
|
VirtualizedParticipants,
|
3223
2898
|
{
|
3224
2899
|
peersOrderedByRoles,
|
3225
2900
|
handRaisedList: handRaisedPeers,
|
3226
2901
|
isConnected,
|
3227
|
-
filter
|
3228
|
-
setSelectedPeerId
|
3229
|
-
}
|
3230
|
-
), selectedPeerId && /* @__PURE__ */ React35.createElement(
|
3231
|
-
RoleChangeModal,
|
3232
|
-
{
|
3233
|
-
peerId: selectedPeerId,
|
3234
|
-
onOpenChange: (value) => {
|
3235
|
-
!value && setSelectedPeerId(null);
|
3236
|
-
}
|
2902
|
+
filter
|
3237
2903
|
}
|
3238
2904
|
)));
|
3239
2905
|
};
|
3240
2906
|
var ParticipantCount = () => {
|
3241
|
-
const peerCount =
|
2907
|
+
const peerCount = useHMSStore16(selectPeerCount2);
|
3242
2908
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
3243
2909
|
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
3244
|
-
|
2910
|
+
useEffect5(() => {
|
3245
2911
|
if (isParticipantsOpen && peerCount === 0) {
|
3246
2912
|
toggleSidepane();
|
3247
2913
|
}
|
@@ -3269,13 +2935,7 @@ var ParticipantCount = () => {
|
|
3269
2935
|
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { mx: "$4", c: "inherit" } }, peerCount)
|
3270
2936
|
);
|
3271
2937
|
};
|
3272
|
-
var VirtualizedParticipants = ({
|
3273
|
-
peersOrderedByRoles = {},
|
3274
|
-
isConnected,
|
3275
|
-
setSelectedPeerId,
|
3276
|
-
filter,
|
3277
|
-
handRaisedList = []
|
3278
|
-
}) => {
|
2938
|
+
var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter, handRaisedList = [] }) => {
|
3279
2939
|
return /* @__PURE__ */ React35.createElement(
|
3280
2940
|
Flex,
|
3281
2941
|
{
|
@@ -3295,7 +2955,6 @@ var VirtualizedParticipants = ({
|
|
3295
2955
|
roleName: "Hand Raised",
|
3296
2956
|
filter,
|
3297
2957
|
isConnected,
|
3298
|
-
setSelectedPeerId,
|
3299
2958
|
isHandRaisedAccordion: true
|
3300
2959
|
}
|
3301
2960
|
),
|
@@ -3306,14 +2965,13 @@ var VirtualizedParticipants = ({
|
|
3306
2965
|
peerList: peersOrderedByRoles[role],
|
3307
2966
|
roleName: role,
|
3308
2967
|
isConnected,
|
3309
|
-
setSelectedPeerId,
|
3310
2968
|
filter
|
3311
2969
|
}
|
3312
2970
|
))
|
3313
2971
|
);
|
3314
2972
|
};
|
3315
|
-
var Participant = ({ peer, isConnected
|
3316
|
-
const localPeerId =
|
2973
|
+
var Participant = ({ peer, isConnected }) => {
|
2974
|
+
const localPeerId = useHMSStore16(selectLocalPeerID4);
|
3317
2975
|
return /* @__PURE__ */ React35.createElement(
|
3318
2976
|
Flex,
|
3319
2977
|
{
|
@@ -3330,33 +2988,22 @@ var Participant = ({ peer, isConnected, setSelectedPeerId }) => {
|
|
3330
2988
|
"data-testid": "participant_" + peer.name
|
3331
2989
|
},
|
3332
2990
|
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, textEllipsis(150)), { fontWeight: "$semiBold", color: "$on_surface_high" }) }, peer.name, " ", localPeerId === peer.id ? "(You)" : ""),
|
3333
|
-
isConnected ? /* @__PURE__ */ React35.createElement(
|
3334
|
-
ParticipantActions,
|
3335
|
-
{
|
3336
|
-
peerId: peer.id,
|
3337
|
-
isLocal: peer.id === localPeerId,
|
3338
|
-
role: peer.roleName,
|
3339
|
-
onSettings: () => {
|
3340
|
-
setSelectedPeerId(peer.id);
|
3341
|
-
}
|
3342
|
-
}
|
3343
|
-
) : null
|
2991
|
+
isConnected ? /* @__PURE__ */ React35.createElement(ParticipantActions, { peerId: peer.id, isLocal: peer.id === localPeerId, role: peer.roleName }) : null
|
3344
2992
|
);
|
3345
2993
|
};
|
3346
|
-
var ParticipantActions = React35.memo(({
|
2994
|
+
var ParticipantActions = React35.memo(({ peerId, role, isLocal }) => {
|
3347
2995
|
var _a, _b;
|
3348
|
-
const isHandRaised = (_a =
|
3349
|
-
const canChangeRole = (_b =
|
2996
|
+
const isHandRaised = (_a = useHMSStore16(selectPeerMetadata2(peerId))) == null ? void 0 : _a.isHandRaised;
|
2997
|
+
const canChangeRole = (_b = useHMSStore16(selectPermissions8)) == null ? void 0 : _b.changeRole;
|
3350
2998
|
const shouldShowMoreActions = canChangeRole;
|
3351
|
-
const isAudioMuted = !
|
2999
|
+
const isAudioMuted = !useHMSStore16(selectIsPeerAudioEnabled(peerId));
|
3352
3000
|
return /* @__PURE__ */ React35.createElement(
|
3353
3001
|
Flex,
|
3354
3002
|
{
|
3355
3003
|
align: "center",
|
3356
3004
|
css: {
|
3357
3005
|
flexShrink: 0,
|
3358
|
-
gap: "$8"
|
3359
|
-
mt: "$2"
|
3006
|
+
gap: "$8"
|
3360
3007
|
}
|
3361
3008
|
},
|
3362
3009
|
/* @__PURE__ */ React35.createElement(ConnectionIndicator, { peerId }),
|
@@ -3376,31 +3023,31 @@ var ParticipantActions = React35.memo(({ onSettings, peerId, role, isLocal }) =>
|
|
3376
3023
|
justify: "center",
|
3377
3024
|
css: { p: "$2", c: "$on_surface_high", bg: "$surface_bright", borderRadius: "$round" }
|
3378
3025
|
},
|
3379
|
-
/* @__PURE__ */ React35.createElement(
|
3026
|
+
/* @__PURE__ */ React35.createElement(MicOffIcon3, { height: 19, width: 19 })
|
3380
3027
|
) : null,
|
3381
|
-
shouldShowMoreActions && !isInternalRole(role) && !isLocal ? /* @__PURE__ */ React35.createElement(ParticipantMoreActions, {
|
3028
|
+
shouldShowMoreActions && !isInternalRole(role) && !isLocal ? /* @__PURE__ */ React35.createElement(ParticipantMoreActions, { peerId, role }) : null
|
3382
3029
|
);
|
3383
3030
|
});
|
3384
|
-
var ParticipantMoreActions = ({
|
3385
|
-
var _a
|
3386
|
-
const hmsActions =
|
3387
|
-
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } =
|
3388
|
-
const
|
3031
|
+
var ParticipantMoreActions = ({ peerId, role }) => {
|
3032
|
+
var _a;
|
3033
|
+
const hmsActions = useHMSActions11();
|
3034
|
+
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } = useHMSStore16(selectPermissions8);
|
3035
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
3389
3036
|
const {
|
3390
3037
|
bring_to_stage_label,
|
3391
3038
|
remove_from_stage_label,
|
3392
3039
|
on_stage_role,
|
3393
3040
|
off_stage_roles = []
|
3394
|
-
} =
|
3395
|
-
const canBringToStage = off_stage_roles.includes(role);
|
3041
|
+
} = elements.on_stage_exp || {};
|
3396
3042
|
const isInStage = role === on_stage_role;
|
3397
|
-
const
|
3398
|
-
const
|
3043
|
+
const shouldShowStageRoleChange = canChangeRole && (isInStage && remove_from_stage_label || (off_stage_roles == null ? void 0 : off_stage_roles.includes(role)) && bring_to_stage_label);
|
3044
|
+
const prevRole = (_a = useHMSStore16(selectPeerMetadata2(peerId))) == null ? void 0 : _a.prevRole;
|
3045
|
+
const localPeerId = useHMSStore16(selectLocalPeerID4);
|
3399
3046
|
const isLocal = localPeerId === peerId;
|
3400
|
-
const [open, setOpen] =
|
3047
|
+
const [open, setOpen] = useState18(false);
|
3401
3048
|
const handleStageAction = () => __async(void 0, null, function* () {
|
3402
3049
|
if (isInStage) {
|
3403
|
-
hmsActions.changeRoleOfPeer(peerId, prevRole
|
3050
|
+
prevRole && hmsActions.changeRoleOfPeer(peerId, prevRole, true);
|
3404
3051
|
} else {
|
3405
3052
|
yield hmsActions.changeRoleOfPeer(peerId, on_stage_role);
|
3406
3053
|
}
|
@@ -3426,8 +3073,8 @@ var ParticipantMoreActions = ({ onRoleChange, peerId, role }) => {
|
|
3426
3073
|
},
|
3427
3074
|
tabIndex: 0
|
3428
3075
|
},
|
3429
|
-
/* @__PURE__ */ React35.createElement(Box, { css: { my: "auto" } }, /* @__PURE__ */ React35.createElement(
|
3430
|
-
), /* @__PURE__ */ React35.createElement(Dropdown.Portal, null, /* @__PURE__ */ React35.createElement(Dropdown.Content, { align: "end", sideOffset: 8, css: { w: "$64", bg: "$surface_default" } },
|
3076
|
+
/* @__PURE__ */ React35.createElement(Box, { css: { my: "auto" } }, /* @__PURE__ */ React35.createElement(VerticalMenuIcon4, null))
|
3077
|
+
), /* @__PURE__ */ React35.createElement(Dropdown.Portal, null, /* @__PURE__ */ React35.createElement(Dropdown.Content, { align: "end", sideOffset: 8, css: { w: "$64", bg: "$surface_default" } }, shouldShowStageRoleChange ? /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { bg: "$surface_default" }, onClick: () => handleStageAction() }, /* @__PURE__ */ React35.createElement(ChangeRoleIcon2, null), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$4", fontWeight: "$semiBold", c: "$on_surface_high" } }, isInStage ? remove_from_stage_label : bring_to_stage_label)) : null, !isLocal && canRemoveOthers && /* @__PURE__ */ React35.createElement(
|
3431
3078
|
Dropdown.Item,
|
3432
3079
|
{
|
3433
3080
|
css: { color: "$alert_error_default", bg: "$surface_default" },
|
@@ -3487,11 +3134,22 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3487
3134
|
};
|
3488
3135
|
|
3489
3136
|
// src/Prebuilt/components/Footer/Footer.tsx
|
3137
|
+
var VirtualBackground = React36.lazy(() => import("./VirtualBackground-37FXUPYO.js"));
|
3490
3138
|
var Footer2 = ({
|
3491
3139
|
screenType,
|
3492
3140
|
elements
|
3493
3141
|
}) => {
|
3142
|
+
var _a, _b;
|
3494
3143
|
const isMobile = useMedia5(config.media.md);
|
3144
|
+
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay);
|
3145
|
+
const openByDefault = ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.initial_state) === Chat_ChatState.CHAT_STATE_OPEN;
|
3146
|
+
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3147
|
+
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3148
|
+
useEffect6(() => {
|
3149
|
+
if (!isChatOpen && openByDefault) {
|
3150
|
+
toggleChat();
|
3151
|
+
}
|
3152
|
+
}, [toggleChat, openByDefault]);
|
3495
3153
|
return /* @__PURE__ */ React36.createElement(
|
3496
3154
|
Footer.Root,
|
3497
3155
|
{
|
@@ -3501,7 +3159,8 @@ var Footer2 = ({
|
|
3501
3159
|
justifyContent: "center",
|
3502
3160
|
gap: "$10",
|
3503
3161
|
position: "relative",
|
3504
|
-
|
3162
|
+
// To prevent it from showing over the sidepane if chat type is not overlay
|
3163
|
+
zIndex: isOverlayChat ? 20 : 1
|
3505
3164
|
}
|
3506
3165
|
}
|
3507
3166
|
},
|
@@ -3517,7 +3176,8 @@ var Footer2 = ({
|
|
3517
3176
|
}
|
3518
3177
|
},
|
3519
3178
|
isMobile ? /* @__PURE__ */ React36.createElement(LeaveRoom, { screenType }) : null,
|
3520
|
-
/* @__PURE__ */ React36.createElement(AudioVideoToggle, null)
|
3179
|
+
/* @__PURE__ */ React36.createElement(AudioVideoToggle, null),
|
3180
|
+
isMobile ? null : /* @__PURE__ */ React36.createElement(Suspense, { fallback: /* @__PURE__ */ React36.createElement(React36.Fragment, null) }, /* @__PURE__ */ React36.createElement(VirtualBackground, null))
|
3521
3181
|
),
|
3522
3182
|
/* @__PURE__ */ React36.createElement(
|
3523
3183
|
Footer.Center,
|
@@ -3529,21 +3189,21 @@ var Footer2 = ({
|
|
3529
3189
|
}
|
3530
3190
|
}
|
3531
3191
|
},
|
3532
|
-
isMobile ? /* @__PURE__ */ React36.createElement(React36.Fragment, null, screenType === "hls_live_streaming" ? /* @__PURE__ */ React36.createElement(RaiseHand, null) : null, (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React36.createElement(ChatToggle, null), /* @__PURE__ */ React36.createElement(MoreSettings, { elements, screenType })) : /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(ScreenshareToggle, null),
|
3192
|
+
isMobile ? /* @__PURE__ */ React36.createElement(React36.Fragment, null, screenType === "hls_live_streaming" ? /* @__PURE__ */ React36.createElement(RaiseHand, null) : null, (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React36.createElement(ChatToggle, null), /* @__PURE__ */ React36.createElement(MoreSettings, { elements, screenType })) : /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(ScreenshareToggle, null), /* @__PURE__ */ React36.createElement(RaiseHand, null), (elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React36.createElement(EmojiReaction, null), /* @__PURE__ */ React36.createElement(LeaveRoom, { screenType }))
|
3533
3193
|
),
|
3534
|
-
/* @__PURE__ */ React36.createElement(Footer.Right, null, (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React36.createElement(ChatToggle, null), /* @__PURE__ */ React36.createElement(ParticipantCount, null), /* @__PURE__ */ React36.createElement(MoreSettings, { elements, screenType }))
|
3194
|
+
/* @__PURE__ */ React36.createElement(Footer.Right, null, !isMobile && (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React36.createElement(ChatToggle, null), (elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React36.createElement(ParticipantCount, null), /* @__PURE__ */ React36.createElement(MoreSettings, { elements, screenType }))
|
3535
3195
|
);
|
3536
3196
|
};
|
3537
3197
|
|
3538
3198
|
// src/Prebuilt/components/Notifications/HLSFailureModal.jsx
|
3539
|
-
import React37, { useCallback as
|
3540
|
-
import { selectHLSState, useHMSActions as
|
3199
|
+
import React37, { useCallback as useCallback7, useState as useState19 } from "react";
|
3200
|
+
import { selectHLSState as selectHLSState2, useHMSActions as useHMSActions12, useHMSStore as useHMSStore17 } from "@100mslive/react-sdk";
|
3541
3201
|
function HLSFailureModal() {
|
3542
|
-
const { hlsError } =
|
3543
|
-
const [openModal, setOpenModal] =
|
3544
|
-
const hmsActions =
|
3202
|
+
const { hlsError } = useHMSStore17(selectHLSState2).error || false;
|
3203
|
+
const [openModal, setOpenModal] = useState19(!!hlsError);
|
3204
|
+
const hmsActions = useHMSActions12();
|
3545
3205
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
3546
|
-
const startHLS =
|
3206
|
+
const startHLS = useCallback7(() => __async(this, null, function* () {
|
3547
3207
|
try {
|
3548
3208
|
if (isHLSStarted) {
|
3549
3209
|
return;
|
@@ -3585,39 +3245,52 @@ function HLSFailureModal() {
|
|
3585
3245
|
}
|
3586
3246
|
|
3587
3247
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
3588
|
-
import
|
3589
|
-
import {
|
3590
|
-
selectIsConnectedToRoom as selectIsConnectedToRoom7,
|
3591
|
-
selectLocalPeerRoleName as selectLocalPeerRoleName3,
|
3592
|
-
selectPermissions as selectPermissions11,
|
3593
|
-
useHMSActions as useHMSActions19,
|
3594
|
-
useHMSStore as useHMSStore34,
|
3595
|
-
useRecordingStreaming as useRecordingStreaming8
|
3596
|
-
} from "@100mslive/react-sdk";
|
3248
|
+
import React60, { Suspense as Suspense2, useEffect as useEffect23 } from "react";
|
3249
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as selectLocalPeerRoleName2, useHMSActions as useHMSActions20, useHMSStore as useHMSStore34 } from "@100mslive/react-sdk";
|
3597
3250
|
|
3598
3251
|
// src/Prebuilt/components/VideoLayouts/GridLayout.tsx
|
3599
|
-
import React49, { useEffect as useEffect14, useMemo as useMemo6, useState as
|
3600
|
-
import {
|
3601
|
-
selectPeers as selectPeers3,
|
3602
|
-
selectPeerScreenSharing,
|
3603
|
-
selectRemotePeers as selectRemotePeers2,
|
3604
|
-
useHMSStore as useHMSStore24,
|
3605
|
-
useHMSVanillaStore as useHMSVanillaStore4
|
3606
|
-
} from "@100mslive/react-sdk";
|
3252
|
+
import React49, { useEffect as useEffect14, useMemo as useMemo6, useState as useState26 } from "react";
|
3253
|
+
import { selectPeers as selectPeers2, selectPeerScreenSharing, useHMSStore as useHMSStore23, useHMSVanillaStore as useHMSVanillaStore4 } from "@100mslive/react-sdk";
|
3607
3254
|
|
3608
3255
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3609
|
-
import React42, { useEffect as useEffect10, useMemo as useMemo3, useState as
|
3256
|
+
import React42, { useEffect as useEffect10, useMemo as useMemo3, useState as useState21 } from "react";
|
3610
3257
|
import { useMedia as useMedia8 } from "react-use";
|
3611
|
-
import { selectLocalPeer as selectLocalPeer3, useHMSStore as
|
3258
|
+
import { selectLocalPeer as selectLocalPeer3, useHMSStore as useHMSStore19 } from "@100mslive/react-sdk";
|
3612
3259
|
|
3613
3260
|
// src/Prebuilt/components/InsetTile.tsx
|
3614
|
-
import
|
3261
|
+
import React39, { useEffect as useEffect7, useRef as useRef6 } from "react";
|
3615
3262
|
import Draggable from "react-draggable";
|
3616
3263
|
import { useMedia as useMedia6 } from "react-use";
|
3617
|
-
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer as selectLocalPeer2, selectVideoTrackByID, useHMSStore as
|
3264
|
+
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer as selectLocalPeer2, selectVideoTrackByID, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
3618
3265
|
import { ExpandIcon as ExpandIcon2 } from "@100mslive/react-icons";
|
3266
|
+
|
3267
|
+
// src/Prebuilt/components/hooks/useVideoTileLayout.ts
|
3268
|
+
import React38, { useContext } from "react";
|
3269
|
+
var VideoTileContext = React38.createContext({
|
3270
|
+
enableSpotlightingPeer: true,
|
3271
|
+
hideParticipantNameOnTile: false,
|
3272
|
+
roundedVideoTile: true,
|
3273
|
+
hideAudioMuteOnTile: false,
|
3274
|
+
hideAudioLevelOnTile: false,
|
3275
|
+
objectFit: "contain",
|
3276
|
+
hideMetadataOnTile: false
|
3277
|
+
});
|
3278
|
+
var useVideoTileContext = () => {
|
3279
|
+
const context = useContext(VideoTileContext);
|
3280
|
+
return context;
|
3281
|
+
};
|
3282
|
+
|
3283
|
+
// src/Prebuilt/components/InsetTile.tsx
|
3619
3284
|
var MinimisedTile = ({ setMinimised }) => {
|
3620
|
-
return /* @__PURE__ */
|
3285
|
+
return /* @__PURE__ */ React39.createElement(Flex, { align: "center", css: { gap: "$6", r: "$1", bg: "$surface_default", p: "$4", color: "$on_surface_high" } }, /* @__PURE__ */ React39.createElement(AudioVideoToggle, { hideOptions: true }), /* @__PURE__ */ React39.createElement(Text, null, "You"), /* @__PURE__ */ React39.createElement(
|
3286
|
+
IconButton_default,
|
3287
|
+
{
|
3288
|
+
className: "__cancel-drag-event",
|
3289
|
+
onClick: () => setMinimised(false),
|
3290
|
+
css: { bg: "transparent", border: "transparent" }
|
3291
|
+
},
|
3292
|
+
/* @__PURE__ */ React39.createElement(ExpandIcon2, null)
|
3293
|
+
));
|
3621
3294
|
};
|
3622
3295
|
var insetHeightPx = 180;
|
3623
3296
|
var insetMaxWidthPx = 240;
|
@@ -3626,18 +3299,22 @@ var desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
|
3626
3299
|
var InsetTile = () => {
|
3627
3300
|
const isMobile = useMedia6(config.media.md);
|
3628
3301
|
const isLandscape = useMedia6(config.media.ls);
|
3629
|
-
const localPeer =
|
3302
|
+
const localPeer = useHMSStore18(selectLocalPeer2);
|
3630
3303
|
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
3631
|
-
const videoTrack =
|
3632
|
-
const isAllowedToPublish =
|
3633
|
-
const
|
3304
|
+
const videoTrack = useHMSStore18(selectVideoTrackByID(localPeer == null ? void 0 : localPeer.videoTrack));
|
3305
|
+
const isAllowedToPublish = useHMSStore18(selectIsAllowedToPublish2);
|
3306
|
+
const videoTileProps = useVideoTileContext();
|
3307
|
+
let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;
|
3308
|
+
if ((videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) && !isMobile) {
|
3309
|
+
aspectRatio = videoTrack.width / videoTrack.height;
|
3310
|
+
}
|
3634
3311
|
let height = insetHeightPx;
|
3635
3312
|
let width = height * aspectRatio;
|
3636
3313
|
if (isLandscape && width > insetMaxWidthPx) {
|
3637
3314
|
width = 240;
|
3638
3315
|
height = width / aspectRatio;
|
3639
3316
|
}
|
3640
|
-
const nodeRef =
|
3317
|
+
const nodeRef = useRef6(null);
|
3641
3318
|
useEffect7(() => {
|
3642
3319
|
const node = nodeRef.current;
|
3643
3320
|
if (!node || !window.ResizeObserver) {
|
@@ -3659,7 +3336,7 @@ var InsetTile = () => {
|
|
3659
3336
|
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
3660
3337
|
return null;
|
3661
3338
|
}
|
3662
|
-
return /* @__PURE__ */
|
3339
|
+
return /* @__PURE__ */ React39.createElement(Draggable, { bounds: "parent", nodeRef, cancel: ".__cancel-drag-event" }, /* @__PURE__ */ React39.createElement(
|
3663
3340
|
Box,
|
3664
3341
|
{
|
3665
3342
|
ref: nodeRef,
|
@@ -3675,9 +3352,9 @@ var InsetTile = () => {
|
|
3675
3352
|
h: height
|
3676
3353
|
} : {})
|
3677
3354
|
},
|
3678
|
-
minimised ? /* @__PURE__ */
|
3355
|
+
minimised ? /* @__PURE__ */ React39.createElement(MinimisedTile, { setMinimised }) : /* @__PURE__ */ React39.createElement(
|
3679
3356
|
VideoTile_default,
|
3680
|
-
{
|
3357
|
+
__spreadProps(__spreadValues({
|
3681
3358
|
peerId: localPeer == null ? void 0 : localPeer.id,
|
3682
3359
|
trackid: localPeer == null ? void 0 : localPeer.videoTrack,
|
3683
3360
|
rootCSS: {
|
@@ -3687,14 +3364,17 @@ var InsetTile = () => {
|
|
3687
3364
|
width,
|
3688
3365
|
height,
|
3689
3366
|
containerCSS: { background: "$surface_default" },
|
3690
|
-
canMinimise: true
|
3691
|
-
|
3367
|
+
canMinimise: true,
|
3368
|
+
isDragabble: true
|
3369
|
+
}, videoTileProps), {
|
3370
|
+
hideParticipantNameOnTile: true
|
3371
|
+
})
|
3692
3372
|
)
|
3693
3373
|
));
|
3694
3374
|
};
|
3695
3375
|
|
3696
3376
|
// src/Prebuilt/components/Pagination.tsx
|
3697
|
-
import
|
3377
|
+
import React40, { useEffect as useEffect8 } from "react";
|
3698
3378
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@100mslive/react-icons";
|
3699
3379
|
var Pagination = ({
|
3700
3380
|
page,
|
@@ -3719,7 +3399,7 @@ var Pagination = ({
|
|
3719
3399
|
if (numPages <= 1) {
|
3720
3400
|
return null;
|
3721
3401
|
}
|
3722
|
-
return /* @__PURE__ */
|
3402
|
+
return /* @__PURE__ */ React40.createElement(StyledPagination.Root, { css: { flexShrink: 0 } }, /* @__PURE__ */ React40.createElement(StyledPagination.Chevron, { disabled: disableLeft, onClick: prevPage }, /* @__PURE__ */ React40.createElement(ChevronLeftIcon2, { width: 16, height: 16, style: { cursor: disableLeft ? "not-allowed" : "pointer" } })), numPages <= 5 ? /* @__PURE__ */ React40.createElement(StyledPagination.Dots, null, [...Array(numPages)].map((_, i) => /* @__PURE__ */ React40.createElement(
|
3723
3403
|
StyledPagination.Dot,
|
3724
3404
|
{
|
3725
3405
|
key: i,
|
@@ -3729,65 +3409,51 @@ var Pagination = ({
|
|
3729
3409
|
onPageChange(i);
|
3730
3410
|
}
|
3731
3411
|
}
|
3732
|
-
))), /* @__PURE__ */
|
3412
|
+
))) : null, /* @__PURE__ */ React40.createElement(StyledPagination.Chevron, { disabled: disableRight, onClick: nextPage }, /* @__PURE__ */ React40.createElement(ChevronRightIcon2, { width: 16, height: 16, style: { cursor: disableRight ? "not-allowed" : "pointer" } })));
|
3733
3413
|
};
|
3734
3414
|
|
3735
3415
|
// src/Prebuilt/components/VideoLayouts/Grid.tsx
|
3736
3416
|
import React41 from "react";
|
3737
|
-
|
3738
|
-
|
3739
|
-
|
3740
|
-
|
3741
|
-
|
3742
|
-
|
3743
|
-
|
3744
|
-
|
3745
|
-
|
3746
|
-
|
3747
|
-
|
3748
|
-
|
3749
|
-
|
3750
|
-
|
3751
|
-
|
3752
|
-
|
3753
|
-
|
3754
|
-
|
3755
|
-
|
3756
|
-
|
3757
|
-
|
3758
|
-
|
3759
|
-
|
3760
|
-
|
3761
|
-
|
3762
|
-
|
3763
|
-
|
3764
|
-
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3768
|
-
|
3769
|
-
|
3770
|
-
|
3771
|
-
|
3772
|
-
|
3773
|
-
|
3774
|
-
VideoTile_default,
|
3775
|
-
__spreadValues({
|
3776
|
-
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
3777
|
-
width: tile.width,
|
3778
|
-
height: tile.height,
|
3779
|
-
peerId: (_c = tile.peer) == null ? void 0 : _c.id,
|
3780
|
-
trackId: (_d = tile.track) == null ? void 0 : _d.id,
|
3781
|
-
rootCSS: { padding: 0 },
|
3782
|
-
objectFit: "contain"
|
3783
|
-
}, videoTileProps)
|
3784
|
-
);
|
3785
|
-
})
|
3786
|
-
);
|
3787
|
-
});
|
3417
|
+
var Grid = React41.forwardRef(
|
3418
|
+
({ tiles, edgeToEdge }, ref) => {
|
3419
|
+
const videoTileProps = useVideoTileContext();
|
3420
|
+
return /* @__PURE__ */ React41.createElement(
|
3421
|
+
Box,
|
3422
|
+
{
|
3423
|
+
ref,
|
3424
|
+
css: {
|
3425
|
+
flex: "1 1 0",
|
3426
|
+
gap: "$4",
|
3427
|
+
display: "flex",
|
3428
|
+
placeContent: "center",
|
3429
|
+
alignItems: "center",
|
3430
|
+
justifyContent: "center",
|
3431
|
+
flexFlow: "row wrap",
|
3432
|
+
minHeight: 0,
|
3433
|
+
"@md": { gap: edgeToEdge ? 0 : "$4" }
|
3434
|
+
}
|
3435
|
+
},
|
3436
|
+
tiles == null ? void 0 : tiles.map((tile) => {
|
3437
|
+
var _a, _b, _c, _d;
|
3438
|
+
return /* @__PURE__ */ React41.createElement(
|
3439
|
+
VideoTile_default,
|
3440
|
+
__spreadValues({
|
3441
|
+
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
3442
|
+
width: tile.width,
|
3443
|
+
height: tile.height,
|
3444
|
+
peerId: (_c = tile.peer) == null ? void 0 : _c.id,
|
3445
|
+
trackId: (_d = tile.track) == null ? void 0 : _d.id,
|
3446
|
+
rootCSS: { padding: 0 },
|
3447
|
+
objectFit: "contain"
|
3448
|
+
}, videoTileProps)
|
3449
|
+
);
|
3450
|
+
})
|
3451
|
+
);
|
3452
|
+
}
|
3453
|
+
);
|
3788
3454
|
|
3789
3455
|
// src/Prebuilt/components/hooks/useTileLayout.tsx
|
3790
|
-
import { useEffect as useEffect9, useMemo as useMemo2, useState as
|
3456
|
+
import { useEffect as useEffect9, useMemo as useMemo2, useState as useState20 } from "react";
|
3791
3457
|
import { useMeasure as useMeasure2, useMedia as useMedia7 } from "react-use";
|
3792
3458
|
import {
|
3793
3459
|
getPeersWithTiles,
|
@@ -3795,7 +3461,6 @@ import {
|
|
3795
3461
|
useHMSVanillaStore as useHMSVanillaStore3
|
3796
3462
|
} from "@100mslive/react-sdk";
|
3797
3463
|
var aspectRatioConfig = { default: [1 / 1, 4 / 3, 16 / 9], mobile: [1 / 1, 3 / 4, 9 / 16] };
|
3798
|
-
var gap = 8;
|
3799
3464
|
var usePagesWithTiles = ({ peers, maxTileCount }) => {
|
3800
3465
|
const vanillaStore = useHMSVanillaStore3();
|
3801
3466
|
const tracksMap = vanillaStore.getState(selectTracksMap3);
|
@@ -3820,12 +3485,13 @@ var usePagesWithTiles = ({ peers, maxTileCount }) => {
|
|
3820
3485
|
};
|
3821
3486
|
var useTileLayout = ({
|
3822
3487
|
pageList,
|
3823
|
-
maxTileCount
|
3488
|
+
maxTileCount,
|
3489
|
+
edgeToEdge = false
|
3824
3490
|
}) => {
|
3825
3491
|
const vanillaStore = useHMSVanillaStore3();
|
3826
3492
|
const [ref, { width, height }] = useMeasure2();
|
3827
3493
|
const isMobile = useMedia7(config.media.lg);
|
3828
|
-
const [pagesWithTiles, setPagesWithTiles] =
|
3494
|
+
const [pagesWithTiles, setPagesWithTiles] = useState20([]);
|
3829
3495
|
useEffect9(() => {
|
3830
3496
|
if (width === 0 || height === 0) {
|
3831
3497
|
return;
|
@@ -3848,28 +3514,33 @@ var useTileLayout = ({
|
|
3848
3514
|
}
|
3849
3515
|
return rowElements;
|
3850
3516
|
});
|
3517
|
+
const gap = edgeToEdge && isMobile ? 0 : 8;
|
3851
3518
|
const maxHeight = height - (maxRows - 1) * gap;
|
3852
3519
|
const maxRowHeight = maxHeight / matrix.length;
|
3853
3520
|
const aspectRatios = isMobile && (noOfTilesInPage === 1 || noOfTilesInPage > 3) ? aspectRatioConfig.mobile : aspectRatioConfig.default;
|
3854
3521
|
for (const row of matrix) {
|
3855
3522
|
let tileWidth = (width - (row.length - 1) * gap) / row.length;
|
3856
3523
|
let tileHeight = 0;
|
3857
|
-
|
3858
|
-
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3524
|
+
if (edgeToEdge) {
|
3525
|
+
tileHeight = maxRowHeight;
|
3526
|
+
} else {
|
3527
|
+
const calcHeights = aspectRatios.map((aR) => tileWidth / aR);
|
3528
|
+
for (const h of calcHeights) {
|
3529
|
+
if (h < maxRowHeight) {
|
3530
|
+
if (tileHeight < h) {
|
3531
|
+
tileHeight = h;
|
3532
|
+
}
|
3862
3533
|
}
|
3863
3534
|
}
|
3864
|
-
|
3865
|
-
|
3866
|
-
|
3867
|
-
|
3868
|
-
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
3872
|
-
|
3535
|
+
if (tileHeight === 0) {
|
3536
|
+
tileHeight = maxRowHeight;
|
3537
|
+
const calcWidths = aspectRatios.map((aR) => tileHeight * aR);
|
3538
|
+
tileWidth = 0;
|
3539
|
+
for (const w of calcWidths) {
|
3540
|
+
if (w < width) {
|
3541
|
+
if (tileWidth < w) {
|
3542
|
+
tileWidth = w;
|
3543
|
+
}
|
3873
3544
|
}
|
3874
3545
|
}
|
3875
3546
|
}
|
@@ -3881,14 +3552,14 @@ var useTileLayout = ({
|
|
3881
3552
|
}
|
3882
3553
|
}
|
3883
3554
|
setPagesWithTiles([...pageList]);
|
3884
|
-
}, [width, height, maxTileCount, pageList, vanillaStore, isMobile]);
|
3555
|
+
}, [width, height, maxTileCount, pageList, vanillaStore, isMobile, edgeToEdge]);
|
3885
3556
|
return { pagesWithTiles, ref };
|
3886
3557
|
};
|
3887
3558
|
|
3888
3559
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3889
|
-
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize }) {
|
3560
|
+
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }) {
|
3890
3561
|
var _a;
|
3891
|
-
const localPeer =
|
3562
|
+
const localPeer = useHMSStore19(selectLocalPeer3);
|
3892
3563
|
const isMobile = useMedia8(config.media.md);
|
3893
3564
|
let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
|
3894
3565
|
maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
|
@@ -3906,16 +3577,17 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3906
3577
|
});
|
3907
3578
|
const { ref, pagesWithTiles } = useTileLayout({
|
3908
3579
|
pageList,
|
3909
|
-
maxTileCount
|
3580
|
+
maxTileCount,
|
3581
|
+
edgeToEdge
|
3910
3582
|
});
|
3911
|
-
const [page, setPage] =
|
3583
|
+
const [page, setPage] = useState21(0);
|
3912
3584
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3913
3585
|
useEffect10(() => {
|
3914
3586
|
if (pageSize > 0) {
|
3915
3587
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3916
3588
|
}
|
3917
3589
|
}, [pageSize, onPageSize]);
|
3918
|
-
return /* @__PURE__ */ React42.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React42.createElement(Grid, { tiles: pagesWithTiles[page], ref }), /* @__PURE__ */ React42.createElement(
|
3590
|
+
return /* @__PURE__ */ React42.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React42.createElement(Grid, { tiles: pagesWithTiles[page], ref, edgeToEdge }), !edgeToEdge && /* @__PURE__ */ React42.createElement(
|
3919
3591
|
Pagination,
|
3920
3592
|
{
|
3921
3593
|
page,
|
@@ -3929,44 +3601,69 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3929
3601
|
}
|
3930
3602
|
|
3931
3603
|
// src/Prebuilt/components/VideoLayouts/RoleProminence.tsx
|
3932
|
-
import React45, { useEffect as useEffect12, useState as
|
3933
|
-
import { selectLocalPeer as selectLocalPeer4, useHMSStore as
|
3604
|
+
import React45, { useEffect as useEffect12, useState as useState23 } from "react";
|
3605
|
+
import { selectLocalPeer as selectLocalPeer4, useHMSStore as useHMSStore20 } from "@100mslive/react-sdk";
|
3934
3606
|
|
3935
3607
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3936
|
-
import React44, { useEffect as useEffect11, useState as
|
3608
|
+
import React44, { useEffect as useEffect11, useState as useState22 } from "react";
|
3937
3609
|
import { useMedia as useMedia9 } from "react-use";
|
3938
3610
|
|
3939
3611
|
// src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx
|
3940
3612
|
import React43 from "react";
|
3941
|
-
var Root = ({ children }) => /* @__PURE__ */ React43.createElement(
|
3613
|
+
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React43.createElement(
|
3614
|
+
Flex,
|
3615
|
+
{
|
3616
|
+
direction: "column",
|
3617
|
+
css: { h: "100%", flex: "1 1 0", minWidth: 0, gap: "$6", "@md": { gap: edgeToEdge ? 0 : "$6" } }
|
3618
|
+
},
|
3619
|
+
children
|
3620
|
+
);
|
3942
3621
|
var ProminentSection = ({ children, css = {} }) => {
|
3943
3622
|
return /* @__PURE__ */ React43.createElement(Flex, { direction: "column", css: __spreadValues({ flex: "1 1 0", gap: "$2", minHeight: 0 }, css) }, children);
|
3944
3623
|
};
|
3945
|
-
var SecondarySection = ({
|
3624
|
+
var SecondarySection = ({
|
3625
|
+
tiles,
|
3626
|
+
children,
|
3627
|
+
edgeToEdge
|
3628
|
+
}) => {
|
3946
3629
|
const tileLayoutProps = useVideoTileContext();
|
3947
|
-
|
3948
|
-
|
3949
|
-
|
3950
|
-
|
3951
|
-
|
3952
|
-
|
3953
|
-
|
3954
|
-
|
3955
|
-
|
3956
|
-
|
3957
|
-
|
3958
|
-
|
3959
|
-
|
3960
|
-
}
|
3961
|
-
|
3962
|
-
|
3963
|
-
|
3964
|
-
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
3968
|
-
|
3969
|
-
|
3630
|
+
if (!(tiles == null ? void 0 : tiles.length)) {
|
3631
|
+
return null;
|
3632
|
+
}
|
3633
|
+
return /* @__PURE__ */ React43.createElement(
|
3634
|
+
Box,
|
3635
|
+
{
|
3636
|
+
css: {
|
3637
|
+
display: "grid",
|
3638
|
+
gridTemplateRows: React43.Children.count(children) > 0 ? "136px auto" : "154px",
|
3639
|
+
gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`,
|
3640
|
+
margin: "0 auto",
|
3641
|
+
gap: "$2 $4",
|
3642
|
+
placeItems: "center",
|
3643
|
+
"@md": { gap: edgeToEdge ? 0 : "$4" }
|
3644
|
+
}
|
3645
|
+
},
|
3646
|
+
tiles.map((tile) => {
|
3647
|
+
var _a, _b, _c, _d;
|
3648
|
+
return /* @__PURE__ */ React43.createElement(
|
3649
|
+
VideoTile_default,
|
3650
|
+
__spreadValues({
|
3651
|
+
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
3652
|
+
peerId: (_c = tile.peer) == null ? void 0 : _c.id,
|
3653
|
+
trackId: (_d = tile.track) == null ? void 0 : _d.id,
|
3654
|
+
rootCSS: {
|
3655
|
+
padding: 0,
|
3656
|
+
maxWidth: 240,
|
3657
|
+
maxHeight: "100%",
|
3658
|
+
aspectRatio: 16 / 9,
|
3659
|
+
"@md": { aspectRatio: 1 }
|
3660
|
+
},
|
3661
|
+
objectFit: "contain"
|
3662
|
+
}, tileLayoutProps)
|
3663
|
+
);
|
3664
|
+
}),
|
3665
|
+
/* @__PURE__ */ React43.createElement(Box, { css: { gridColumn: `1/span ${tiles.length}` } }, children)
|
3666
|
+
);
|
3970
3667
|
};
|
3971
3668
|
var ProminenceLayout = {
|
3972
3669
|
Root,
|
@@ -3975,19 +3672,19 @@ var ProminenceLayout = {
|
|
3975
3672
|
};
|
3976
3673
|
|
3977
3674
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3978
|
-
var SecondaryTiles = ({ peers, onPageChange, onPageSize }) => {
|
3675
|
+
var SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
3979
3676
|
var _a;
|
3980
3677
|
const isMobile = useMedia9(config.media.md);
|
3981
3678
|
const maxTileCount = isMobile ? 2 : 4;
|
3982
3679
|
const pagesWithTiles = usePagesWithTiles({ peers, maxTileCount });
|
3983
|
-
const [page, setPage] =
|
3680
|
+
const [page, setPage] = useState22(0);
|
3984
3681
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3985
3682
|
useEffect11(() => {
|
3986
3683
|
if (pageSize > 0) {
|
3987
3684
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3988
3685
|
}
|
3989
3686
|
}, [pageSize, onPageSize]);
|
3990
|
-
return /* @__PURE__ */ React44.createElement(ProminenceLayout.SecondarySection, { tiles: pagesWithTiles[page] }, /* @__PURE__ */ React44.createElement(
|
3687
|
+
return /* @__PURE__ */ React44.createElement(ProminenceLayout.SecondarySection, { tiles: pagesWithTiles[page], edgeToEdge }, !edgeToEdge && /* @__PURE__ */ React44.createElement(
|
3991
3688
|
Pagination,
|
3992
3689
|
{
|
3993
3690
|
page,
|
@@ -4010,7 +3707,7 @@ var useRoleProminencePeers = (prominentRoles, peers, isInsetEnabled) => {
|
|
4010
3707
|
if (pinnedTrack) {
|
4011
3708
|
if (pinnedTrack.peerId === peer.id) {
|
4012
3709
|
acc[0].push(peer);
|
4013
|
-
} else {
|
3710
|
+
} else if (!(isInsetEnabled && peer.isLocal)) {
|
4014
3711
|
acc[1].push(peer);
|
4015
3712
|
}
|
4016
3713
|
return acc;
|
@@ -4040,11 +3737,12 @@ function RoleProminence({
|
|
4040
3737
|
prominentRoles = [],
|
4041
3738
|
peers,
|
4042
3739
|
onPageChange,
|
4043
|
-
onPageSize
|
3740
|
+
onPageSize,
|
3741
|
+
edgeToEdge
|
4044
3742
|
}) {
|
4045
3743
|
var _a;
|
4046
3744
|
const { prominentPeers, secondaryPeers } = useRoleProminencePeers(prominentRoles, peers, isInsetEnabled);
|
4047
|
-
const localPeer =
|
3745
|
+
const localPeer = useHMSStore20(selectLocalPeer4);
|
4048
3746
|
const maxTileCount = 4;
|
4049
3747
|
const pageList = usePagesWithTiles({
|
4050
3748
|
peers: prominentPeers,
|
@@ -4054,14 +3752,14 @@ function RoleProminence({
|
|
4054
3752
|
pageList,
|
4055
3753
|
maxTileCount
|
4056
3754
|
});
|
4057
|
-
const [page, setPage] =
|
3755
|
+
const [page, setPage] = useState23(0);
|
4058
3756
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
4059
3757
|
useEffect12(() => {
|
4060
3758
|
if (pageSize > 0) {
|
4061
3759
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
4062
3760
|
}
|
4063
3761
|
}, [pageSize, onPageSize]);
|
4064
|
-
return /* @__PURE__ */ React45.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React45.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React45.createElement(Grid, { ref, tiles: pagesWithTiles[page] })), /* @__PURE__ */ React45.createElement(
|
3762
|
+
return /* @__PURE__ */ React45.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React45.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React45.createElement(Grid, { ref, tiles: pagesWithTiles[page] })), !edgeToEdge && /* @__PURE__ */ React45.createElement(
|
4065
3763
|
Pagination,
|
4066
3764
|
{
|
4067
3765
|
page,
|
@@ -4071,15 +3769,16 @@ function RoleProminence({
|
|
4071
3769
|
},
|
4072
3770
|
numPages: pagesWithTiles.length
|
4073
3771
|
}
|
4074
|
-
), /* @__PURE__ */ React45.createElement(SecondaryTiles, { peers: secondaryPeers, isInsetEnabled }), isInsetEnabled && localPeer && !prominentPeers.includes(localPeer) && /* @__PURE__ */ React45.createElement(InsetTile, null));
|
3772
|
+
), /* @__PURE__ */ React45.createElement(SecondaryTiles, { peers: secondaryPeers, isInsetEnabled, edgeToEdge }), isInsetEnabled && localPeer && !prominentPeers.includes(localPeer) && /* @__PURE__ */ React45.createElement(InsetTile, null));
|
4075
3773
|
}
|
4076
3774
|
|
4077
3775
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
4078
|
-
import React48, { useEffect as useEffect13, useMemo as useMemo5, useState as
|
4079
|
-
import {
|
3776
|
+
import React48, { useEffect as useEffect13, useMemo as useMemo5, useState as useState25 } from "react";
|
3777
|
+
import { useMedia as useMedia10 } from "react-use";
|
3778
|
+
import { selectPeersScreenSharing, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
4080
3779
|
|
4081
3780
|
// src/Prebuilt/components/ScreenshareTile.jsx
|
4082
|
-
import React47, { useRef as
|
3781
|
+
import React47, { useRef as useRef7, useState as useState24 } from "react";
|
4083
3782
|
import { useFullscreen as useFullscreen2 } from "react-use";
|
4084
3783
|
import screenfull2 from "screenfull";
|
4085
3784
|
import {
|
@@ -4087,16 +3786,16 @@ import {
|
|
4087
3786
|
selectPeerByID as selectPeerByID2,
|
4088
3787
|
selectScreenShareAudioByPeerID,
|
4089
3788
|
selectScreenShareByPeerID,
|
4090
|
-
useHMSStore as
|
3789
|
+
useHMSStore as useHMSStore21
|
4091
3790
|
} from "@100mslive/react-sdk";
|
4092
3791
|
import { ExpandIcon as ExpandIcon3, ShrinkIcon } from "@100mslive/react-icons";
|
4093
3792
|
|
4094
3793
|
// src/Prebuilt/components/ScreenshareDisplay.jsx
|
4095
3794
|
import React46 from "react";
|
4096
|
-
import { useHMSActions as
|
4097
|
-
import { CrossIcon as
|
3795
|
+
import { useHMSActions as useHMSActions13 } from "@100mslive/react-sdk";
|
3796
|
+
import { CrossIcon as CrossIcon5, ShareScreenIcon as ShareScreenIcon2 } from "@100mslive/react-icons";
|
4098
3797
|
var ScreenshareDisplay = () => {
|
4099
|
-
const hmsActions =
|
3798
|
+
const hmsActions = useHMSActions13();
|
4100
3799
|
return /* @__PURE__ */ React46.createElement(
|
4101
3800
|
Flex,
|
4102
3801
|
{
|
@@ -4121,7 +3820,7 @@ var ScreenshareDisplay = () => {
|
|
4121
3820
|
}),
|
4122
3821
|
"data-testid": "stop_screen_share_btn"
|
4123
3822
|
},
|
4124
|
-
/* @__PURE__ */ React46.createElement(
|
3823
|
+
/* @__PURE__ */ React46.createElement(CrossIcon5, { width: 18, height: 18 }),
|
4125
3824
|
"\xA0 Stop screen share"
|
4126
3825
|
)
|
4127
3826
|
);
|
@@ -4134,79 +3833,90 @@ var labelStyles = {
|
|
4134
3833
|
textAlign: "center",
|
4135
3834
|
c: "$on_surface_high",
|
4136
3835
|
transform: "none",
|
4137
|
-
mt: "$2",
|
4138
3836
|
flexShrink: 0
|
4139
3837
|
};
|
4140
3838
|
var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
4141
|
-
const isLocal =
|
4142
|
-
const track =
|
4143
|
-
const peer =
|
3839
|
+
const isLocal = useHMSStore21(selectLocalPeerID5) === peerId;
|
3840
|
+
const track = useHMSStore21(selectScreenShareByPeerID(peerId));
|
3841
|
+
const peer = useHMSStore21(selectPeerByID2(peerId));
|
4144
3842
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
4145
|
-
const
|
4146
|
-
const [isMouseHovered, setIsMouseHovered] = useState25(false);
|
3843
|
+
const [isMouseHovered, setIsMouseHovered] = useState24(false);
|
4147
3844
|
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
4148
3845
|
const label = getVideoTileLabel({
|
4149
3846
|
peerName: peer.name,
|
4150
3847
|
isLocal: false,
|
4151
3848
|
track
|
4152
3849
|
});
|
4153
|
-
const fullscreenRef =
|
4154
|
-
const [fullscreen, setFullscreen] =
|
3850
|
+
const fullscreenRef = useRef7(null);
|
3851
|
+
const [fullscreen, setFullscreen] = useState24(false);
|
4155
3852
|
const isFullscreen = useFullscreen2(fullscreenRef, fullscreen, {
|
4156
3853
|
onClose: () => setFullscreen(false)
|
4157
3854
|
});
|
4158
3855
|
const isFullScreenSupported = screenfull2.isEnabled;
|
4159
|
-
const audioTrack =
|
3856
|
+
const audioTrack = useHMSStore21(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
4160
3857
|
if (isLocal && !["browser", "window", "application"].includes(track == null ? void 0 : track.displaySurface)) {
|
4161
3858
|
return /* @__PURE__ */ React47.createElement(ScreenshareDisplay, null);
|
4162
3859
|
}
|
4163
3860
|
if (!peer) {
|
4164
3861
|
return null;
|
4165
3862
|
}
|
4166
|
-
return /* @__PURE__ */ React47.createElement(StyledVideoTile.Root, { css: { width, height, p: 0,
|
3863
|
+
return /* @__PURE__ */ React47.createElement(StyledVideoTile.Root, { css: { width, height, p: 0, minHeight: 0 }, "data-testid": "screenshare_tile" }, /* @__PURE__ */ React47.createElement(
|
4167
3864
|
StyledVideoTile.Container,
|
4168
3865
|
{
|
4169
3866
|
transparentBg: true,
|
4170
3867
|
ref: fullscreenRef,
|
4171
|
-
css: { flexDirection: "column" },
|
3868
|
+
css: { flexDirection: "column", gap: "$2" },
|
4172
3869
|
onMouseEnter: () => setIsMouseHovered(true),
|
4173
3870
|
onMouseLeave: () => {
|
4174
3871
|
setIsMouseHovered(false);
|
4175
3872
|
}
|
4176
3873
|
},
|
4177
3874
|
showStatsOnTiles ? /* @__PURE__ */ React47.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
4178
|
-
isFullScreenSupported &&
|
3875
|
+
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */ React47.createElement(StyledVideoTile.FullScreenButton, { onClick: () => setFullscreen(!fullscreen) }, isFullscreen ? /* @__PURE__ */ React47.createElement(ShrinkIcon, null) : /* @__PURE__ */ React47.createElement(ExpandIcon3, null)) : null,
|
4179
3876
|
track ? /* @__PURE__ */ React47.createElement(
|
4180
3877
|
Video,
|
4181
3878
|
{
|
4182
3879
|
screenShare: true,
|
4183
3880
|
mirror: peer.isLocal && (track == null ? void 0 : track.source) === "regular",
|
4184
3881
|
attach: !isAudioOnly,
|
4185
|
-
trackId: track.id
|
3882
|
+
trackId: track.id,
|
3883
|
+
css: { minHeight: 0 }
|
4186
3884
|
}
|
4187
3885
|
) : null,
|
4188
3886
|
/* @__PURE__ */ React47.createElement(StyledVideoTile.Info, { css: labelStyles }, label),
|
4189
|
-
isMouseHovered && !
|
3887
|
+
isMouseHovered && !(peer == null ? void 0 : peer.isLocal) ? /* @__PURE__ */ React47.createElement(TileMenu_default, { isScreenshare: true, peerID: peer == null ? void 0 : peer.id, audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id }) : null
|
4190
3888
|
));
|
4191
3889
|
};
|
4192
3890
|
var ScreenshareTile = React47.memo(Tile);
|
4193
3891
|
var ScreenshareTile_default = ScreenshareTile;
|
4194
3892
|
|
4195
3893
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
4196
|
-
var ScreenshareLayout = ({ peers, onPageChange, onPageSize }) => {
|
3894
|
+
var ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
4197
3895
|
var _a;
|
4198
|
-
const peersSharing =
|
3896
|
+
const peersSharing = useHMSStore22(selectPeersScreenSharing);
|
4199
3897
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
4200
|
-
const [page, setPage] =
|
4201
|
-
const
|
4202
|
-
const
|
3898
|
+
const [page, setPage] = useState25(0);
|
3899
|
+
const activeSharePeer = peersSharing[page];
|
3900
|
+
const isMobile = useMedia10(config.media.md);
|
3901
|
+
const secondaryPeers = useMemo5(
|
3902
|
+
() => isMobile ? activeSharePeer ? [activeSharePeer, ...peers.filter((p) => p.id !== (activeSharePeer == null ? void 0 : activeSharePeer.id))] : peers : peers.filter((p) => p.id !== (activeSharePeer == null ? void 0 : activeSharePeer.id)),
|
3903
|
+
[activeSharePeer, peers, isMobile]
|
3904
|
+
);
|
4203
3905
|
useEffect13(() => {
|
4204
|
-
setActiveScreenSharePeer(
|
3906
|
+
setActiveScreenSharePeer(isMobile ? "" : activeSharePeer == null ? void 0 : activeSharePeer.id);
|
4205
3907
|
return () => {
|
4206
3908
|
setActiveScreenSharePeer("");
|
4207
3909
|
};
|
4208
|
-
}, [
|
4209
|
-
return /* @__PURE__ */ React48.createElement(ProminenceLayout.Root,
|
3910
|
+
}, [activeSharePeer == null ? void 0 : activeSharePeer.id, isMobile, setActiveScreenSharePeer]);
|
3911
|
+
return /* @__PURE__ */ React48.createElement(ProminenceLayout.Root, { edgeToEdge }, /* @__PURE__ */ React48.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React48.createElement(ScreenshareTile_default, { peerId: (_a = peersSharing[page]) == null ? void 0 : _a.id }), !edgeToEdge && /* @__PURE__ */ React48.createElement(Pagination, { page, onPageChange: setPage, numPages: peersSharing.length })), /* @__PURE__ */ React48.createElement(
|
3912
|
+
SecondaryTiles,
|
3913
|
+
{
|
3914
|
+
peers: secondaryPeers,
|
3915
|
+
onPageChange,
|
3916
|
+
onPageSize,
|
3917
|
+
edgeToEdge
|
3918
|
+
}
|
3919
|
+
));
|
4210
3920
|
};
|
4211
3921
|
|
4212
3922
|
// src/Prebuilt/common/PeersSorter.ts
|
@@ -4255,7 +3965,7 @@ var PeersSorter = class {
|
|
4255
3965
|
}
|
4256
3966
|
this.lruPeers.delete(speaker.id);
|
4257
3967
|
const lruPeerArray = Array.from(this.lruPeers);
|
4258
|
-
while (lruPeerArray.length >= this.tilesPerPage) {
|
3968
|
+
while (lruPeerArray.length >= this.tilesPerPage && lruPeerArray.length) {
|
4259
3969
|
lruPeerArray.pop();
|
4260
3970
|
}
|
4261
3971
|
this.lruPeers = /* @__PURE__ */ new Set([speaker.id, ...lruPeerArray]);
|
@@ -4299,22 +4009,33 @@ var GridLayout = ({
|
|
4299
4009
|
hide_participant_name_on_tile = false,
|
4300
4010
|
rounded_video_tile = true,
|
4301
4011
|
hide_audio_mute_on_tile = false,
|
4302
|
-
video_object_fit = "contain"
|
4012
|
+
video_object_fit = "contain",
|
4013
|
+
edge_to_edge = false,
|
4014
|
+
hide_metadata_on_tile = false
|
4303
4015
|
}) => {
|
4304
|
-
const peerSharing =
|
4016
|
+
const peerSharing = useHMSStore23(selectPeerScreenSharing);
|
4305
4017
|
const pinnedTrack = usePinnedTrack();
|
4306
|
-
const
|
4307
|
-
const
|
4018
|
+
const peers = useHMSStore23(selectPeers2);
|
4019
|
+
const isRoleProminence = prominentRoles.length && peers.some(
|
4020
|
+
(peer) => peer.roleName && prominentRoles.includes(peer.roleName) && (peer.videoTrack || peer.audioTrack)
|
4021
|
+
) || pinnedTrack;
|
4022
|
+
const updatedPeers = useMemo6(() => {
|
4023
|
+
if (isInsetEnabled && !isRoleProminence && !peerSharing) {
|
4024
|
+
return peers.filter((peer) => !peer.isLocal);
|
4025
|
+
}
|
4026
|
+
return peers;
|
4027
|
+
}, [isInsetEnabled, isRoleProminence, peerSharing, peers]);
|
4308
4028
|
const vanillaStore = useHMSVanillaStore4();
|
4309
|
-
const [sortedPeers, setSortedPeers] =
|
4029
|
+
const [sortedPeers, setSortedPeers] = useState26(updatedPeers);
|
4310
4030
|
const peersSorter = useMemo6(() => new PeersSorter_default(vanillaStore), [vanillaStore]);
|
4311
|
-
const [pageSize, setPageSize] =
|
4312
|
-
const [mainPage, setMainPage] =
|
4031
|
+
const [pageSize, setPageSize] = useState26(0);
|
4032
|
+
const [mainPage, setMainPage] = useState26(0);
|
4313
4033
|
const tileLayout = {
|
4314
4034
|
enableSpotlightingPeer: enable_spotlighting_peer,
|
4315
4035
|
hideParticipantNameOnTile: hide_participant_name_on_tile,
|
4316
4036
|
roundedVideoTile: rounded_video_tile,
|
4317
4037
|
hideAudioMuteOnTile: hide_audio_mute_on_tile,
|
4038
|
+
hideMetadataOnTile: hide_metadata_on_tile,
|
4318
4039
|
objectFit: video_object_fit
|
4319
4040
|
};
|
4320
4041
|
useEffect14(() => {
|
@@ -4322,13 +4043,21 @@ var GridLayout = ({
|
|
4322
4043
|
return;
|
4323
4044
|
}
|
4324
4045
|
peersSorter.setPeersAndTilesPerPage({
|
4325
|
-
peers,
|
4046
|
+
peers: updatedPeers,
|
4326
4047
|
tilesPerPage: pageSize
|
4327
4048
|
});
|
4328
4049
|
peersSorter.onUpdate(setSortedPeers);
|
4329
|
-
}, [mainPage, peersSorter,
|
4050
|
+
}, [mainPage, peersSorter, updatedPeers, pageSize]);
|
4330
4051
|
if (peerSharing) {
|
4331
|
-
return /* @__PURE__ */ React49.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React49.createElement(
|
4052
|
+
return /* @__PURE__ */ React49.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React49.createElement(
|
4053
|
+
ScreenshareLayout,
|
4054
|
+
{
|
4055
|
+
peers: sortedPeers,
|
4056
|
+
onPageSize: setPageSize,
|
4057
|
+
onPageChange: setMainPage,
|
4058
|
+
edgeToEdge: edge_to_edge
|
4059
|
+
}
|
4060
|
+
));
|
4332
4061
|
} else if (isRoleProminence) {
|
4333
4062
|
return /* @__PURE__ */ React49.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React49.createElement(
|
4334
4063
|
RoleProminence,
|
@@ -4337,7 +4066,8 @@ var GridLayout = ({
|
|
4337
4066
|
onPageSize: setPageSize,
|
4338
4067
|
onPageChange: setMainPage,
|
4339
4068
|
prominentRoles,
|
4340
|
-
isInsetEnabled
|
4069
|
+
isInsetEnabled,
|
4070
|
+
edgeToEdge: edge_to_edge
|
4341
4071
|
}
|
4342
4072
|
));
|
4343
4073
|
}
|
@@ -4347,42 +4077,32 @@ var GridLayout = ({
|
|
4347
4077
|
peers: sortedPeers,
|
4348
4078
|
onPageSize: setPageSize,
|
4349
4079
|
onPageChange: setMainPage,
|
4350
|
-
isInsetEnabled
|
4080
|
+
isInsetEnabled,
|
4081
|
+
edgeToEdge: edge_to_edge
|
4351
4082
|
}
|
4352
4083
|
));
|
4353
4084
|
};
|
4354
4085
|
|
4355
4086
|
// src/Prebuilt/layouts/EmbedView.jsx
|
4356
|
-
import React50, { useCallback as
|
4087
|
+
import React50, { useCallback as useCallback8, useEffect as useEffect15, useMemo as useMemo7, useRef as useRef8, useState as useState27 } from "react";
|
4357
4088
|
import {
|
4358
|
-
|
4359
|
-
selectLocalPeerRoleName,
|
4360
|
-
selectPeers as selectPeers4,
|
4089
|
+
selectPeers as selectPeers3,
|
4361
4090
|
selectPeerScreenSharing as selectPeerScreenSharing2,
|
4362
4091
|
throwErrorHandler,
|
4363
|
-
useHMSStore as
|
4092
|
+
useHMSStore as useHMSStore24,
|
4364
4093
|
useScreenShare as useScreenShare3
|
4365
4094
|
} from "@100mslive/react-sdk";
|
4366
4095
|
var EmbedView = () => {
|
4367
4096
|
return /* @__PURE__ */ React50.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React50.createElement(EmbedComponent, null));
|
4368
4097
|
};
|
4369
4098
|
var EmbebScreenShareView = ({ children }) => {
|
4370
|
-
|
4371
|
-
const
|
4372
|
-
const localPeerID = useHMSStore25(selectLocalPeerID6);
|
4373
|
-
const localPeerRole = useHMSStore25(selectLocalPeerRoleName);
|
4374
|
-
const peerPresenting = useHMSStore25(selectPeerScreenSharing2);
|
4375
|
-
const isPresenterFromMyRole = ((_a = peerPresenting == null ? void 0 : peerPresenting.roleName) == null ? void 0 : _a.toLowerCase()) === (localPeerRole == null ? void 0 : localPeerRole.toLowerCase());
|
4376
|
-
const amIPresenting = localPeerID === (peerPresenting == null ? void 0 : peerPresenting.id);
|
4377
|
-
const showPresenterInSmallTile = amIPresenting || isPresenterFromMyRole;
|
4099
|
+
const peers = useHMSStore24(selectPeers3);
|
4100
|
+
const peerPresenting = useHMSStore24(selectPeerScreenSharing2);
|
4378
4101
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
4379
4102
|
const smallTilePeers = useMemo7(() => {
|
4380
4103
|
const smallTilePeers2 = peers.filter((peer) => peer.id !== (peerPresenting == null ? void 0 : peerPresenting.id));
|
4381
|
-
if (showPresenterInSmallTile && peerPresenting) {
|
4382
|
-
smallTilePeers2.unshift(peerPresenting);
|
4383
|
-
}
|
4384
4104
|
return smallTilePeers2;
|
4385
|
-
}, [peers, peerPresenting
|
4105
|
+
}, [peers, peerPresenting]);
|
4386
4106
|
useEffect15(() => {
|
4387
4107
|
setActiveScreenSharePeer(peerPresenting == null ? void 0 : peerPresenting.id);
|
4388
4108
|
return () => {
|
@@ -4394,11 +4114,11 @@ var EmbebScreenShareView = ({ children }) => {
|
|
4394
4114
|
var EmbedComponent = () => {
|
4395
4115
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare3(throwErrorHandler);
|
4396
4116
|
const [embedConfig, setEmbedConfig] = useSetAppDataByKey(APP_DATA.embedConfig);
|
4397
|
-
const [wasScreenShared, setWasScreenShared] =
|
4398
|
-
const screenShareAttemptInProgress =
|
4117
|
+
const [wasScreenShared, setWasScreenShared] = useState27(false);
|
4118
|
+
const screenShareAttemptInProgress = useRef8(false);
|
4399
4119
|
const src = embedConfig.url;
|
4400
|
-
const iframeRef =
|
4401
|
-
const resetEmbedConfig =
|
4120
|
+
const iframeRef = useRef8();
|
4121
|
+
const resetEmbedConfig = useCallback8(() => {
|
4402
4122
|
if (src) {
|
4403
4123
|
setEmbedConfig({ url: "" });
|
4404
4124
|
}
|
@@ -4440,25 +4160,25 @@ var EmbedComponent = () => {
|
|
4440
4160
|
};
|
4441
4161
|
|
4442
4162
|
// src/Prebuilt/layouts/PDFView.jsx
|
4443
|
-
import React51, { useCallback as
|
4163
|
+
import React51, { useCallback as useCallback9, useEffect as useEffect16, useRef as useRef9, useState as useState28 } from "react";
|
4444
4164
|
import { throwErrorHandler as throwErrorHandler2, useScreenShare as useScreenShare4 } from "@100mslive/react-sdk";
|
4445
4165
|
var PDFView = () => {
|
4446
4166
|
return /* @__PURE__ */ React51.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React51.createElement(PDFEmbedComponent, null));
|
4447
4167
|
};
|
4448
4168
|
var PDFEmbedComponent = () => {
|
4449
|
-
const ref =
|
4169
|
+
const ref = useRef9();
|
4450
4170
|
const themeType = useTheme().themeType;
|
4451
|
-
const [isPDFLoaded, setIsPDFLoaded] =
|
4171
|
+
const [isPDFLoaded, setIsPDFLoaded] = useState28(false);
|
4452
4172
|
let pdfJSURL = define_process_env_default.REACT_APP_PDFJS_IFRAME_URL;
|
4453
4173
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare4(throwErrorHandler2);
|
4454
4174
|
const [pdfConfig, setPDFConfig] = useSetAppDataByKey(APP_DATA.pdfConfig);
|
4455
4175
|
if (pdfConfig.url && !pdfConfig.file) {
|
4456
4176
|
pdfJSURL = pdfJSURL + "?file=" + encodeURIComponent(pdfConfig.url);
|
4457
4177
|
}
|
4458
|
-
const [wasScreenShared, setWasScreenShared] =
|
4459
|
-
const screenShareAttemptInProgress =
|
4460
|
-
const iframeRef =
|
4461
|
-
const resetEmbedConfig =
|
4178
|
+
const [wasScreenShared, setWasScreenShared] = useState28(false);
|
4179
|
+
const screenShareAttemptInProgress = useRef9(false);
|
4180
|
+
const iframeRef = useRef9();
|
4181
|
+
const resetEmbedConfig = useCallback9(() => {
|
4462
4182
|
setPDFConfig({ state: false });
|
4463
4183
|
}, [setPDFConfig]);
|
4464
4184
|
useEffect16(() => {
|
@@ -4529,61 +4249,66 @@ var PDFEmbedComponent = () => {
|
|
4529
4249
|
};
|
4530
4250
|
|
4531
4251
|
// src/Prebuilt/layouts/SidePane.tsx
|
4532
|
-
import
|
4533
|
-
import { useMedia as
|
4252
|
+
import React58 from "react";
|
4253
|
+
import { useMedia as useMedia14 } from "react-use";
|
4534
4254
|
import { selectAppData as selectAppData3, selectVideoTrackByPeerID, useHMSStore as useHMSStore33 } from "@100mslive/react-sdk";
|
4535
4255
|
|
4256
|
+
// src/Prebuilt/components/SidePaneTabs.tsx
|
4257
|
+
import React55, { useEffect as useEffect21, useState as useState32 } from "react";
|
4258
|
+
import { selectPeerCount as selectPeerCount3, useHMSStore as useHMSStore30 } from "@100mslive/react-sdk";
|
4259
|
+
import { CrossIcon as CrossIcon7 } from "@100mslive/react-icons";
|
4260
|
+
|
4536
4261
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4537
|
-
import React54, { useCallback as
|
4538
|
-
import { useMedia as
|
4262
|
+
import React54, { useCallback as useCallback14, useEffect as useEffect20, useRef as useRef13, useState as useState31 } from "react";
|
4263
|
+
import { useMedia as useMedia13 } from "react-use";
|
4539
4264
|
import {
|
4540
4265
|
HMSNotificationTypes,
|
4541
4266
|
selectHMSMessagesCount,
|
4542
4267
|
selectPeerNameByID as selectPeerNameByID3,
|
4543
|
-
selectPermissions as
|
4268
|
+
selectPermissions as selectPermissions10,
|
4544
4269
|
selectSessionStore,
|
4545
|
-
useHMSActions as
|
4270
|
+
useHMSActions as useHMSActions18,
|
4546
4271
|
useHMSNotifications,
|
4547
|
-
useHMSStore as
|
4272
|
+
useHMSStore as useHMSStore29
|
4548
4273
|
} from "@100mslive/react-sdk";
|
4549
|
-
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as
|
4274
|
+
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as CrossIcon6, PinIcon as PinIcon2 } from "@100mslive/react-icons";
|
4550
4275
|
|
4551
4276
|
// src/Prebuilt/components/Chat/ChatBody.jsx
|
4552
|
-
import React52, { Fragment as Fragment8, useCallback as
|
4277
|
+
import React52, { Fragment as Fragment8, useCallback as useCallback11, useEffect as useEffect17, useLayoutEffect, useMemo as useMemo8, useRef as useRef10, useState as useState29 } from "react";
|
4553
4278
|
import { useInView } from "react-intersection-observer";
|
4554
|
-
import { useMedia as
|
4279
|
+
import { useMedia as useMedia11 } from "react-use";
|
4555
4280
|
import AutoSizer from "react-virtualized-auto-sizer";
|
4556
4281
|
import { VariableSizeList } from "react-window";
|
4557
4282
|
import {
|
4558
4283
|
selectHMSMessages,
|
4559
|
-
selectLocalPeerID as
|
4560
|
-
selectLocalPeerRoleName
|
4284
|
+
selectLocalPeerID as selectLocalPeerID6,
|
4285
|
+
selectLocalPeerRoleName,
|
4561
4286
|
selectMessagesByPeerID,
|
4562
4287
|
selectMessagesByRole,
|
4563
4288
|
selectPeerNameByID as selectPeerNameByID2,
|
4564
|
-
selectPermissions as
|
4565
|
-
useHMSActions as
|
4566
|
-
useHMSStore as
|
4289
|
+
selectPermissions as selectPermissions9,
|
4290
|
+
useHMSActions as useHMSActions15,
|
4291
|
+
useHMSStore as useHMSStore26
|
4567
4292
|
} from "@100mslive/react-sdk";
|
4568
|
-
import {
|
4293
|
+
import { PinIcon, VerticalMenuIcon as VerticalMenuIcon5 } from "@100mslive/react-icons";
|
4569
4294
|
|
4570
4295
|
// src/Prebuilt/images/empty-chat.svg
|
4571
4296
|
var empty_chat_default = 'data:image/svg+xml,<svg width="184" height="133" viewBox="0 0 184 133" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path fill-rule="evenodd" clip-rule="evenodd" d="M144.885 91.3998C145.318 91.023 145.861 90.7947 146.433 90.7483L146.446 90.7473L169.355 89.1614C169.702 89.1376 170.049 89.2101 170.358 89.3712C170.662 89.5305 170.918 89.7702 171.096 90.0642C171.098 90.0672 171.1 90.0703 171.102 90.0734L171.104 90.0766C171.281 90.3744 171.373 90.7154 171.369 91.062C171.365 91.4097 171.265 91.7496 171.08 92.044L158.85 111.504C158.539 111.986 158.081 112.356 157.544 112.56C157.007 112.764 156.419 112.791 155.866 112.636C155.313 112.482 154.823 112.155 154.469 111.703C154.115 111.25 153.915 110.697 153.898 110.123C153.898 110.109 153.898 110.094 153.898 110.08L153.996 100.307L145.347 95.7858C145.334 95.779 145.321 95.7721 145.308 95.7649C144.811 95.4785 144.417 95.0404 144.186 94.5146C143.955 93.9888 143.898 93.4029 144.024 92.8425C144.15 92.2821 144.451 91.7765 144.885 91.3998ZM167.441 91.0088L146.603 92.8952C146.49 92.9053 146.383 92.9508 146.298 93.0251C146.211 93.1005 146.151 93.2016 146.125 93.3137C146.1 93.4257 146.112 93.5429 146.158 93.6481C146.202 93.7484 146.276 93.8327 146.369 93.89L155.26 98.296L167.441 91.0088ZM156.32 100.171L168.547 92.8564L157.039 110.339C156.976 110.434 156.886 110.506 156.78 110.547C156.673 110.587 156.555 110.593 156.444 110.562C156.334 110.531 156.236 110.466 156.165 110.375C156.097 110.289 156.058 110.184 156.052 110.075L156.32 100.171Z" fill="%23444954"/>%0A<path d="M83.3248 35.4156C71.7182 47.1017 51.2098 75.5175 62.0292 95.6918C75.5536 120.91 140.453 79.2983 115.364 67.6657C90.2756 56.0331 65.8818 122.018 101.568 120.391C116.398 118.62 131.221 114.699 145.703 105.512" stroke="%23293042" stroke-width="2.25" stroke-dasharray="6 6"/>%0A<rect x="0.00256348" y="0.5" width="173.524" height="58.3398" rx="29.1699" fill="%23272A31"/>%0A<g opacity="0.4">%0A<rect x="24.7526" y="20.9312" width="111" height="4.5" rx="2.25" fill="%23444954"/>%0A</g>%0A<g opacity="0.4">%0A<rect x="38.2526" y="34.4312" width="110.25" height="4.5" rx="2.25" fill="%23444954"/>%0A</g>%0A<path d="M40.3918 71.5547L28.4246 55.0999L52.3589 55.0999L40.3918 71.5547Z" fill="%23272A31"/>%0A</svg>%0A';
|
4572
4297
|
|
4573
4298
|
// src/Prebuilt/components/hooks/useSetPinnedMessage.js
|
4574
|
-
import { useCallback as
|
4299
|
+
import { useCallback as useCallback10 } from "react";
|
4575
4300
|
import {
|
4576
4301
|
selectPeerNameByID,
|
4577
4302
|
selectSessionMetadata,
|
4578
|
-
useHMSActions as
|
4579
|
-
useHMSStore as
|
4303
|
+
useHMSActions as useHMSActions14,
|
4304
|
+
useHMSStore as useHMSStore25,
|
4580
4305
|
useHMSVanillaStore as useHMSVanillaStore5
|
4581
4306
|
} from "@100mslive/react-sdk";
|
4582
4307
|
var useSetPinnedMessage = () => {
|
4583
|
-
const hmsActions =
|
4308
|
+
const hmsActions = useHMSActions14();
|
4584
4309
|
const vanillaStore = useHMSVanillaStore5();
|
4585
|
-
const pinnedMessage =
|
4586
|
-
const setPinnedMessage =
|
4310
|
+
const pinnedMessage = useHMSStore25(selectSessionMetadata);
|
4311
|
+
const setPinnedMessage = useCallback10(
|
4587
4312
|
/**
|
4588
4313
|
* @param {import("@100mslive/react-sdk").HMSMessage | undefined} message
|
4589
4314
|
*/
|
@@ -4634,8 +4359,8 @@ var MessageTypeContainer = ({ left, right }) => {
|
|
4634
4359
|
);
|
4635
4360
|
};
|
4636
4361
|
var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
4637
|
-
const peerName =
|
4638
|
-
const localPeerRoleName =
|
4362
|
+
const peerName = useHMSStore26(selectPeerNameByID2(receiver));
|
4363
|
+
const localPeerRoleName = useHMSStore26(selectLocalPeerRoleName);
|
4639
4364
|
if (receiver) {
|
4640
4365
|
return /* @__PURE__ */ React52.createElement(
|
4641
4366
|
MessageTypeContainer,
|
@@ -4672,42 +4397,19 @@ var getMessageType = ({ roles, receiver }) => {
|
|
4672
4397
|
}
|
4673
4398
|
return receiver ? "private" : "";
|
4674
4399
|
};
|
4675
|
-
var ChatActions = ({ onPin, showPinAction
|
4676
|
-
const [open, setOpen] =
|
4677
|
-
|
4678
|
-
if (!isMobile && !showPinAction) {
|
4400
|
+
var ChatActions = ({ onPin, showPinAction }) => {
|
4401
|
+
const [open, setOpen] = useState29(false);
|
4402
|
+
if (!showPinAction) {
|
4679
4403
|
return null;
|
4680
4404
|
}
|
4681
|
-
return /* @__PURE__ */ React52.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(Dropdown.Trigger, { className: "chat_actions", css: { opacity: open ? 1 : 0, "@md": { opacity: 1 } }, asChild: true }, /* @__PURE__ */ React52.createElement(IconButton, null, /* @__PURE__ */ React52.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React52.createElement(
|
4405
|
+
return /* @__PURE__ */ React52.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(Dropdown.Trigger, { className: "chat_actions", css: { opacity: open ? 1 : 0, "@md": { opacity: 1 } }, asChild: true }, /* @__PURE__ */ React52.createElement(IconButton, null, /* @__PURE__ */ React52.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React52.createElement(VerticalMenuIcon5, null)))), /* @__PURE__ */ React52.createElement(Dropdown.Portal, null, /* @__PURE__ */ React52.createElement(
|
4682
4406
|
Dropdown.Content,
|
4683
4407
|
{
|
4684
4408
|
sideOffset: 5,
|
4685
4409
|
align: "end",
|
4686
4410
|
css: { width: "$48", backgroundColor: "$surface_bright", py: "$0", border: "1px solid $border_bright" }
|
4687
4411
|
},
|
4688
|
-
/* @__PURE__ */ React52.createElement(Dropdown.Item, { "data-testid": "pin_message_btn", onClick: onPin }, /* @__PURE__ */ React52.createElement(PinIcon, null), /* @__PURE__ */ React52.createElement(Text, { variant: "sm", css: { ml: "$4" } }, "Pin Message"))
|
4689
|
-
isMobile && showPinAction ? /* @__PURE__ */ React52.createElement(Dropdown.ItemSeparator, { css: { my: 0 } }) : null,
|
4690
|
-
isMobile ? /* @__PURE__ */ React52.createElement(
|
4691
|
-
Dropdown.Item,
|
4692
|
-
{
|
4693
|
-
"data-testid": "copy_message_btn",
|
4694
|
-
onClick: () => {
|
4695
|
-
try {
|
4696
|
-
navigator == null ? void 0 : navigator.clipboard.writeText(messageContent);
|
4697
|
-
ToastManager.addToast({
|
4698
|
-
title: "Message copied successfully"
|
4699
|
-
});
|
4700
|
-
} catch (e) {
|
4701
|
-
console.log(e);
|
4702
|
-
ToastManager.addToast({
|
4703
|
-
title: "Could not copy message"
|
4704
|
-
});
|
4705
|
-
}
|
4706
|
-
}
|
4707
|
-
},
|
4708
|
-
/* @__PURE__ */ React52.createElement(CopyIcon, null),
|
4709
|
-
/* @__PURE__ */ React52.createElement(Text, { variant: "sm", css: { ml: "$4" } }, "Copy Message")
|
4710
|
-
) : null
|
4412
|
+
/* @__PURE__ */ React52.createElement(Dropdown.Item, { "data-testid": "pin_message_btn", onClick: onPin }, /* @__PURE__ */ React52.createElement(PinIcon, null), /* @__PURE__ */ React52.createElement(Text, { variant: "sm", css: { ml: "$4" } }, "Pin Message"))
|
4711
4413
|
)));
|
4712
4414
|
};
|
4713
4415
|
var SenderName = styled(Text, {
|
@@ -4720,22 +4422,25 @@ var SenderName = styled(Text, {
|
|
4720
4422
|
fontWeight: "$semiBold"
|
4721
4423
|
});
|
4722
4424
|
var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPin }) => {
|
4425
|
+
var _a, _b;
|
4723
4426
|
const { ref, inView } = useInView({ threshold: 0.5, triggerOnce: true });
|
4724
|
-
const rowRef =
|
4427
|
+
const rowRef = useRef10(null);
|
4725
4428
|
useEffect17(() => {
|
4726
4429
|
if (rowRef.current) {
|
4727
4430
|
setRowHeight(index, rowRef.current.clientHeight);
|
4728
4431
|
}
|
4729
4432
|
}, [index, setRowHeight]);
|
4730
|
-
const isMobile =
|
4731
|
-
const
|
4732
|
-
const
|
4733
|
-
const
|
4433
|
+
const isMobile = useMedia11(config.media.md);
|
4434
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4435
|
+
const isOverlay = ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
4436
|
+
const hmsActions = useHMSActions15();
|
4437
|
+
const localPeerId = useHMSStore26(selectLocalPeerID6);
|
4438
|
+
const permissions = useHMSStore26(selectPermissions9);
|
4734
4439
|
const messageType = getMessageType({
|
4735
4440
|
roles: message.recipientRoles,
|
4736
4441
|
receiver: message.recipientPeer
|
4737
4442
|
});
|
4738
|
-
const showPinAction = permissions.removeOthers && !messageType;
|
4443
|
+
const showPinAction = permissions.removeOthers && !messageType && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.allow_pinning_messages);
|
4739
4444
|
useEffect17(() => {
|
4740
4445
|
if (message.id && !message.read && inView) {
|
4741
4446
|
hmsActions.setMessageRead(true, message.id);
|
@@ -4757,7 +4462,7 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4757
4462
|
css: {
|
4758
4463
|
flexWrap: "wrap",
|
4759
4464
|
// Theme independent color, token should not be used for transparent chat
|
4760
|
-
bg: messageType ?
|
4465
|
+
bg: messageType ? isOverlay ? "rgba(0, 0, 0, 0.64)" : "$surface_default" : void 0,
|
4761
4466
|
r: messageType ? "$1" : void 0,
|
4762
4467
|
px: messageType ? "$4" : "$2",
|
4763
4468
|
py: messageType ? "$4" : 0,
|
@@ -4770,7 +4475,7 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4770
4475
|
Text,
|
4771
4476
|
{
|
4772
4477
|
css: {
|
4773
|
-
color: "$on_surface_high",
|
4478
|
+
color: isOverlay ? "#FFF" : "$on_surface_high",
|
4774
4479
|
fontWeight: "$semiBold",
|
4775
4480
|
display: "inline-flex",
|
4776
4481
|
alignItems: "center",
|
@@ -4779,14 +4484,14 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4779
4484
|
},
|
4780
4485
|
as: "div"
|
4781
4486
|
},
|
4782
|
-
/* @__PURE__ */ React52.createElement(Flex, { align: "baseline" }, message.senderName === "You" || !message.senderName ? /* @__PURE__ */ React52.createElement(SenderName, { as: "span", variant: "sm" }, message.senderName || "Anonymous") : /* @__PURE__ */ React52.createElement(Tooltip, { title: message.senderName, side: "top", align: "start" }, /* @__PURE__ */ React52.createElement(SenderName, { as: "span", variant: "sm" }, message.senderName)), !
|
4487
|
+
/* @__PURE__ */ React52.createElement(Flex, { align: "baseline" }, message.senderName === "You" || !message.senderName ? /* @__PURE__ */ React52.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName || "Anonymous") : /* @__PURE__ */ React52.createElement(Tooltip, { title: message.senderName, side: "top", align: "start" }, /* @__PURE__ */ React52.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName)), !isOverlay ? /* @__PURE__ */ React52.createElement(
|
4783
4488
|
Text,
|
4784
4489
|
{
|
4785
4490
|
as: "span",
|
4786
4491
|
variant: "xs",
|
4787
4492
|
css: {
|
4788
4493
|
ml: "$4",
|
4789
|
-
color: "$
|
4494
|
+
color: "$on_surface_medium",
|
4790
4495
|
flexShrink: 0
|
4791
4496
|
}
|
4792
4497
|
},
|
@@ -4800,18 +4505,19 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4800
4505
|
roles: message.recipientRoles
|
4801
4506
|
}
|
4802
4507
|
),
|
4803
|
-
!
|
4508
|
+
!isOverlay ? /* @__PURE__ */ React52.createElement(ChatActions, { onPin, showPinAction }) : null
|
4804
4509
|
),
|
4805
4510
|
/* @__PURE__ */ React52.createElement(
|
4806
4511
|
Text,
|
4807
4512
|
{
|
4808
|
-
variant: "
|
4513
|
+
variant: "sm",
|
4809
4514
|
css: {
|
4810
4515
|
w: "100%",
|
4811
4516
|
mt: "$2",
|
4812
4517
|
wordBreak: "break-word",
|
4813
4518
|
whiteSpace: "pre-wrap",
|
4814
|
-
userSelect: "all"
|
4519
|
+
userSelect: "all",
|
4520
|
+
color: isOverlay ? "#FFF" : "$on_surface_high"
|
4815
4521
|
},
|
4816
4522
|
onClick: (e) => e.stopPropagation()
|
4817
4523
|
},
|
@@ -4855,11 +4561,11 @@ var ChatList = React52.forwardRef(
|
|
4855
4561
|
}
|
4856
4562
|
);
|
4857
4563
|
var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom }, listRef) => {
|
4858
|
-
const rowHeights =
|
4564
|
+
const rowHeights = useRef10({});
|
4859
4565
|
function getRowHeight(index) {
|
4860
4566
|
return rowHeights.current[index] + 16 || 72;
|
4861
4567
|
}
|
4862
|
-
const setRowHeight =
|
4568
|
+
const setRowHeight = useCallback11(
|
4863
4569
|
(index, size) => {
|
4864
4570
|
listRef.current.resetAfterIndex(0);
|
4865
4571
|
rowHeights.current = __spreadProps(__spreadValues({}, rowHeights.current), { [index]: size });
|
@@ -4898,11 +4604,13 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4898
4604
|
);
|
4899
4605
|
});
|
4900
4606
|
var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) => {
|
4607
|
+
var _a;
|
4901
4608
|
const storeMessageSelector = role ? selectMessagesByRole(role) : peerId ? selectMessagesByPeerID(peerId) : selectHMSMessages;
|
4902
|
-
let messages =
|
4609
|
+
let messages = useHMSStore26(storeMessageSelector);
|
4903
4610
|
messages = useMemo8(() => (messages == null ? void 0 : messages.filter((message) => message.type === "chat")) || [], [messages]);
|
4904
|
-
const isMobile =
|
4905
|
-
|
4611
|
+
const isMobile = useMedia11(config.media.md);
|
4612
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4613
|
+
if (messages.length === 0 && !(isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay))) {
|
4906
4614
|
return /* @__PURE__ */ React52.createElement(
|
4907
4615
|
Flex,
|
4908
4616
|
{
|
@@ -4928,24 +4636,24 @@ var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4928
4636
|
return /* @__PURE__ */ React52.createElement(Fragment8, null, /* @__PURE__ */ React52.createElement(VirtualizedChatMessages, { messages, scrollToBottom, ref: listRef }));
|
4929
4637
|
});
|
4930
4638
|
|
4931
|
-
// src/Prebuilt/components/Chat/ChatFooter.
|
4932
|
-
import React53, { useCallback as
|
4933
|
-
import { useMedia as
|
4639
|
+
// src/Prebuilt/components/Chat/ChatFooter.tsx
|
4640
|
+
import React53, { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef12, useState as useState30 } from "react";
|
4641
|
+
import { useMedia as useMedia12 } from "react-use";
|
4934
4642
|
import data2 from "@emoji-mart/data";
|
4935
4643
|
import Picker from "@emoji-mart/react";
|
4936
|
-
import { useHMSActions as
|
4644
|
+
import { useHMSActions as useHMSActions17 } from "@100mslive/react-sdk";
|
4937
4645
|
import { EmojiIcon as EmojiIcon3, SendIcon } from "@100mslive/react-icons";
|
4938
4646
|
|
4939
4647
|
// src/Prebuilt/components/AppData/useChatState.js
|
4940
|
-
import { useCallback as
|
4941
|
-
import { selectAppData as selectAppData2, useHMSActions as
|
4648
|
+
import { useCallback as useCallback12 } from "react";
|
4649
|
+
import { selectAppData as selectAppData2, useHMSActions as useHMSActions16, useHMSStore as useHMSStore27 } from "@100mslive/react-sdk";
|
4942
4650
|
var useChatDraftMessage = () => {
|
4943
|
-
const hmsActions =
|
4944
|
-
let chatDraftMessage =
|
4651
|
+
const hmsActions = useHMSActions16();
|
4652
|
+
let chatDraftMessage = useHMSStore27(selectAppData2(APP_DATA.chatDraft));
|
4945
4653
|
if (chatDraftMessage === void 0 || chatDraftMessage === null) {
|
4946
4654
|
chatDraftMessage = "";
|
4947
4655
|
}
|
4948
|
-
const setDraftMessage =
|
4656
|
+
const setDraftMessage = useCallback12(
|
4949
4657
|
(message) => {
|
4950
4658
|
hmsActions.setAppData(APP_DATA.chatDraft, message, true);
|
4951
4659
|
},
|
@@ -4955,9 +4663,9 @@ var useChatDraftMessage = () => {
|
|
4955
4663
|
};
|
4956
4664
|
|
4957
4665
|
// src/Prebuilt/components/Chat/useEmojiPickerStyles.js
|
4958
|
-
import { useEffect as useEffect18, useRef as
|
4666
|
+
import { useEffect as useEffect18, useRef as useRef11 } from "react";
|
4959
4667
|
var useEmojiPickerStyles = (showing) => {
|
4960
|
-
const ref =
|
4668
|
+
const ref = useRef11(null);
|
4961
4669
|
useEffect18(() => {
|
4962
4670
|
if (showing) {
|
4963
4671
|
setTimeout(() => {
|
@@ -4966,16 +4674,17 @@ var useEmojiPickerStyles = (showing) => {
|
|
4966
4674
|
const style = document.createElement("style");
|
4967
4675
|
style.textContent = `
|
4968
4676
|
#root {
|
4969
|
-
--em-rgb-color: var(--hms-ui-colors-
|
4677
|
+
--em-rgb-color: var(--hms-ui-colors-on_surface_high);
|
4970
4678
|
--em-rgb-input: var(--hms-ui-colors-on_primary_high);
|
4971
|
-
--em-color-border: var(--hms-ui-colors-
|
4972
|
-
--color-b: var(--hms-ui-colors-
|
4679
|
+
--em-color-border: var(--hms-ui-colors-surface_bright);
|
4680
|
+
--color-b: var(--hms-ui-colors-on_surface_high);
|
4973
4681
|
--rgb-background: transparent;
|
4974
|
-
color: var(--hms-ui-colors-
|
4682
|
+
color: var(--hms-ui-colors-on_surface_high);
|
4975
4683
|
font-family: var(--hms-ui-fonts-sans);
|
4976
4684
|
}
|
4977
4685
|
.sticky {
|
4978
4686
|
background-color: var(--hms-ui-colors-surface_bright);
|
4687
|
+
margin-top: 0.5rem;
|
4979
4688
|
}
|
4980
4689
|
`;
|
4981
4690
|
root == null ? void 0 : root.appendChild(style);
|
@@ -4985,7 +4694,7 @@ var useEmojiPickerStyles = (showing) => {
|
|
4985
4694
|
return ref;
|
4986
4695
|
};
|
4987
4696
|
|
4988
|
-
// src/Prebuilt/components/Chat/ChatFooter.
|
4697
|
+
// src/Prebuilt/components/Chat/ChatFooter.tsx
|
4989
4698
|
var TextArea = styled("textarea", {
|
4990
4699
|
width: "100%",
|
4991
4700
|
bg: "transparent",
|
@@ -5004,7 +4713,7 @@ var TextArea = styled("textarea", {
|
|
5004
4713
|
}
|
5005
4714
|
});
|
5006
4715
|
function EmojiPicker({ onSelect }) {
|
5007
|
-
const [showEmoji, setShowEmoji] =
|
4716
|
+
const [showEmoji, setShowEmoji] = useState30(false);
|
5008
4717
|
const ref = useEmojiPickerStyles(showEmoji);
|
5009
4718
|
return /* @__PURE__ */ React53.createElement(Popover.Root, { open: showEmoji, onOpenChange: setShowEmoji }, /* @__PURE__ */ React53.createElement(Popover.Trigger, { asChild: true, css: { appearance: "none" } }, /* @__PURE__ */ React53.createElement(IconButton, { as: "div" }, /* @__PURE__ */ React53.createElement(EmojiIcon3, null))), /* @__PURE__ */ React53.createElement(Popover.Portal, null, /* @__PURE__ */ React53.createElement(
|
5010
4719
|
Popover.Content,
|
@@ -5034,14 +4743,17 @@ var ChatFooter = ({
|
|
5034
4743
|
peerId,
|
5035
4744
|
onSend,
|
5036
4745
|
children
|
5037
|
-
/* onSelect, selection, screenType */
|
5038
4746
|
}) => {
|
5039
|
-
|
5040
|
-
const
|
4747
|
+
var _a;
|
4748
|
+
const hmsActions = useHMSActions17();
|
4749
|
+
const inputRef = useRef12(null);
|
5041
4750
|
const [draftMessage, setDraftMessage] = useChatDraftMessage();
|
5042
|
-
const isMobile =
|
5043
|
-
const
|
5044
|
-
|
4751
|
+
const isMobile = useMedia12(config.media.md);
|
4752
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4753
|
+
const isOverlayChat = (_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay;
|
4754
|
+
const sendMessage = useCallback13(() => __async(void 0, null, function* () {
|
4755
|
+
var _a2;
|
4756
|
+
const message = (_a2 = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a2.value;
|
5045
4757
|
if (!message || !message.trim().length) {
|
5046
4758
|
return;
|
5047
4759
|
}
|
@@ -5058,7 +4770,8 @@ var ChatFooter = ({
|
|
5058
4770
|
onSend();
|
5059
4771
|
}, 0);
|
5060
4772
|
} catch (error) {
|
5061
|
-
|
4773
|
+
const err = error;
|
4774
|
+
ToastManager.addToast({ title: err.message });
|
5062
4775
|
}
|
5063
4776
|
}), [role, peerId, hmsActions, onSend]);
|
5064
4777
|
useEffect19(() => {
|
@@ -5078,7 +4791,7 @@ var ChatFooter = ({
|
|
5078
4791
|
{
|
5079
4792
|
align: "center",
|
5080
4793
|
css: {
|
5081
|
-
bg: isMobile ? "$surface_dim" : "$surface_default",
|
4794
|
+
bg: isOverlayChat && isMobile ? "$surface_dim" : "$surface_default",
|
5082
4795
|
minHeight: "$16",
|
5083
4796
|
maxHeight: "$24",
|
5084
4797
|
position: "relative",
|
@@ -5097,9 +4810,15 @@ var ChatFooter = ({
|
|
5097
4810
|
/* @__PURE__ */ React53.createElement(
|
5098
4811
|
TextArea,
|
5099
4812
|
{
|
4813
|
+
css: {
|
4814
|
+
c: "$on_surface_high",
|
4815
|
+
"&:valid ~ .send-msg": { color: "$on_surface_high" },
|
4816
|
+
"& ~ .send-msg": { color: "$on_surface_low" }
|
4817
|
+
},
|
5100
4818
|
placeholder: "Send a message....",
|
5101
4819
|
ref: inputRef,
|
5102
|
-
|
4820
|
+
required: true,
|
4821
|
+
autoFocus: !isMobile,
|
5103
4822
|
onKeyPress: (event) => __async(void 0, null, function* () {
|
5104
4823
|
if (event.key === "Enter") {
|
5105
4824
|
if (!event.shiftKey) {
|
@@ -5119,20 +4838,22 @@ var ChatFooter = ({
|
|
5119
4838
|
EmojiPicker,
|
5120
4839
|
{
|
5121
4840
|
onSelect: (emoji) => {
|
5122
|
-
inputRef.current
|
4841
|
+
if (inputRef.current) {
|
4842
|
+
inputRef.current.value += ` ${emoji.native} `;
|
4843
|
+
}
|
5123
4844
|
}
|
5124
4845
|
}
|
5125
4846
|
) : null,
|
5126
4847
|
/* @__PURE__ */ React53.createElement(
|
5127
4848
|
IconButton,
|
5128
4849
|
{
|
4850
|
+
className: "send-msg",
|
5129
4851
|
onClick: sendMessage,
|
5130
4852
|
css: {
|
5131
4853
|
ml: "auto",
|
5132
4854
|
height: "max-content",
|
5133
4855
|
mr: "$4",
|
5134
|
-
|
5135
|
-
"&:hover": { c: "$on_surface_high" }
|
4856
|
+
"&:hover": { c: isMobile ? "" : "$on_surface_medium" }
|
5136
4857
|
},
|
5137
4858
|
"data-testid": "send_msg_btn"
|
5138
4859
|
},
|
@@ -5146,19 +4867,19 @@ import {
|
|
5146
4867
|
selectMessagesUnreadCountByPeerID,
|
5147
4868
|
selectMessagesUnreadCountByRole,
|
5148
4869
|
selectUnreadHMSMessagesCount as selectUnreadHMSMessagesCount2,
|
5149
|
-
useHMSStore as
|
4870
|
+
useHMSStore as useHMSStore28
|
5150
4871
|
} from "@100mslive/react-sdk";
|
5151
4872
|
var useUnreadCount = ({ role, peerId }) => {
|
5152
4873
|
const unreadCountSelector = role ? selectMessagesUnreadCountByRole(role) : peerId ? selectMessagesUnreadCountByPeerID(peerId) : selectUnreadHMSMessagesCount2;
|
5153
|
-
const unreadCount =
|
4874
|
+
const unreadCount = useHMSStore28(unreadCountSelector);
|
5154
4875
|
return unreadCount;
|
5155
4876
|
};
|
5156
4877
|
|
5157
4878
|
// src/Prebuilt/components/Chat/Chat.jsx
|
5158
4879
|
var PINNED_MESSAGE_LENGTH = 80;
|
5159
4880
|
var PinnedMessage = ({ clearPinnedMessage }) => {
|
5160
|
-
const permissions =
|
5161
|
-
const pinnedMessage =
|
4881
|
+
const permissions = useHMSStore29(selectPermissions10);
|
4882
|
+
const pinnedMessage = useHMSStore29(selectSessionStore(SESSION_STORE_KEY.PINNED_MESSAGE));
|
5162
4883
|
const formattedPinnedMessage = (pinnedMessage == null ? void 0 : pinnedMessage.length) && pinnedMessage.length > PINNED_MESSAGE_LENGTH ? `${pinnedMessage.slice(0, PINNED_MESSAGE_LENGTH)}...` : pinnedMessage;
|
5163
4884
|
return pinnedMessage ? /* @__PURE__ */ React54.createElement(
|
5164
4885
|
Flex,
|
@@ -5187,23 +4908,24 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
5187
4908
|
onClick: () => clearPinnedMessage(),
|
5188
4909
|
css: { cursor: "pointer", color: "$on_surface_medium", "&:hover": { color: "$on_surface_high" } }
|
5189
4910
|
},
|
5190
|
-
/* @__PURE__ */ React54.createElement(
|
4911
|
+
/* @__PURE__ */ React54.createElement(CrossIcon6, null)
|
5191
4912
|
)
|
5192
4913
|
) : null;
|
5193
4914
|
};
|
5194
|
-
var Chat = ({ screenType }) => {
|
4915
|
+
var Chat = ({ screenType, hideControls = false }) => {
|
4916
|
+
var _a, _b, _c;
|
5195
4917
|
const notification = useHMSNotifications(HMSNotificationTypes.PEER_LEFT);
|
5196
4918
|
const [peerSelector, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER_ID);
|
5197
4919
|
const [roleSelector, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
5198
|
-
const peerName =
|
5199
|
-
const [chatOptions, setChatOptions] =
|
4920
|
+
const peerName = useHMSStore29(selectPeerNameByID3(peerSelector));
|
4921
|
+
const [chatOptions, setChatOptions] = useState31({
|
5200
4922
|
role: roleSelector || "",
|
5201
4923
|
peerId: peerSelector && peerName ? peerSelector : "",
|
5202
4924
|
selection: roleSelector ? roleSelector : peerSelector && peerName ? peerName : "Everyone"
|
5203
4925
|
});
|
5204
|
-
const [isSelectorOpen
|
5205
|
-
const listRef =
|
5206
|
-
const hmsActions =
|
4926
|
+
const [isSelectorOpen] = useState31(false);
|
4927
|
+
const listRef = useRef13(null);
|
4928
|
+
const hmsActions = useHMSActions18();
|
5207
4929
|
const { setPinnedMessage } = useSetPinnedMessage();
|
5208
4930
|
useEffect20(() => {
|
5209
4931
|
if (notification && notification.data && peerSelector === notification.data.id) {
|
@@ -5216,51 +4938,71 @@ var Chat = ({ screenType }) => {
|
|
5216
4938
|
}
|
5217
4939
|
}, [notification, peerSelector, setPeerSelector]);
|
5218
4940
|
const storeMessageSelector = selectHMSMessagesCount;
|
5219
|
-
const
|
5220
|
-
const
|
5221
|
-
|
4941
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4942
|
+
const isMobile = useMedia13(config.media.md);
|
4943
|
+
let isScrolledToBottom = false;
|
4944
|
+
if (listRef.current) {
|
4945
|
+
const currentRef = listRef.current._outerRef;
|
4946
|
+
isScrolledToBottom = currentRef.scrollHeight - currentRef.clientHeight - currentRef.scrollTop < 10;
|
4947
|
+
}
|
4948
|
+
const messagesCount = useHMSStore29(storeMessageSelector) || 0;
|
4949
|
+
const scrollToBottom = useCallback14(
|
5222
4950
|
(unreadCount = 0) => {
|
5223
|
-
var
|
4951
|
+
var _a2;
|
5224
4952
|
if (listRef.current && listRef.current.scrollToItem && unreadCount > 0) {
|
5225
|
-
(
|
4953
|
+
(_a2 = listRef.current) == null ? void 0 : _a2.scrollToItem(messagesCount, "end");
|
5226
4954
|
requestAnimationFrame(() => {
|
5227
|
-
var
|
5228
|
-
(
|
4955
|
+
var _a3;
|
4956
|
+
(_a3 = listRef.current) == null ? void 0 : _a3.scrollToItem(messagesCount, "end");
|
5229
4957
|
});
|
5230
4958
|
hmsActions.setMessageRead(true);
|
5231
4959
|
}
|
5232
4960
|
},
|
5233
4961
|
[hmsActions, messagesCount]
|
5234
4962
|
);
|
5235
|
-
return /* @__PURE__ */ React54.createElement(
|
5236
|
-
|
5237
|
-
{
|
5238
|
-
role: chatOptions.role,
|
5239
|
-
peerId: chatOptions.peerId,
|
5240
|
-
ref: listRef,
|
5241
|
-
scrollToBottom,
|
5242
|
-
screenType
|
5243
|
-
}
|
5244
|
-
), /* @__PURE__ */ React54.createElement(
|
5245
|
-
ChatFooter,
|
4963
|
+
return /* @__PURE__ */ React54.createElement(
|
4964
|
+
Flex,
|
5246
4965
|
{
|
5247
|
-
|
5248
|
-
|
5249
|
-
|
5250
|
-
|
5251
|
-
|
5252
|
-
|
5253
|
-
|
5254
|
-
peerId,
|
5255
|
-
selection
|
5256
|
-
});
|
5257
|
-
setPeerSelector(peerId);
|
5258
|
-
setRoleSelector(role);
|
5259
|
-
},
|
5260
|
-
peerId: chatOptions.peerId
|
4966
|
+
direction: "column",
|
4967
|
+
css: {
|
4968
|
+
size: "100%",
|
4969
|
+
gap: "$4",
|
4970
|
+
marginTop: hideControls && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? "$17" : "0",
|
4971
|
+
transition: "margin 0.3s ease-in-out"
|
4972
|
+
}
|
5261
4973
|
},
|
5262
|
-
|
5263
|
-
|
4974
|
+
isMobile && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.is_overlay) ? null : /* @__PURE__ */ React54.createElement(React54.Fragment, null, ((_c = elements == null ? void 0 : elements.chat) == null ? void 0 : _c.allow_pinning_messages) ? /* @__PURE__ */ React54.createElement(PinnedMessage, { clearPinnedMessage: setPinnedMessage }) : null),
|
4975
|
+
/* @__PURE__ */ React54.createElement(
|
4976
|
+
ChatBody,
|
4977
|
+
{
|
4978
|
+
role: chatOptions.role,
|
4979
|
+
peerId: chatOptions.peerId,
|
4980
|
+
ref: listRef,
|
4981
|
+
scrollToBottom,
|
4982
|
+
screenType
|
4983
|
+
}
|
4984
|
+
),
|
4985
|
+
/* @__PURE__ */ React54.createElement(
|
4986
|
+
ChatFooter,
|
4987
|
+
{
|
4988
|
+
role: chatOptions.role,
|
4989
|
+
onSend: () => scrollToBottom(1),
|
4990
|
+
selection: chatOptions.selection,
|
4991
|
+
screenType,
|
4992
|
+
onSelect: ({ role, peerId, selection }) => {
|
4993
|
+
setChatOptions({
|
4994
|
+
role,
|
4995
|
+
peerId,
|
4996
|
+
selection
|
4997
|
+
});
|
4998
|
+
setPeerSelector(peerId);
|
4999
|
+
setRoleSelector(role);
|
5000
|
+
},
|
5001
|
+
peerId: chatOptions.peerId
|
5002
|
+
},
|
5003
|
+
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */ React54.createElement(NewMessageIndicator, { role: chatOptions.role, peerId: chatOptions.peerId, scrollToBottom })
|
5004
|
+
)
|
5005
|
+
);
|
5264
5006
|
};
|
5265
5007
|
var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
5266
5008
|
const unreadCount = useUnreadCount({ role, peerId });
|
@@ -5306,17 +5048,109 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5306
5048
|
);
|
5307
5049
|
};
|
5308
5050
|
|
5051
|
+
// src/Prebuilt/components/SidePaneTabs.tsx
|
5052
|
+
var tabTriggerCSS = {
|
5053
|
+
color: "$on_surface_high",
|
5054
|
+
p: "$4",
|
5055
|
+
fontWeight: "$semiBold",
|
5056
|
+
fontSize: "$sm",
|
5057
|
+
w: "100%",
|
5058
|
+
justifyContent: "center"
|
5059
|
+
};
|
5060
|
+
var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType, hideControls }) => {
|
5061
|
+
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
5062
|
+
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
5063
|
+
const resetSidePane = useSidepaneReset();
|
5064
|
+
const [activeTab, setActiveTab] = useState32(active);
|
5065
|
+
const peerCount = useHMSStore30(selectPeerCount3);
|
5066
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
5067
|
+
const showChat = !!(elements == null ? void 0 : elements.chat);
|
5068
|
+
const showParticipants = !!(elements == null ? void 0 : elements.participant_list);
|
5069
|
+
const hideTabs = !(showChat && showParticipants);
|
5070
|
+
useEffect21(() => {
|
5071
|
+
if (activeTab === SIDE_PANE_OPTIONS.CHAT && !showChat && showParticipants) {
|
5072
|
+
setActiveTab(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
5073
|
+
} else if (activeTab === SIDE_PANE_OPTIONS.PARTICIPANTS && showChat && !showParticipants) {
|
5074
|
+
setActiveTab(SIDE_PANE_OPTIONS.CHAT);
|
5075
|
+
} else if (!showChat && !showParticipants) {
|
5076
|
+
resetSidePane();
|
5077
|
+
}
|
5078
|
+
}, [showChat, activeTab, showParticipants, resetSidePane]);
|
5079
|
+
return /* @__PURE__ */ React55.createElement(
|
5080
|
+
Flex,
|
5081
|
+
{
|
5082
|
+
direction: "column",
|
5083
|
+
css: {
|
5084
|
+
color: "$on_primary_high",
|
5085
|
+
h: "100%"
|
5086
|
+
}
|
5087
|
+
},
|
5088
|
+
hideTabs ? /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", p: "$4", c: "$on_surface_high", pr: "$12" } }, showChat ? "Chat" : `Participants (${peerCount})`), showChat ? /* @__PURE__ */ React55.createElement(Chat, { screenType, hideControls }) : /* @__PURE__ */ React55.createElement(ParticipantList, null)) : /* @__PURE__ */ React55.createElement(
|
5089
|
+
Tabs.Root,
|
5090
|
+
{
|
5091
|
+
value: activeTab,
|
5092
|
+
onValueChange: setActiveTab,
|
5093
|
+
css: {
|
5094
|
+
flexDirection: "column",
|
5095
|
+
size: "100%"
|
5096
|
+
}
|
5097
|
+
},
|
5098
|
+
/* @__PURE__ */ React55.createElement(Tabs.List, { css: { w: "calc(100% - $12)", p: "$2", borderRadius: "$2", bg: "$surface_default" } }, /* @__PURE__ */ React55.createElement(
|
5099
|
+
Tabs.Trigger,
|
5100
|
+
{
|
5101
|
+
value: SIDE_PANE_OPTIONS.CHAT,
|
5102
|
+
onClick: toggleChat,
|
5103
|
+
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
5104
|
+
color: activeTab !== SIDE_PANE_OPTIONS.CHAT ? "$on_surface_low" : "$on_surface_high"
|
5105
|
+
})
|
5106
|
+
},
|
5107
|
+
"Chat"
|
5108
|
+
), /* @__PURE__ */ React55.createElement(
|
5109
|
+
Tabs.Trigger,
|
5110
|
+
{
|
5111
|
+
value: SIDE_PANE_OPTIONS.PARTICIPANTS,
|
5112
|
+
onClick: toggleParticipants,
|
5113
|
+
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
5114
|
+
color: activeTab !== SIDE_PANE_OPTIONS.PARTICIPANTS ? "$on_surface_low" : "$on_surface_high"
|
5115
|
+
})
|
5116
|
+
},
|
5117
|
+
"Participants (",
|
5118
|
+
peerCount,
|
5119
|
+
")"
|
5120
|
+
)),
|
5121
|
+
/* @__PURE__ */ React55.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.PARTICIPANTS, css: { p: 0 } }, /* @__PURE__ */ React55.createElement(ParticipantList, null)),
|
5122
|
+
/* @__PURE__ */ React55.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.CHAT, css: { p: 0 } }, /* @__PURE__ */ React55.createElement(Chat, { screenType, hideControls }))
|
5123
|
+
),
|
5124
|
+
/* @__PURE__ */ React55.createElement(
|
5125
|
+
IconButton,
|
5126
|
+
{
|
5127
|
+
css: { position: "absolute", right: "$10", top: "$11" },
|
5128
|
+
onClick: (e) => {
|
5129
|
+
e.stopPropagation();
|
5130
|
+
if (activeTab === SIDE_PANE_OPTIONS.CHAT) {
|
5131
|
+
toggleChat();
|
5132
|
+
} else {
|
5133
|
+
toggleParticipants();
|
5134
|
+
}
|
5135
|
+
},
|
5136
|
+
"data-testid": "close_chat"
|
5137
|
+
},
|
5138
|
+
/* @__PURE__ */ React55.createElement(CrossIcon7, null)
|
5139
|
+
)
|
5140
|
+
);
|
5141
|
+
});
|
5142
|
+
|
5309
5143
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5310
|
-
import
|
5311
|
-
import { selectPermissions as
|
5144
|
+
import React57, { Fragment as Fragment10, useState as useState34 } from "react";
|
5145
|
+
import { selectPermissions as selectPermissions11, useHMSStore as useHMSStore32, useRecordingStreaming as useRecordingStreaming7 } from "@100mslive/react-sdk";
|
5312
5146
|
import { ColoredHandIcon, CrossIcon as CrossIcon8, GoLiveIcon as GoLiveIcon3 } from "@100mslive/react-icons";
|
5313
5147
|
|
5314
5148
|
// src/Prebuilt/images/rtmp.png
|
5315
5149
|
var rtmp_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABlCAYAAAC7vkbxAAAVDUlEQVR4Ae1dDXgU9Zl//7OfiWz4SCKEgCR+kIVQWb76aKUSxHp6aiGtvZ6e1XC94l3VKsVeH73rCU/vWu85rHJie9JrDWix3nFH/KhaEY1CvZ58uFQDCVQIKEkgAUO+92Pm3/ed2Zmd2cwmu5uZzQL+nmfJzOwwX7//+/l/31mAz5BTYHCWwe+/ogwc4SrgUCYBTGOMl9Gy+j0H6GQMOjlnzQLAUYmzYNgj1jcHg51wFuCsIMQ/a34V59JS4HwZrpZBBkCigoyxeuaS1jUGg82Qo8hZQsoCgXF5EaFGAn4nPs0AWAgiR2BsXWPD3lrIMeQkIRWz5t0HXFqNT25c4nc8fxJEShZKou8SEMdeFuJOX56UP7EXQMhT9pD6HX1tLtZ/wu0480dwdB+SHB1BQehrMztVM0rNmlwiJqcIIdUkSeJjeFEGiZAKLmmPlFxdHCq/BbhrDGQCIsfV9k7I9clvPYPIYajOXLw6F1RZzhBSUTn3MbQR9+u3iUUBGJi+HKKFlmoscH/8GngOPg2DiOFsZdOBvY/DKGLUCSFb4YmwraieqtRtEqql/sCDlhORCFNiGHu8qWHvShgljCoh/kCgjIfZW6DznMIXfw2loiZj1ZQuiAwvkuJCclSQ0Q+7+eLRcJVHjZBEMogAkorIpIUwGvAc3gLehie09dEiZVQISSSDVFTvlevkv6MJ56kg5O/6B2CRHnl9NEgRYBQghdFm5BgZBLJZdC2quiRvzx0RHoMswgFZxvSZcx/GG/1LWqYb7134s5wgQwX3TgBxfKVs8AlESlHR5DOnOlp/D1lAVgmhOAMDvlp1vX/ew3jzMyHXIA8Qlw+c7e8pGxhcUVw66fmOtjbbVZcTsgguiU+ryyGML+ww4BUTBemGmS6YUcLYZcUM8twCj4ic9YY59IQA2ro4b+nk8PqBKOw5JiZV2aGLbwFH1yHV+xrHI4yufTHYjKwRQqoKKSmjZRqBAxU1YCUmFjD+o6Ue/ueVzsSHzBJ8F3lFlEBCQoY8Zn/lveBs26kYeYyT/JVza+xOs2TFqJNXxYDXqOtkOK1EZYlD2nbvBWBCxohANm4ASdHWOX8YbEZWCJHCwp0Q86rCU6+31IhPHc/gub/2smKfPS48XW+0SMsYlJGUgI3ICiF66SDbYSX+tdojFfuYrfGU/po5TQfYCNsJiY2oMloW0c+3UjrmTxPExdOdtt8DxSdaKodsyaxAFdgE22+Gc1iqLoen3gBW4q4verKWaQij16WCS8IysAn2e1mM0/y3DJxYAiux4KLhx9OOP4p8/dsRaGgReW84PgCjIk9rMIan3ACeptrYGqdBdj/YAFslRAkElVk/UlfcaV0GN88FHF3dIa//0ElJunNjP7xzKMpO9XJhIMJB/UQlSAukanlc3ZbRtAHYAFsJYVzS3BOrpQPJGHaff3o5xPoj1nlf+kDWG7FHbdlKiMRhkbosFlwGVsIpDO9Z7f1Y4mAhxLGXxld4ZtUvw8Feo864JtaGm8kSwlFu6f3pBxXVhIENsFll6QrYnNmZAbQT+nsQmJIGshq2EsJ1cx7nAvT3wc9KlfUZ0sZnhOQYsjofkgm23pXHryh3ZOS6Hvlhcru1cG2f9FGHlHMD8ryUEAwK+ZFTUk6W0Z6XhBzpkDhGKOcfIXjHzfJJzAudRw3HO3lGZOjvA8PSZrAB9rq9DLSigFwipaFVhEwg9Ldqy+j2ngEbYK+ESLBPO1F/7hBy7DTPKKVCFfQqGLAg2AB7CRHiF00VHLmCwx2ZpbgcXTpCHJIthNjq9nKGFx1T187WnRAq/xqki2f/P8LrDw5OEhaO4exbV7mHtAVrt0UkszR74wkxMxuiI4RHwBZCbPc0KirnfEpzIjQF2n3t85bltC4tFmDHqvwh9yn/QQ/OfYAlIJXre+PrygqDYFPD+3PABtjv9nJWT3+otsnVtgPOVrhaddfO2dtgE2wnhAmSVoTlOvYanK1wH9miLTtZvBzWatieOhlwQtATQfcX1RaV+9PH7s6odCD0tcrqKNELlPImyZUmUn6JLB2a247qqqEhaIv9INhOCPVW+GfOXcdBqfrzND0N0S9YW7mYKlhUUZtydy4ODL0bm/IxOKsDG5GV5OKAW3rcE2H3jYaUEAnOjvfBfXiLfN6RAgfW6oqZc2owVK+z4yUEtnhZVJHhHfAaqzKEcI0qJTSd23P1L2AkGM7L6uruhrk1teD4aIvWEZUIj+CDIlcF+ByTwe0YAx7m074L8W7oibZCV7QFOiJNSc/DGasVXNIaq4gZMSHyw486A/TqC855FeZ4yswa/hNB5f76QuZ0MRQhm57ZDOt/ugG6uroN24mAcu9iKPXOhcnu+eBzToZU0RLaDcdDe+BIf70pQVYRkzEh2vtHqG43BQLM0Iu2JFPVZUbI8ZYWePCh1fDerj2G7aWe+bCgYAUUuisMUpApusUW2NX1FJK0R5YgHdB5YWtG0uueNiEKEeLD+r5yPQoKfFA6eTL4fMYbP368RX5gepAX07PoF7JHky4SCTGTCpWIyfjXDhAxjb0vwR96NkNI0kkjg3rm4sszkZaUCVEa/IWHE9+2QAT4Kyrg2iVVsAQ/REYy0MNqbGqCHz/yKBxoVMRebvpESUmXFD0hP3pkLRLynPYdqaIl41fbRkQiVIkhcnRoZm6+OF1SUiLErMGfiLjjG7fBHbffJi+nAzK41V+9VZYaQiakECG/WSHCPfeuMqgo/wU3w1XjHtBUE92gpdVyCVCPT2V7jb0vws7OR/XS0ulkfHE6ccuwhEyfMW8ZRttP6+3EPXfflRERehAZdyxfoZGidCvdk3KFfPnYXpi4+36UtIPatoVIxOVjbrOdhGQgUrrRptS1r9DblrRIGZKQ6ZXz7mS6rtnS0snw5L8/Cn5/BViBRFII5H2FKpYPm4SkBn9X2055mbynhWMfgAqUjlxAD6qwVzpW6b2xlElJ2hZdGQgEuAha8mkGkvDrzRtlUqwCSdi111RBI45y1eA7P90PrpY3MfE1ht6HZfr/6IUxnqMvauu3XLgRpnq/ALkCNw6QS/P/DD4e+D/ok07RJq8E7Pri0kkvDNdabUoI2QwpzF7FRVlNXbtkMaxHyRiJikoGOmb1sptlWVVtgZIZ3ilH1tQCQPkkFe6PX4W8hvXa+jXj18BFOUSGCifzyKR81P+6alPGgcQCp9rbNg71/0xVFqYGjkDMgJNkbHx6gy1kJMJMhRHI6Icuvb1PGjMlPy/4iJbo+3zBXTAfP7kMUl/Pn7g1buiHeSfXIEKUV1/w1bRM6mkTkmGlmkoFW+telGOKRGL0uDhvMVxf+CicDaAonwy9CnSHy5O5wwZCZPc2wt5XPaof/8saRZ2MEpIRQ3HGsuINcg4qHZRfCTCnGmzBjp8DtCcpG6CHvKNzrRxAxjbU44yj6VshjNleJfCTyahe9uXMyZAdc06Z0djlMP0XKUejdA0knXfUrDBsX4BqSs5DpeHbzvgSwJLvYo7Tpik57wXJv6PLpGtu6ntJUV2xTt7GD4P1iftqhCjBX7yf/J5vr0h68MiePeDahyn0jw4DP3ECnGIUoK8fpO4uzLWHkAsu74mcyDUORIH87BwCSBeMAQfaI+7ygFhcCGxaGQgzZoKjapHiyCfg8wvmy5/3du2W14kIf/7NyrEhNQSWAVz9d/H1IM5o9H8KI4bTiw/61tT29Tp8coxEET2Bc0aZ7/pBx9SWIkKVeovqyEwEJhMh8p37wPnkk3KlWOJkipnLxhL+Crp1/WANz5oF7JXfgGvqRTAUFsSMeKpk0AO7ssa4bT/6jx3NMGLkjUudEBqjRIiW90oiJdoz0b+hoHrZTaYHFZ/ZBM7162MSYC1cH34IkXsHdxo3Nh0cJB2pYt5fDCZjNEEBLJGiwqzfXSaE1JWavSXJIBUxGEjC1hdtrRvyvPUGSD3GyaSNm36lLc/W3cxwmP91gKu+CTmHyw33wO9MbK+WCZFEhzYpYU6GbBGAH05/DjodCJQ6P3nSsE2fOCzPq4JUMW0BpI3xUwDm3qJ8DOYMx+LspYotGjcFRgSSktJ4Fhon94wvjZYJEUSuI2Se6YFITbGWVhgOoZtuBn7RVMgUXDdnQupKdXmL3BVpu7nporAcE5TfUj56VUAK+ot/qzgGJX4YMfQDK1FtCbETzlY3lJaWmB6Eh0LATw/vmji/cTvwd3bCwN3fBikTH7MrXlR+4ECjtjzZMw/OFRgknfFF+u+E2EZNjyWbYJI6O9GLSq2M3zHtIsh7Aj2xxgYQv3QdzTdDynNhn8ZJ16fWS7M02ZQNkKQXqPP5HAJ6OyITou8nT5omQQmBIfpceGIMgauOy/zgeP23EHp2M0QuvhhSAR8Ia8uNOkIKHCVwLqHQFZ/CuCASf/5p6JTkozzidkF/vhciXgz2BAbRaBREUZQ/4XAYhGuvgUj1jRByOiDqGwNDSguPl6vTdK/ZDZwL8OkGmAiCZsNTL5QTmNyBYxaRkQfmFBxyRB6ROAjoAEgS7osRfOjxn4D7qQ3gONmOSTU3REQ8gAP3F81jGZYfL1xQCxbSKdc5W1Cguyccg5rKkgnh1C8XU1vk1ZiqLUx3SChQDhjccOFGKYCwompo7DtcLhDf2g7SfSvB98EHkA5Y4QT5L827a6d2ZIeQ5vcAfvlXyrJOUGUX+JnlyvJAD1gCjzBGf3wjITjwj6rmgWbuzAhxFBQo6uZMFwwF3twM0euuA8e2N5C8DCJ6r1f+051Q5JYNRNFM0rt9zXDGpCMvrwAsh2LUda1njQcOmu7ImQBswgQYDs7vfx+c27ap6cS0wX023KUNKJgI8OV/jq9blUxS4hAW75c70GROCD1gqcKCqGgISKQbyhVvzFdgrLPNJRRMAvjKvymkEH6/CeATixoUZEKohwNiLczbt781qCZWAQNhXgb5iDQgzp4NjvGKOi3QVT4aqgJHGZReueXROBnv/hLTO7+CtBGS4sYIfaB4+zj9E/t9DJljMqZ6d9OAVfdD5JJLlJFsNcYWgPiEcapZtWXd0RawFCzJZ5h9ii5BMn4CMKYIZB1Vj7Hv7uchI+hrggWn1KwuO+PnZxsxBV9Fy+uf3ACbagdHxo7xE0Da8Ttgv94M4W3bwdVzBqKftABrawEhFFbyXUOk5tXgUcR4hE0oAl5YiHmvKcD8M8Dxzb+BvMpKw/6UNVBzWXQDBRa5v8seQfUYNW7bgw92X6yyyIvCecMPUBpKjft4cFbQlUfJWIBtawGa3oSMcSoSNw2CFH8rhEbIgEuq80TYYzSfTvMP9DHL/LpKUFZXrgTPSuV3s9zqF+gnciID4wseHsAP5r5ESZ4zZU4XCBiDMJcb6KV7TqI/BSnz+6drcyEt4T2WEZJvUqvvioU/+ei3VCNhhdPM/29kAOAVNOZHd8GIoG9p0BfQaZE6qS3GmdZrRlKSFsgLo+DQ5QSBpmnHF4KzqBicEwpll5mhO8twCleg/VJUeTOQELMbsAu+YsU+JCNjAD3+//37kZNBxdmaXWTGfndD6oRaz1TjTiNz06bNMJqYMSPu1VGjjJ3wXQjwVVRD45IIYd9pgC0PAJywYFxQWZCGhBZrAyEkJVzgy9X19T99ChN89o/MZFj/5FPaMhn2UzZKyeduVNxZM3TjnNmWVQCnj4IlaOx9WVtmglSn/25QcvHgB1SToXSaksd193dWDWq0yQaIjDe2v2XYdthmKTFD1wlFMjotegSkro7HJaQ5scjBNLkYckvLPWFGGcgyubyzZgV6XRuGbMaxEkQGSWciqGLjct9tKbWlnT6GN+c2/45shNM7ePvJQ8YcVghDhe1oVbtPgGXY1x03A+iT1id+n9S6+v2BMi7Em3TkstIskKJ0Q23WXSBfg+7yIrUIQ+0BGQlu+xnGFLrpGSJh+2MA+18H2/Fs201aDMIkXt7YaCwpTTofQjvif1gMsbfCkaRUf+VW2Fr3EtgBUouyJCaQ0bg/uJoxvkbdto/qmixMpZAUvPLD7JBBRXIaGQzqE8kgDPmzeR0dbZ3FhZNewP9NE/HjQphi3/5mPT68VvSAphvSG5mC7NTP/7MWHvrH1XD4SLO2XSVDvo6Tbc1FF5ZU4WJZGN1FKvWfMoIp3c/dhPHGeMVY//d3AVr3g+0gp+R3Z+Ltbk7Gq9vb2wblkIf9HUOVFAzlxuNTkme2yPOikUzEFGBKPpPqeJWIVd97EHbsfBdniGNTt+h2M4Hf0NgQrNXvXzxx0lF0EWtomaJc6r2gkppMQIRE8XT/8z28jiy96O7dM2vlPncC2o7axv3vP2W2X1pJKX9loCZWk1qm364W1y25ZhFMwWWzljc5R3agSS7teWN7vRaBJ1xOHZOklWaiTKiYOXcr3o5cNkNFD0uL0wxeY7gR7+Cd/7DWWA8FckZ2dq5VVmjAiXxOsntMv08djT2qsNWYAlk61AsD9Ma/u6c7SQY5dhGoTzEJtsasGlyP2G+vH1HPOxs9rqvGPgDpwulRJqOyAXJz/8vQsMNXNh0Ipt6wkypkYhxQheJHL5VJ/3UMlBGQ2EbmkOqGI8Jw3lmBKi4xLUCxwuuyC0TGC4aOXFbXtH/vkB0qluTRNXIkIYD6fzbNz3OdWqP399IrYzFXFmRM2ofLwXRIGHS+mYHVOBC0H3mkPkN/jnTgqhhMBsheazJVpcLO2mlb4a+cU4vJZa1iP5ckJVMyCFn/+W6r0NHeVld8YUk5Lsrq8tjAu/L20a5wpHzbyx33xskgzSDxK1Mhg3DWEkIgUoqKJ2NEAVfQOr2dhz6l3nkZu8QjAXlTr55apZ9ybk6HDMJZTQjhVHvra8XFk6iKr4rWSV0cGaiXCSl2Z6HakSlzNdtOPwQNvVv036SsphIOd27ALEaiikdqgUun6yodJHkLEIKvC/XB6ubmYCekiXOGEIIWIzEw/ICwSkypZ54lPSY0wfSHnudwOsA4PUD2gkt8+cEDwTrIEOcUISqSZRQIZPSpP6PINT3l92lRHqolvBvaMWXT1PvS4LIk2aXn6wb64PFMpMJ4qHMYQxGjoij22j8zyemINslkJK0LixEBEtSmayuS4ZwmRIX8c9siqxku3ZMqKNWD2egX+nuhdqQSMejYcJ5BJkcSqqiVjFMMMxxBStFHM6Z53sb57+BAL9RZTYLxdOc5ysoC47xeJMVpVGsODp2iCJ1WqaJU8SdC2O29RZg76wAAAABJRU5ErkJggg==";
|
5316
5150
|
|
5317
5151
|
// src/Prebuilt/components/Streaming/HLSStreaming.jsx
|
5318
|
-
import
|
5319
|
-
import { selectRoomID, useHMSActions as
|
5152
|
+
import React56, { Fragment as Fragment9, useCallback as useCallback15, useEffect as useEffect22, useState as useState33 } from "react";
|
5153
|
+
import { selectRoomID, useHMSActions as useHMSActions19, useHMSStore as useHMSStore31, useRecordingStreaming as useRecordingStreaming6 } from "@100mslive/react-sdk";
|
5320
5154
|
import {
|
5321
5155
|
EndStreamIcon as EndStreamIcon2,
|
5322
5156
|
EyeOpenIcon,
|
@@ -5335,7 +5169,7 @@ var getCardData = (roleName, roomId) => {
|
|
5335
5169
|
data3 = {
|
5336
5170
|
title: formattedRoleName,
|
5337
5171
|
content: "Broadcasters can livestream audio or video, manage stream appearance and control the room via HLS.",
|
5338
|
-
icon: /* @__PURE__ */
|
5172
|
+
icon: /* @__PURE__ */ React56.createElement(SupportIcon, null)
|
5339
5173
|
};
|
5340
5174
|
break;
|
5341
5175
|
}
|
@@ -5343,7 +5177,7 @@ var getCardData = (roleName, roomId) => {
|
|
5343
5177
|
data3 = {
|
5344
5178
|
title: "HLS Viewer",
|
5345
5179
|
content: "Viewers can view and send chat messages, but need to be made broadcasters to participate with audio or video.",
|
5346
|
-
icon: /* @__PURE__ */
|
5180
|
+
icon: /* @__PURE__ */ React56.createElement(EyeOpenIcon, null)
|
5347
5181
|
};
|
5348
5182
|
break;
|
5349
5183
|
}
|
@@ -5351,7 +5185,7 @@ var getCardData = (roleName, roomId) => {
|
|
5351
5185
|
data3 = {
|
5352
5186
|
title: formattedRoleName,
|
5353
5187
|
content: `${formattedRoleName} is customised with specific permissions, which will determine how it interacts with this room.`,
|
5354
|
-
icon: /* @__PURE__ */
|
5188
|
+
icon: /* @__PURE__ */ React56.createElement(WrenchIcon, null),
|
5355
5189
|
order: 1
|
5356
5190
|
};
|
5357
5191
|
}
|
@@ -5360,7 +5194,7 @@ var getCardData = (roleName, roomId) => {
|
|
5360
5194
|
};
|
5361
5195
|
var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
5362
5196
|
const [copied, setCopied] = useState33(false);
|
5363
|
-
return isHLSRunning ? /* @__PURE__ */
|
5197
|
+
return isHLSRunning ? /* @__PURE__ */ React56.createElement(
|
5364
5198
|
Box,
|
5365
5199
|
{
|
5366
5200
|
key: title,
|
@@ -5371,9 +5205,9 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5371
5205
|
borderRadius: "$2"
|
5372
5206
|
}
|
5373
5207
|
},
|
5374
|
-
/* @__PURE__ */
|
5375
|
-
/* @__PURE__ */
|
5376
|
-
/* @__PURE__ */
|
5208
|
+
/* @__PURE__ */ React56.createElement(Flex, { align: "center", gap: "2", css: { color: "$primary_bright" } }, icon, /* @__PURE__ */ React56.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, title)),
|
5209
|
+
/* @__PURE__ */ React56.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium", mt: "$6" } }, content),
|
5210
|
+
/* @__PURE__ */ React56.createElement(
|
5377
5211
|
Button,
|
5378
5212
|
{
|
5379
5213
|
variant: "standard",
|
@@ -5385,7 +5219,7 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5385
5219
|
css: { w: "100%", r: "$1", mt: "$10", fontWeight: "$semiBold" },
|
5386
5220
|
icon: true
|
5387
5221
|
},
|
5388
|
-
copied ? /* @__PURE__ */
|
5222
|
+
copied ? /* @__PURE__ */ React56.createElement(React56.Fragment, null, "Link copied!") : /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(LinkIcon, { style: { color: "inherit" } }), "Copy Invite Link")
|
5389
5223
|
)
|
5390
5224
|
) : null;
|
5391
5225
|
};
|
@@ -5395,14 +5229,14 @@ var HLSStreaming = ({ onBack }) => {
|
|
5395
5229
|
const cards = roleNames.map((roleName) => getCardData(roleName, roomId));
|
5396
5230
|
const { isHLSRunning } = useRecordingStreaming6();
|
5397
5231
|
const [showLinks, setShowLinks] = useState33(false);
|
5398
|
-
return !showLinks ? /* @__PURE__ */
|
5232
|
+
return !showLinks ? /* @__PURE__ */ React56.createElement(Container, { rounded: true }, /* @__PURE__ */ React56.createElement(ContentHeader, { title: "Start Streaming", content: "HLS", onBack }), /* @__PURE__ */ React56.createElement(ContentBody, { title: "HLS Streaming", Icon: GoLiveIcon2, removeVerticalPadding: true }, "Stream directly from the browser using any device with multiple hosts and real-time messaging, all within this platform."), isHLSRunning ? /* @__PURE__ */ React56.createElement(EndHLS, { setShowLinks }) : /* @__PURE__ */ React56.createElement(StartHLS, null)) : /* @__PURE__ */ React56.createElement(Container, { rounded: true }, /* @__PURE__ */ React56.createElement(ContentHeader, { title: "Invite People", content: "Start the conversation", onBack: () => setShowLinks(false) }), /* @__PURE__ */ React56.createElement(Flex, { direction: "column", css: { gap: "$10", p: "$0 $10", overflowY: "auto", mb: "$10" } }, cards.map((card) => /* @__PURE__ */ React56.createElement(Card, __spreadProps(__spreadValues({ key: card.title }, card), { isHLSRunning })))));
|
5399
5233
|
};
|
5400
5234
|
var StartHLS = () => {
|
5401
5235
|
const [record, setRecord] = useState33(false);
|
5402
5236
|
const [error, setError] = useState33(false);
|
5403
|
-
const hmsActions =
|
5237
|
+
const hmsActions = useHMSActions19();
|
5404
5238
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5405
|
-
const startHLS =
|
5239
|
+
const startHLS = useCallback15(
|
5406
5240
|
(variants) => __async(void 0, null, function* () {
|
5407
5241
|
try {
|
5408
5242
|
if (isHLSStarted) {
|
@@ -5421,7 +5255,7 @@ var StartHLS = () => {
|
|
5421
5255
|
}),
|
5422
5256
|
[hmsActions, record, isHLSStarted, setHLSStarted]
|
5423
5257
|
);
|
5424
|
-
return /* @__PURE__ */
|
5258
|
+
return /* @__PURE__ */ React56.createElement(Fragment9, null, /* @__PURE__ */ React56.createElement(RecordStream, { record, setRecord, testId: "hls-recording" }), /* @__PURE__ */ React56.createElement(Box, { css: { p: "$4 $10" } }, /* @__PURE__ */ React56.createElement(ErrorText, { error }), /* @__PURE__ */ React56.createElement(
|
5425
5259
|
Button,
|
5426
5260
|
{
|
5427
5261
|
"data-testid": "start_hls",
|
@@ -5430,21 +5264,21 @@ var StartHLS = () => {
|
|
5430
5264
|
onClick: () => startHLS(),
|
5431
5265
|
disabled: isHLSStarted
|
5432
5266
|
},
|
5433
|
-
isHLSStarted ? /* @__PURE__ */
|
5267
|
+
isHLSStarted ? /* @__PURE__ */ React56.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React56.createElement(GoLiveIcon2, null),
|
5434
5268
|
isHLSStarted ? "Starting stream..." : "Go Live"
|
5435
|
-
)), /* @__PURE__ */
|
5269
|
+
)), /* @__PURE__ */ React56.createElement(Flex, { align: "center", css: { p: "$4 $10" } }, /* @__PURE__ */ React56.createElement(Text, null, /* @__PURE__ */ React56.createElement(InfoIcon4, { width: 16, height: 16 })), /* @__PURE__ */ React56.createElement(Text, { variant: "tiny", color: "$on_surface_medium", css: { mx: "$8" } }, "You cannot start recording once the stream starts, you will have to stop the stream to enable recording.")));
|
5436
5270
|
};
|
5437
5271
|
var EndHLS = ({ setShowLinks }) => {
|
5438
|
-
const hmsActions =
|
5272
|
+
const hmsActions = useHMSActions19();
|
5439
5273
|
const [inProgress, setInProgress] = useState33(false);
|
5440
5274
|
const [error, setError] = useState33("");
|
5441
5275
|
const { isHLSRunning } = useRecordingStreaming6();
|
5442
|
-
|
5276
|
+
useEffect22(() => {
|
5443
5277
|
if (inProgress && !isHLSRunning) {
|
5444
5278
|
setInProgress(false);
|
5445
5279
|
}
|
5446
5280
|
}, [inProgress, isHLSRunning]);
|
5447
|
-
return /* @__PURE__ */
|
5281
|
+
return /* @__PURE__ */ React56.createElement(Box, { css: { p: "$4 $10" } }, /* @__PURE__ */ React56.createElement(ErrorText, { error }), /* @__PURE__ */ React56.createElement(
|
5448
5282
|
Button,
|
5449
5283
|
{
|
5450
5284
|
"data-testid": "stop_hls",
|
@@ -5463,23 +5297,23 @@ var EndHLS = ({ setShowLinks }) => {
|
|
5463
5297
|
}
|
5464
5298
|
})
|
5465
5299
|
},
|
5466
|
-
/* @__PURE__ */
|
5300
|
+
/* @__PURE__ */ React56.createElement(EndStreamIcon2, null),
|
5467
5301
|
"End Stream"
|
5468
|
-
), /* @__PURE__ */
|
5302
|
+
), /* @__PURE__ */ React56.createElement(Button, { icon: true, css: { w: "100%", r: "$0", mt: "$8" }, onClick: () => setShowLinks(true) }, /* @__PURE__ */ React56.createElement(PeopleIcon3, null), " Invite People"));
|
5469
5303
|
};
|
5470
5304
|
|
5471
5305
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5472
5306
|
var StreamingLanding = () => {
|
5473
5307
|
const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
|
5474
5308
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming7();
|
5475
|
-
const permissions = useHMSStore32(
|
5309
|
+
const permissions = useHMSStore32(selectPermissions11);
|
5476
5310
|
const [showHLS, setShowHLS] = useState34(isHLSRunning);
|
5477
5311
|
const [showRTMP, setShowRTMP] = useState34(isRTMPRunning);
|
5478
5312
|
if (!(permissions == null ? void 0 : permissions.hlsStreaming) && !(permissions == null ? void 0 : permissions.rtmpStreaming)) {
|
5479
5313
|
toggleStreaming();
|
5480
5314
|
return null;
|
5481
5315
|
}
|
5482
|
-
return /* @__PURE__ */
|
5316
|
+
return /* @__PURE__ */ React57.createElement(Fragment10, null, /* @__PURE__ */ React57.createElement(Flex, { css: { w: "100%", py: "$8" } }, /* @__PURE__ */ React57.createElement(
|
5483
5317
|
Box,
|
5484
5318
|
{
|
5485
5319
|
css: {
|
@@ -5489,8 +5323,8 @@ var StreamingLanding = () => {
|
|
5489
5323
|
r: "$round"
|
5490
5324
|
}
|
5491
5325
|
},
|
5492
|
-
/* @__PURE__ */
|
5493
|
-
), /* @__PURE__ */
|
5326
|
+
/* @__PURE__ */ React57.createElement(ColoredHandIcon, { width: 40, height: 40 })
|
5327
|
+
), /* @__PURE__ */ React57.createElement(Box, { css: { flex: "1 1 0", mx: "$8" } }, /* @__PURE__ */ React57.createElement(Text, { variant: "sm" }, "Welcome !"), /* @__PURE__ */ React57.createElement(Text, { variant: "h6" }, "Let\u2019s get you started")), /* @__PURE__ */ React57.createElement(IconButton_default, { onClick: toggleStreaming, css: { alignSelf: "flex-start" }, "data-testid": "close_streaming" }, /* @__PURE__ */ React57.createElement(CrossIcon8, null))), /* @__PURE__ */ React57.createElement(Text, { variant: "tiny", color: "$on_surface_medium" }, "Start Streaming"), (permissions == null ? void 0 : permissions.hlsStreaming) && /* @__PURE__ */ React57.createElement(
|
5494
5328
|
StreamCard,
|
5495
5329
|
{
|
5496
5330
|
testId: "hls_stream",
|
@@ -5500,7 +5334,7 @@ var StreamingLanding = () => {
|
|
5500
5334
|
onClick: () => setShowHLS(true),
|
5501
5335
|
Icon: GoLiveIcon3
|
5502
5336
|
}
|
5503
|
-
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */
|
5337
|
+
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */ React57.createElement(
|
5504
5338
|
StreamCard,
|
5505
5339
|
{
|
5506
5340
|
testId: "rtmp_stream",
|
@@ -5512,29 +5346,39 @@ var StreamingLanding = () => {
|
|
5512
5346
|
},
|
5513
5347
|
imgSrc: rtmp_default
|
5514
5348
|
}
|
5515
|
-
), showHLS && /* @__PURE__ */
|
5349
|
+
), showHLS && /* @__PURE__ */ React57.createElement(HLSStreaming, { onBack: () => setShowHLS(false) }), showRTMP && /* @__PURE__ */ React57.createElement(RTMPStreaming, { onBack: () => setShowRTMP(false) }));
|
5516
5350
|
};
|
5517
5351
|
|
5518
5352
|
// src/Prebuilt/layouts/SidePane.tsx
|
5519
|
-
var SidePane = ({
|
5520
|
-
|
5521
|
-
|
5353
|
+
var SidePane = ({
|
5354
|
+
screenType,
|
5355
|
+
tileProps,
|
5356
|
+
hideControls = false
|
5357
|
+
}) => {
|
5358
|
+
var _a, _b;
|
5359
|
+
const isMobile = useMedia14(config.media.md);
|
5522
5360
|
const sidepane = useHMSStore33(selectAppData3(APP_DATA.sidePane));
|
5523
5361
|
const activeScreensharePeerId = useHMSStore33(selectAppData3(APP_DATA.activeScreensharePeerId));
|
5524
5362
|
const trackId = (_a = useHMSStore33(selectVideoTrackByPeerID(activeScreensharePeerId))) == null ? void 0 : _a.id;
|
5363
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
5525
5364
|
let ViewComponent;
|
5526
|
-
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
5527
|
-
ViewComponent = /* @__PURE__ */
|
5528
|
-
} else if (sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
5529
|
-
ViewComponent = /* @__PURE__ */ React57.createElement(Chat, { screenType });
|
5365
|
+
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS || sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
5366
|
+
ViewComponent = /* @__PURE__ */ React58.createElement(SidePaneTabs, { screenType, hideControls, active: sidepane });
|
5530
5367
|
} else if (sidepane === SIDE_PANE_OPTIONS.STREAMING) {
|
5531
|
-
ViewComponent = /* @__PURE__ */
|
5368
|
+
ViewComponent = /* @__PURE__ */ React58.createElement(StreamingLanding, null);
|
5532
5369
|
}
|
5533
5370
|
if (!ViewComponent && !trackId) {
|
5534
5371
|
return null;
|
5535
5372
|
}
|
5536
|
-
const
|
5537
|
-
|
5373
|
+
const tileLayout = {
|
5374
|
+
hideParticipantNameOnTile: tileProps == null ? void 0 : tileProps.hide_participant_name_on_tile,
|
5375
|
+
roundedVideoTile: tileProps == null ? void 0 : tileProps.rounded_video_tile,
|
5376
|
+
hideAudioMuteOnTile: tileProps == null ? void 0 : tileProps.hide_audio_mute_on_tile,
|
5377
|
+
hideMetadataOnTile: tileProps == null ? void 0 : tileProps.hide_metadata_on_tile,
|
5378
|
+
objectFit: tileProps == null ? void 0 : tileProps.video_object_fit
|
5379
|
+
};
|
5380
|
+
const mwebStreamingChat = isMobile && sidepane === SIDE_PANE_OPTIONS.CHAT && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.is_overlay);
|
5381
|
+
return /* @__PURE__ */ React58.createElement(
|
5538
5382
|
Flex,
|
5539
5383
|
{
|
5540
5384
|
direction: "column",
|
@@ -5547,18 +5391,17 @@ var SidePane = ({ screenType }) => {
|
|
5547
5391
|
"@md": { position: mwebStreamingChat ? "absolute" : "", zIndex: 12 }
|
5548
5392
|
}
|
5549
5393
|
},
|
5550
|
-
trackId && /* @__PURE__ */
|
5394
|
+
trackId && /* @__PURE__ */ React58.createElement(
|
5551
5395
|
VideoTile_default,
|
5552
|
-
{
|
5396
|
+
__spreadValues({
|
5553
5397
|
peerId: activeScreensharePeerId,
|
5554
5398
|
trackId,
|
5555
5399
|
width: "100%",
|
5556
5400
|
height: 225,
|
5557
|
-
rootCSS: { p: 0, alignSelf: "start", flexShrink: 0 }
|
5558
|
-
|
5559
|
-
}
|
5401
|
+
rootCSS: { p: 0, alignSelf: "start", flexShrink: 0 }
|
5402
|
+
}, tileLayout)
|
5560
5403
|
),
|
5561
|
-
!!ViewComponent && /* @__PURE__ */
|
5404
|
+
!!ViewComponent && /* @__PURE__ */ React58.createElement(
|
5562
5405
|
Box,
|
5563
5406
|
{
|
5564
5407
|
css: {
|
@@ -5594,10 +5437,10 @@ var SidePane = ({ screenType }) => {
|
|
5594
5437
|
var SidePane_default = SidePane;
|
5595
5438
|
|
5596
5439
|
// src/Prebuilt/layouts/WaitingView.jsx
|
5597
|
-
import
|
5440
|
+
import React59 from "react";
|
5598
5441
|
import { ColoredTimeIcon } from "@100mslive/react-icons";
|
5599
|
-
var WaitingView =
|
5600
|
-
return /* @__PURE__ */
|
5442
|
+
var WaitingView = React59.memo(() => {
|
5443
|
+
return /* @__PURE__ */ React59.createElement(
|
5601
5444
|
Box,
|
5602
5445
|
{
|
5603
5446
|
css: {
|
@@ -5611,7 +5454,7 @@ var WaitingView = React58.memo(() => {
|
|
5611
5454
|
},
|
5612
5455
|
"data-testid": "waiting_view"
|
5613
5456
|
},
|
5614
|
-
/* @__PURE__ */
|
5457
|
+
/* @__PURE__ */ React59.createElement(
|
5615
5458
|
Flex,
|
5616
5459
|
{
|
5617
5460
|
align: "center",
|
@@ -5625,8 +5468,8 @@ var WaitingView = React58.memo(() => {
|
|
5625
5468
|
gap: "$8"
|
5626
5469
|
}
|
5627
5470
|
},
|
5628
|
-
/* @__PURE__ */
|
5629
|
-
/* @__PURE__ */
|
5471
|
+
/* @__PURE__ */ React59.createElement(ColoredTimeIcon, { width: "80px", height: "80px" }),
|
5472
|
+
/* @__PURE__ */ React59.createElement(
|
5630
5473
|
Flex,
|
5631
5474
|
{
|
5632
5475
|
direction: "column",
|
@@ -5636,54 +5479,28 @@ var WaitingView = React58.memo(() => {
|
|
5636
5479
|
gap: "$4"
|
5637
5480
|
}
|
5638
5481
|
},
|
5639
|
-
/* @__PURE__ */
|
5640
|
-
/* @__PURE__ */
|
5482
|
+
/* @__PURE__ */ React59.createElement(Text, { color: "white", variant: "h6", css: { "@md": { fontSize: "$md" } } }, "Please wait"),
|
5483
|
+
/* @__PURE__ */ React59.createElement(Text, { color: "$on_surface_medium", css: { mt: "$4", "@md": { fontSize: "$sm" } } }, "Sit back and relax till others let you join.")
|
5641
5484
|
)
|
5642
5485
|
)
|
5643
5486
|
);
|
5644
5487
|
});
|
5645
5488
|
|
5646
5489
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
5647
|
-
var HLSView =
|
5490
|
+
var HLSView = React60.lazy(() => import("./HLSView-QMU5JK7U.js"));
|
5648
5491
|
var VideoStreamingSection = ({
|
5649
5492
|
screenType,
|
5650
|
-
elements
|
5493
|
+
elements,
|
5494
|
+
hideControls = false
|
5651
5495
|
}) => {
|
5652
|
-
var _a;
|
5653
|
-
const localPeerRole = useHMSStore34(
|
5654
|
-
const isConnected = useHMSStore34(
|
5655
|
-
const hmsActions =
|
5496
|
+
var _a, _b;
|
5497
|
+
const localPeerRole = useHMSStore34(selectLocalPeerRoleName2);
|
5498
|
+
const isConnected = useHMSStore34(selectIsConnectedToRoom6);
|
5499
|
+
const hmsActions = useHMSActions20();
|
5656
5500
|
const waitingViewerRole = useWaitingViewerRole();
|
5657
5501
|
const urlToIframe = useUrlToEmbed();
|
5658
5502
|
const pdfAnnotatorActive = usePDFAnnotator();
|
5659
|
-
|
5660
|
-
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5661
|
-
const permissions = useHMSStore34(selectPermissions11);
|
5662
|
-
const showStreamingUI = useShowStreamingUI();
|
5663
|
-
const startHLS = useCallback17(() => __async(void 0, null, function* () {
|
5664
|
-
var _a2;
|
5665
|
-
try {
|
5666
|
-
if (isHLSStarted) {
|
5667
|
-
return;
|
5668
|
-
}
|
5669
|
-
setHLSStarted(true);
|
5670
|
-
yield hmsActions.startHLSStreaming();
|
5671
|
-
} catch (error) {
|
5672
|
-
if ((_a2 = error.message) == null ? void 0 : _a2.includes("beam already started")) {
|
5673
|
-
return;
|
5674
|
-
}
|
5675
|
-
setHLSStarted(false);
|
5676
|
-
}
|
5677
|
-
}), [hmsActions, isHLSStarted, setHLSStarted]);
|
5678
|
-
useEffect22(() => {
|
5679
|
-
if (!isConnected) {
|
5680
|
-
return;
|
5681
|
-
}
|
5682
|
-
if ((permissions == null ? void 0 : permissions.hlsStreaming) && !isHLSRunning && showStreamingUI) {
|
5683
|
-
startHLS();
|
5684
|
-
}
|
5685
|
-
}, [isConnected]);
|
5686
|
-
useEffect22(() => {
|
5503
|
+
useEffect23(() => {
|
5687
5504
|
if (!isConnected) {
|
5688
5505
|
return;
|
5689
5506
|
}
|
@@ -5694,17 +5511,17 @@ var VideoStreamingSection = ({
|
|
5694
5511
|
}
|
5695
5512
|
let ViewComponent;
|
5696
5513
|
if (screenType === "hls_live_streaming") {
|
5697
|
-
ViewComponent = /* @__PURE__ */
|
5514
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(HLSView, null);
|
5698
5515
|
} else if (localPeerRole === waitingViewerRole) {
|
5699
|
-
ViewComponent = /* @__PURE__ */
|
5516
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(WaitingView, null);
|
5700
5517
|
} else if (pdfAnnotatorActive) {
|
5701
|
-
ViewComponent = /* @__PURE__ */
|
5518
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(PDFView, null);
|
5702
5519
|
} else if (urlToIframe) {
|
5703
|
-
ViewComponent = /* @__PURE__ */
|
5520
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(EmbedView, null);
|
5704
5521
|
} else {
|
5705
|
-
ViewComponent = /* @__PURE__ */
|
5522
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(GridLayout, __spreadValues({}, (_a = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a.grid));
|
5706
5523
|
}
|
5707
|
-
return /* @__PURE__ */
|
5524
|
+
return /* @__PURE__ */ React60.createElement(Suspense2, { fallback: /* @__PURE__ */ React60.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React60.createElement(
|
5708
5525
|
Flex,
|
5709
5526
|
{
|
5710
5527
|
css: {
|
@@ -5714,36 +5531,47 @@ var VideoStreamingSection = ({
|
|
5714
5531
|
}
|
5715
5532
|
},
|
5716
5533
|
ViewComponent,
|
5717
|
-
/* @__PURE__ */
|
5534
|
+
/* @__PURE__ */ React60.createElement(
|
5535
|
+
SidePane_default,
|
5536
|
+
{
|
5537
|
+
screenType,
|
5538
|
+
tileProps: (_b = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _b.grid,
|
5539
|
+
hideControls
|
5540
|
+
}
|
5541
|
+
)
|
5718
5542
|
));
|
5719
5543
|
};
|
5720
5544
|
|
5721
|
-
// src/Prebuilt/components/RoleChangeRequestModal.
|
5722
|
-
import
|
5545
|
+
// src/Prebuilt/components/RoleChangeRequestModal.tsx
|
5546
|
+
import React61, { useEffect as useEffect24 } from "react";
|
5723
5547
|
import {
|
5724
5548
|
selectLocalPeerName,
|
5725
|
-
selectLocalPeerRoleName as
|
5549
|
+
selectLocalPeerRoleName as selectLocalPeerRoleName3,
|
5726
5550
|
selectRoleChangeRequest,
|
5727
|
-
|
5551
|
+
useCustomEvent as useCustomEvent2,
|
5552
|
+
useHMSActions as useHMSActions21,
|
5728
5553
|
useHMSStore as useHMSStore35
|
5729
5554
|
} from "@100mslive/react-sdk";
|
5730
5555
|
var RoleChangeRequestModal = () => {
|
5731
|
-
const hmsActions =
|
5732
|
-
const
|
5733
|
-
const
|
5734
|
-
const currentRole = useHMSStore35(selectLocalPeerRoleName4);
|
5556
|
+
const hmsActions = useHMSActions21();
|
5557
|
+
const { updateMetaData } = useMyMetadata();
|
5558
|
+
const currentRole = useHMSStore35(selectLocalPeerRoleName3);
|
5735
5559
|
const roleChangeRequest = useHMSStore35(selectRoleChangeRequest);
|
5736
5560
|
const name = useHMSStore35(selectLocalPeerName);
|
5737
|
-
|
5738
|
-
|
5561
|
+
const { sendEvent } = useCustomEvent2({ type: ROLE_CHANGE_DECLINED });
|
5562
|
+
useEffect24(() => {
|
5563
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5739
5564
|
return;
|
5740
5565
|
}
|
5741
|
-
|
5742
|
-
|
5743
|
-
|
5566
|
+
(() => __async(void 0, null, function* () {
|
5567
|
+
yield updateMetaData({ prevRole: currentRole });
|
5568
|
+
yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
5569
|
+
}))();
|
5570
|
+
}, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
|
5571
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5744
5572
|
return null;
|
5745
5573
|
}
|
5746
|
-
const body = /* @__PURE__ */
|
5574
|
+
const body = /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(Text, { css: { fontWeight: 400, c: "$on_surface_medium", textAlign: "center" } }, "Setup your audio and video before joining"), /* @__PURE__ */ React61.createElement(
|
5747
5575
|
Flex,
|
5748
5576
|
{
|
5749
5577
|
align: "center",
|
@@ -5754,10 +5582,10 @@ var RoleChangeRequestModal = () => {
|
|
5754
5582
|
mt: "$6"
|
5755
5583
|
}
|
5756
5584
|
},
|
5757
|
-
/* @__PURE__ */
|
5758
|
-
/* @__PURE__ */
|
5585
|
+
/* @__PURE__ */ React61.createElement(PreviewTile, { name: name || "" }),
|
5586
|
+
/* @__PURE__ */ React61.createElement(PreviewControls, { hideSettings: true })
|
5759
5587
|
));
|
5760
|
-
return /* @__PURE__ */
|
5588
|
+
return /* @__PURE__ */ React61.createElement(
|
5761
5589
|
RequestDialog,
|
5762
5590
|
{
|
5763
5591
|
title: `You're invited to join the ${roleChangeRequest.role.name} role`,
|
@@ -5765,64 +5593,71 @@ var RoleChangeRequestModal = () => {
|
|
5765
5593
|
var _a;
|
5766
5594
|
if (!value) {
|
5767
5595
|
yield hmsActions.rejectChangeRole(roleChangeRequest);
|
5768
|
-
|
5596
|
+
sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
|
5769
5597
|
yield hmsActions.cancelMidCallPreview();
|
5598
|
+
yield updateMetaData({ isHandRaised: false });
|
5770
5599
|
}
|
5771
5600
|
}),
|
5772
5601
|
body,
|
5773
|
-
onAction: () => {
|
5774
|
-
hmsActions.acceptChangeRole(roleChangeRequest);
|
5775
|
-
|
5776
|
-
},
|
5602
|
+
onAction: () => __async(void 0, null, function* () {
|
5603
|
+
yield hmsActions.acceptChangeRole(roleChangeRequest);
|
5604
|
+
yield updateMetaData({ isHandRaised: false });
|
5605
|
+
}),
|
5777
5606
|
actionText: "Accept"
|
5778
5607
|
}
|
5779
5608
|
);
|
5780
5609
|
};
|
5781
|
-
var RequestDialog = ({
|
5610
|
+
var RequestDialog = ({
|
5611
|
+
open = true,
|
5612
|
+
onOpenChange,
|
5613
|
+
title,
|
5614
|
+
body,
|
5615
|
+
actionText = "Accept",
|
5616
|
+
onAction
|
5617
|
+
}) => /* @__PURE__ */ React61.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React61.createElement(Dialog.Portal, null, /* @__PURE__ */ React61.createElement(Dialog.Overlay, null), /* @__PURE__ */ React61.createElement(Dialog.Content, { css: { p: "$10" } }, /* @__PURE__ */ React61.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md", justifyContent: "center" } }, /* @__PURE__ */ React61.createElement(Text, { variant: "h6" }, title)), /* @__PURE__ */ React61.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React61.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md" } }, /* @__PURE__ */ React61.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React61.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React61.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Cancel"))), /* @__PURE__ */ React61.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React61.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText))))));
|
5782
5618
|
|
5783
5619
|
// src/Prebuilt/components/conference.jsx
|
5784
5620
|
var Conference = () => {
|
5785
|
-
var _a, _b;
|
5786
|
-
const navigate =
|
5787
|
-
const { roomId, role } =
|
5788
|
-
const
|
5789
|
-
const { userName } = useHMSPrebuiltContext();
|
5621
|
+
var _a, _b, _c, _d, _e;
|
5622
|
+
const navigate = useNavigate();
|
5623
|
+
const { roomId, role } = useParams();
|
5624
|
+
const { userName, endpoints } = useHMSPrebuiltContext();
|
5790
5625
|
const screenProps = useRoomLayoutConferencingScreen();
|
5791
5626
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
5792
5627
|
const roomState = useHMSStore36(selectRoomState);
|
5793
5628
|
const prevState = usePrevious(roomState);
|
5794
|
-
const isConnectedToRoom = useHMSStore36(
|
5795
|
-
const hmsActions =
|
5629
|
+
const isConnectedToRoom = useHMSStore36(selectIsConnectedToRoom7);
|
5630
|
+
const hmsActions = useHMSActions22();
|
5796
5631
|
const [hideControls, setHideControls] = useState35(false);
|
5797
5632
|
const dropdownList = useHMSStore36(selectAppData4(APP_DATA.dropdownList));
|
5798
5633
|
const authTokenInAppData = useAuthToken();
|
5799
|
-
const headerRef =
|
5800
|
-
const footerRef =
|
5801
|
-
const
|
5802
|
-
const
|
5634
|
+
const headerRef = useRef14();
|
5635
|
+
const footerRef = useRef14();
|
5636
|
+
const isMobileDevice = isAndroid || isIOS || isIPadOS;
|
5637
|
+
const dropdownListRef = useRef14();
|
5803
5638
|
const [isHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5804
5639
|
const toggleControls = () => {
|
5805
5640
|
var _a2;
|
5806
|
-
if (((_a2 = dropdownListRef.current) == null ? void 0 : _a2.length) === 0) {
|
5641
|
+
if (((_a2 = dropdownListRef.current) == null ? void 0 : _a2.length) === 0 && isMobileDevice) {
|
5807
5642
|
setHideControls((value) => !value);
|
5808
5643
|
}
|
5809
5644
|
};
|
5810
|
-
|
5645
|
+
useEffect25(() => {
|
5811
5646
|
let timeout = null;
|
5812
5647
|
dropdownListRef.current = dropdownList || [];
|
5813
5648
|
if (dropdownListRef.current.length === 0) {
|
5814
5649
|
clearTimeout(timeout);
|
5815
5650
|
timeout = setTimeout(() => {
|
5816
5651
|
if (dropdownListRef.current.length === 0) {
|
5817
|
-
setHideControls(
|
5652
|
+
setHideControls(isMobileDevice);
|
5818
5653
|
}
|
5819
5654
|
}, 5e3);
|
5820
5655
|
}
|
5821
5656
|
return () => {
|
5822
5657
|
clearTimeout(timeout);
|
5823
5658
|
};
|
5824
|
-
}, [dropdownList, hideControls]);
|
5825
|
-
|
5659
|
+
}, [dropdownList, hideControls, isMobileDevice]);
|
5660
|
+
useEffect25(() => {
|
5826
5661
|
if (!roomId) {
|
5827
5662
|
navigate(`/`);
|
5828
5663
|
return;
|
@@ -5837,12 +5672,12 @@ var Conference = () => {
|
|
5837
5672
|
navigate(`/preview/${roomId || ""}`);
|
5838
5673
|
}
|
5839
5674
|
}, [isConnectedToRoom, prevState, roomState, navigate, role, roomId, isPreviewScreenEnabled]);
|
5840
|
-
|
5675
|
+
useEffect25(() => {
|
5841
5676
|
if (authTokenInAppData && !isConnectedToRoom && !isPreviewScreenEnabled && roomState !== HMSRoomState.Connecting) {
|
5842
5677
|
hmsActions.join({
|
5843
5678
|
userName,
|
5844
5679
|
authToken: authTokenInAppData,
|
5845
|
-
initEndpoint:
|
5680
|
+
initEndpoint: endpoints == null ? void 0 : endpoints.init,
|
5846
5681
|
initialSettings: {
|
5847
5682
|
isAudioMuted: !isPreviewScreenEnabled,
|
5848
5683
|
isVideoMuted: !isPreviewScreenEnabled,
|
@@ -5850,57 +5685,57 @@ var Conference = () => {
|
|
5850
5685
|
}
|
5851
5686
|
}).catch(console.error);
|
5852
5687
|
}
|
5853
|
-
}, [authTokenInAppData, hmsActions, isConnectedToRoom, isPreviewScreenEnabled, roomState, userName]);
|
5854
|
-
|
5855
|
-
if (isHeadless) {
|
5856
|
-
hmsActions.ignoreMessageTypes(["chat", EMOJI_REACTION_TYPE]);
|
5857
|
-
}
|
5858
|
-
}, [isHeadless, hmsActions]);
|
5859
|
-
useEffect24(() => {
|
5688
|
+
}, [authTokenInAppData, endpoints == null ? void 0 : endpoints.init, hmsActions, isConnectedToRoom, isPreviewScreenEnabled, roomState, userName]);
|
5689
|
+
useEffect25(() => {
|
5860
5690
|
return () => {
|
5861
5691
|
PictureInPicture.stop().catch((error) => console.error("stopping pip", error));
|
5862
5692
|
};
|
5863
5693
|
}, []);
|
5864
5694
|
if (!isConnectedToRoom) {
|
5865
|
-
return /* @__PURE__ */
|
5695
|
+
return /* @__PURE__ */ React62.createElement(FullPageProgress_default, { text: "Joining..." });
|
5866
5696
|
}
|
5867
|
-
|
5868
|
-
return /* @__PURE__ */ React61.createElement(FullPageProgress_default, { loadingText: "Starting live stream..." });
|
5869
|
-
}
|
5870
|
-
return /* @__PURE__ */ React61.createElement(Flex, { css: { size: "100%", overflow: "hidden" }, direction: "column" }, !screenProps.hideSections.includes("header") && /* @__PURE__ */ React61.createElement(
|
5697
|
+
return /* @__PURE__ */ React62.createElement(React62.Fragment, null, isHLSStarted ? /* @__PURE__ */ React62.createElement(Box, { css: { position: "fixed", zIndex: 100, w: "100%", h: "100%", left: 0, top: 0 } }, /* @__PURE__ */ React62.createElement(FullPageProgress_default, { text: "Starting live stream...", css: { opacity: 0.8, bg: "$background_dim" } })) : null, /* @__PURE__ */ React62.createElement(Flex, { css: { size: "100%", overflow: "hidden" }, direction: "column" }, !screenProps.hideSections.includes("header") && /* @__PURE__ */ React62.createElement(
|
5871
5698
|
Box,
|
5872
5699
|
{
|
5873
5700
|
ref: headerRef,
|
5874
5701
|
css: {
|
5875
5702
|
h: "$18",
|
5876
5703
|
transition: "margin 0.3s ease-in-out",
|
5877
|
-
marginTop:
|
5704
|
+
marginTop: hideControls ? `-${(_a = headerRef.current) == null ? void 0 : _a.clientHeight}px` : "none",
|
5878
5705
|
"@md": {
|
5879
5706
|
h: "$17"
|
5880
5707
|
}
|
5881
5708
|
},
|
5882
5709
|
"data-testid": "header"
|
5883
5710
|
},
|
5884
|
-
/* @__PURE__ */
|
5885
|
-
), /* @__PURE__ */
|
5711
|
+
/* @__PURE__ */ React62.createElement(Header, { elements: screenProps.elements, screenType: screenProps.screenType })
|
5712
|
+
), /* @__PURE__ */ React62.createElement(
|
5886
5713
|
Box,
|
5887
5714
|
{
|
5888
5715
|
css: {
|
5889
5716
|
w: "100%",
|
5890
5717
|
flex: "1 1 0",
|
5891
5718
|
minHeight: 0,
|
5892
|
-
px: "$10",
|
5719
|
+
px: ((_d = (_c = (_b = screenProps == null ? void 0 : screenProps.elements) == null ? void 0 : _b.video_tile_layout) == null ? void 0 : _c.grid) == null ? void 0 : _d.edge_to_edge) ? 0 : "$10",
|
5720
|
+
// TODO: padding to be controlled by section/element
|
5893
5721
|
paddingBottom: "env(safe-area-inset-bottom)",
|
5894
5722
|
"@lg": {
|
5895
|
-
px:
|
5723
|
+
px: 0
|
5896
5724
|
}
|
5897
5725
|
},
|
5898
5726
|
id: "conferencing",
|
5899
5727
|
"data-testid": "conferencing",
|
5900
5728
|
onClick: toggleControls
|
5901
5729
|
},
|
5902
|
-
/* @__PURE__ */
|
5903
|
-
|
5730
|
+
/* @__PURE__ */ React62.createElement(
|
5731
|
+
VideoStreamingSection,
|
5732
|
+
{
|
5733
|
+
screenType: screenProps.screenType,
|
5734
|
+
elements: screenProps.elements,
|
5735
|
+
hideControls
|
5736
|
+
}
|
5737
|
+
)
|
5738
|
+
), !screenProps.hideSections.includes("footer") && /* @__PURE__ */ React62.createElement(
|
5904
5739
|
Box,
|
5905
5740
|
{
|
5906
5741
|
ref: footerRef,
|
@@ -5909,7 +5744,7 @@ var Conference = () => {
|
|
5909
5744
|
maxHeight: "$24",
|
5910
5745
|
transition: "margin 0.3s ease-in-out",
|
5911
5746
|
bg: "$background_dim",
|
5912
|
-
marginBottom:
|
5747
|
+
marginBottom: hideControls ? `-${(_e = footerRef.current) == null ? void 0 : _e.clientHeight}px` : void 0,
|
5913
5748
|
"@md": {
|
5914
5749
|
maxHeight: "unset",
|
5915
5750
|
bg: screenProps.screenType === "hls_live_streaming" ? "transparent" : "$background_dim"
|
@@ -5917,11 +5752,11 @@ var Conference = () => {
|
|
5917
5752
|
},
|
5918
5753
|
"data-testid": "footer"
|
5919
5754
|
},
|
5920
|
-
/* @__PURE__ */
|
5921
|
-
), /* @__PURE__ */
|
5755
|
+
/* @__PURE__ */ React62.createElement(Footer2, { elements: screenProps.elements, screenType: screenProps.screenType })
|
5756
|
+
), /* @__PURE__ */ React62.createElement(RoleChangeRequestModal, null), /* @__PURE__ */ React62.createElement(HLSFailureModal, null), /* @__PURE__ */ React62.createElement(ActivatedPIP, null)));
|
5922
5757
|
};
|
5923
5758
|
var conference_default = Conference;
|
5924
5759
|
export {
|
5925
5760
|
conference_default as default
|
5926
5761
|
};
|
5927
|
-
//# sourceMappingURL=conference-
|
5762
|
+
//# sourceMappingURL=conference-FJJQ4TXX.js.map
|