@100mslive/roomkit-react 0.1.6-alpha.0 → 0.1.6-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-PY2FKWX3.js → HLSView-HNVYG5VE.js} +208 -118
- package/dist/HLSView-HNVYG5VE.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 +4 -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/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-UM2FOUHQ.js} +3 -3
- package/dist/{chunk-E2M2ZSOL.js → chunk-364HP22I.js} +2 -2
- package/dist/{chunk-RXTHJUMZ.js → chunk-LYSAET4G.js} +946 -390
- package/dist/chunk-LYSAET4G.js.map +7 -0
- package/dist/{chunk-GQD2AGWW.js → chunk-POE7H4IE.js} +12 -2
- package/dist/{chunk-GQD2AGWW.js.map → chunk-POE7H4IE.js.map} +2 -2
- package/dist/{conference-V2XZGTKU.js → conference-UWLJHMB2.js} +1116 -1316
- package/dist/conference-UWLJHMB2.js.map +7 -0
- package/dist/index.cjs.js +6080 -5631
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +741 -493
- package/dist/meta.esbuild.json +782 -529
- 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 +23 -6
- 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/ChatParticipantHeader.jsx +38 -27
- 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} +13 -3
- package/src/Prebuilt/components/Footer/Footer.tsx +15 -6
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +15 -47
- 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/{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 +14 -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} +88 -27
- package/src/Prebuilt/components/Notifications/Notifications.jsx +30 -21
- 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} +43 -19
- package/src/Prebuilt/components/{RoleChangeRequestModal.jsx → RoleChangeRequestModal.tsx} +32 -15
- package/src/Prebuilt/components/ScreenshareTile.jsx +6 -7
- package/src/Prebuilt/components/SecondaryTiles.tsx +12 -10
- 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 +12 -3
- 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 +15 -3
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +11 -47
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -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/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/VideoList.jsx +0 -73
- /package/dist/{VirtualBackground-AYDHYLIZ.js.map → VirtualBackground-UM2FOUHQ.js.map} +0 -0
- /package/dist/{chunk-E2M2ZSOL.js.map → chunk-364HP22I.js.map} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
ActionTile
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-364HP22I.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,20 +60,19 @@ 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,
|
@@ -82,7 +83,7 @@ import {
|
|
82
83
|
useUrlToEmbed,
|
83
84
|
useUserPreferences,
|
84
85
|
useWaitingViewerRole
|
85
|
-
} from "./chunk-
|
86
|
+
} from "./chunk-LYSAET4G.js";
|
86
87
|
import {
|
87
88
|
Box,
|
88
89
|
Flex,
|
@@ -101,27 +102,29 @@ import {
|
|
101
102
|
slideLeftAndFade,
|
102
103
|
styled,
|
103
104
|
textEllipsis
|
104
|
-
} from "./chunk-
|
105
|
+
} from "./chunk-POE7H4IE.js";
|
105
106
|
|
106
107
|
// src/Prebuilt/components/conference.jsx
|
107
|
-
import
|
108
|
-
import { useNavigate
|
108
|
+
import React62, { useEffect as useEffect24, useRef as useRef14, useState as useState35 } from "react";
|
109
|
+
import { useNavigate, useParams } from "react-router-dom";
|
109
110
|
import { usePrevious } from "react-use";
|
110
111
|
import {
|
111
112
|
HMSRoomState,
|
112
113
|
selectAppData as selectAppData4,
|
113
|
-
selectIsConnectedToRoom as
|
114
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom7,
|
114
115
|
selectRoomState,
|
115
|
-
useHMSActions as
|
116
|
-
useHMSStore as
|
116
|
+
useHMSActions as useHMSActions22,
|
117
|
+
useHMSStore as useHMSStore37
|
117
118
|
} from "@100mslive/react-sdk";
|
118
119
|
|
119
120
|
// src/Prebuilt/components/Footer/Footer.tsx
|
120
|
-
import
|
121
|
+
import React37, { Suspense } from "react";
|
121
122
|
import { useMedia as useMedia5 } from "react-use";
|
123
|
+
import { Chat_ChatState } from "@100mslive/types-prebuilt/elements/chat";
|
124
|
+
import { selectIsLocalVideoEnabled as selectIsLocalVideoEnabled2, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
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
|
});
|
@@ -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,43 +2643,48 @@ var ScreenshareToggle = ({ css = {} }) => {
|
|
3018
2643
|
), /* @__PURE__ */ React31.createElement(ShareScreenOptions, null)));
|
3019
2644
|
};
|
3020
2645
|
|
3021
|
-
// src/Prebuilt/components/Footer/ChatToggle.
|
3022
|
-
import React32 from "react";
|
3023
|
-
import { selectUnreadHMSMessagesCount, useHMSStore as
|
2646
|
+
// src/Prebuilt/components/Footer/ChatToggle.tsx
|
2647
|
+
import React32, { useEffect as useEffect5 } from "react";
|
2648
|
+
import { selectUnreadHMSMessagesCount, useHMSStore as useHMSStore14 } from "@100mslive/react-sdk";
|
3024
2649
|
import { ChatIcon, ChatUnreadIcon } from "@100mslive/react-icons";
|
3025
|
-
var ChatToggle = () => {
|
3026
|
-
const countUnreadMessages =
|
2650
|
+
var ChatToggle = ({ openByDefault }) => {
|
2651
|
+
const countUnreadMessages = useHMSStore14(selectUnreadHMSMessagesCount);
|
3027
2652
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3028
2653
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
2654
|
+
useEffect5(() => {
|
2655
|
+
if (!isChatOpen && openByDefault) {
|
2656
|
+
toggleChat();
|
2657
|
+
}
|
2658
|
+
}, [toggleChat, openByDefault]);
|
3029
2659
|
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
2660
|
};
|
3031
2661
|
|
3032
2662
|
// src/Prebuilt/components/Footer/ParticipantList.jsx
|
3033
|
-
import
|
2663
|
+
import React36, { Fragment as Fragment7, useCallback as useCallback6, useEffect as useEffect6, useState as useState19 } from "react";
|
3034
2664
|
import { useDebounce, useMedia as useMedia4 } from "react-use";
|
3035
2665
|
import {
|
3036
2666
|
selectIsPeerAudioEnabled,
|
3037
2667
|
selectLocalPeerID as selectLocalPeerID4,
|
3038
|
-
selectPeerCount as
|
3039
|
-
selectPeerMetadata as
|
3040
|
-
selectPeersByCondition,
|
3041
|
-
selectPermissions as
|
3042
|
-
useHMSActions as
|
2668
|
+
selectPeerCount as selectPeerCount3,
|
2669
|
+
selectPeerMetadata as selectPeerMetadata2,
|
2670
|
+
selectPeersByCondition as selectPeersByCondition2,
|
2671
|
+
selectPermissions as selectPermissions8,
|
2672
|
+
useHMSActions as useHMSActions11,
|
3043
2673
|
useHMSStore as useHMSStore17
|
3044
2674
|
} from "@100mslive/react-sdk";
|
3045
2675
|
import {
|
3046
2676
|
ChangeRoleIcon as ChangeRoleIcon2,
|
3047
2677
|
HandIcon as HandIcon3,
|
3048
|
-
MicOffIcon as
|
2678
|
+
MicOffIcon as MicOffIcon3,
|
3049
2679
|
PeopleIcon as PeopleIcon2,
|
3050
2680
|
PeopleRemoveIcon,
|
3051
2681
|
SearchIcon,
|
3052
|
-
VerticalMenuIcon as
|
2682
|
+
VerticalMenuIcon as VerticalMenuIcon4
|
3053
2683
|
} from "@100mslive/react-icons";
|
3054
2684
|
|
3055
2685
|
// src/Prebuilt/components/Chat/ChatParticipantHeader.jsx
|
3056
|
-
import React33, { useState as
|
3057
|
-
import { selectPeerCount as
|
2686
|
+
import React33, { useState as useState17 } from "react";
|
2687
|
+
import { selectPeerCount as selectPeerCount2, useHMSStore as useHMSStore15 } from "@100mslive/react-sdk";
|
3058
2688
|
import { CrossIcon as CrossIcon5 } from "@100mslive/react-icons";
|
3059
2689
|
var tabTriggerCSS = {
|
3060
2690
|
color: "$on_surface_high",
|
@@ -3067,8 +2697,12 @@ var tabTriggerCSS = {
|
|
3067
2697
|
var ChatParticipantHeader = React33.memo(({ activeTabValue = SIDE_PANE_OPTIONS.CHAT }) => {
|
3068
2698
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3069
2699
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
3070
|
-
const [activeTab, setActiveTab] =
|
3071
|
-
const peerCount =
|
2700
|
+
const [activeTab, setActiveTab] = useState17(activeTabValue);
|
2701
|
+
const peerCount = useHMSStore15(selectPeerCount2);
|
2702
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
2703
|
+
const showChat = !!(elements == null ? void 0 : elements.chat);
|
2704
|
+
const showParticipants = !!(elements == null ? void 0 : elements.participant_list);
|
2705
|
+
const hideTabs = !(showChat && showParticipants);
|
3072
2706
|
return /* @__PURE__ */ React33.createElement(
|
3073
2707
|
Flex,
|
3074
2708
|
{
|
@@ -3078,7 +2712,7 @@ var ChatParticipantHeader = React33.memo(({ activeTabValue = SIDE_PANE_OPTIONS.C
|
|
3078
2712
|
h: "$16"
|
3079
2713
|
}
|
3080
2714
|
},
|
3081
|
-
/* @__PURE__ */ React33.createElement(Flex, { css: { w: "100%", bg: "$surface_default", borderRadius: "$2" } }, /* @__PURE__ */ React33.createElement(Tabs.Root, { value: activeTab, onValueChange: setActiveTab, css: { w: "100%" } }, /* @__PURE__ */ React33.createElement(Tabs.List, { css: { w: "100%", p: "$2" } }, /* @__PURE__ */ React33.createElement(
|
2715
|
+
hideTabs ? /* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", c: "$on_surface_high" } }, showChat ? "Chat" : `Participants (${peerCount})`) : /* @__PURE__ */ React33.createElement(Flex, { css: { w: "100%", bg: "$surface_default", borderRadius: "$2" } }, /* @__PURE__ */ React33.createElement(Tabs.Root, { value: activeTab, onValueChange: setActiveTab, css: { w: "100%" } }, /* @__PURE__ */ React33.createElement(Tabs.List, { css: { w: "100%", p: "$2" } }, /* @__PURE__ */ React33.createElement(
|
3082
2716
|
Tabs.Trigger,
|
3083
2717
|
{
|
3084
2718
|
value: SIDE_PANE_OPTIONS.CHAT,
|
@@ -3120,50 +2754,162 @@ var ChatParticipantHeader = React33.memo(({ activeTabValue = SIDE_PANE_OPTIONS.C
|
|
3120
2754
|
);
|
3121
2755
|
});
|
3122
2756
|
|
3123
|
-
// src/Prebuilt/components/Footer/RoleAccordion.
|
3124
|
-
import
|
2757
|
+
// src/Prebuilt/components/Footer/RoleAccordion.tsx
|
2758
|
+
import React35 from "react";
|
3125
2759
|
import { useMeasure } from "react-use";
|
3126
2760
|
import { FixedSizeList } from "react-window";
|
2761
|
+
|
2762
|
+
// src/Prebuilt/components/Footer/RoleOptions.tsx
|
2763
|
+
import React34, { useState as useState18 } from "react";
|
2764
|
+
import { selectPermissions as selectPermissions7, useHMSActions as useHMSActions10, useHMSStore as useHMSStore16, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2765
|
+
import {
|
2766
|
+
MicOffIcon as MicOffIcon2,
|
2767
|
+
MicOnIcon,
|
2768
|
+
PersonRectangleIcon,
|
2769
|
+
RemoveUserIcon,
|
2770
|
+
VerticalMenuIcon as VerticalMenuIcon3,
|
2771
|
+
VideoOffIcon,
|
2772
|
+
VideoOnIcon
|
2773
|
+
} from "@100mslive/react-icons";
|
2774
|
+
var dropdownItemCSS = { backgroundColor: "$surface_default", gap: "$4", p: "$8" };
|
2775
|
+
var optionTextCSS = { fontWeight: "$semiBold", color: "$on_surface_high", textTransform: "none" };
|
2776
|
+
var RoleOptions = ({ roleName, peerList }) => {
|
2777
|
+
const [openOptions, setOpenOptions] = useState18(false);
|
2778
|
+
const permissions = useHMSStore16(selectPermissions7);
|
2779
|
+
const hmsActions = useHMSActions10();
|
2780
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
2781
|
+
const { on_stage_role, off_stage_roles = [] } = (elements == null ? void 0 : elements.on_stage_exp) || {};
|
2782
|
+
const vanillaStore = useHMSVanillaStore2();
|
2783
|
+
const store = vanillaStore.getState();
|
2784
|
+
let allPeersHaveVideoOn = true;
|
2785
|
+
let allPeersHaveAudioOn = true;
|
2786
|
+
peerList.forEach((peer) => {
|
2787
|
+
var _a, _b;
|
2788
|
+
const isAudioOn = !!peer.audioTrack && ((_a = store.tracks[peer.audioTrack]) == null ? void 0 : _a.enabled);
|
2789
|
+
const isVideoOn = !!peer.videoTrack && ((_b = store.tracks[peer.videoTrack]) == null ? void 0 : _b.enabled);
|
2790
|
+
allPeersHaveAudioOn = allPeersHaveAudioOn && isAudioOn;
|
2791
|
+
allPeersHaveVideoOn = allPeersHaveVideoOn && isVideoOn;
|
2792
|
+
});
|
2793
|
+
const canMuteRole = (permissions == null ? void 0 : permissions.mute) && roleName === on_stage_role;
|
2794
|
+
const canRemoveRoleFromStage = (permissions == null ? void 0 : permissions.changeRole) && roleName === on_stage_role;
|
2795
|
+
const canRemoveRoleFromRoom = (permissions == null ? void 0 : permissions.removeOthers) && (on_stage_role === roleName || (off_stage_roles == null ? void 0 : off_stage_roles.includes(roleName)));
|
2796
|
+
if (!(canMuteRole || canRemoveRoleFromStage || canRemoveRoleFromRoom)) {
|
2797
|
+
return null;
|
2798
|
+
}
|
2799
|
+
const removeAllFromStage = () => {
|
2800
|
+
peerList.forEach((peer) => {
|
2801
|
+
const prevRole = getMetadata(peer.metadata).prevRole;
|
2802
|
+
if (prevRole) {
|
2803
|
+
hmsActions.changeRoleOfPeer(peer.id, prevRole, true);
|
2804
|
+
}
|
2805
|
+
});
|
2806
|
+
};
|
2807
|
+
const setTrackEnabled = (type, enabled = false) => __async(void 0, null, function* () {
|
2808
|
+
try {
|
2809
|
+
yield hmsActions.setRemoteTracksEnabled({ roles: [roleName], source: "regular", type, enabled });
|
2810
|
+
} catch (e) {
|
2811
|
+
console.error(e);
|
2812
|
+
}
|
2813
|
+
});
|
2814
|
+
const removePeersFromRoom = () => __async(void 0, null, function* () {
|
2815
|
+
try {
|
2816
|
+
peerList.forEach((peer) => __async(void 0, null, function* () {
|
2817
|
+
yield hmsActions.removePeer(peer.id, "");
|
2818
|
+
}));
|
2819
|
+
} catch (e) {
|
2820
|
+
console.error(e);
|
2821
|
+
}
|
2822
|
+
});
|
2823
|
+
return /* @__PURE__ */ React34.createElement(Dropdown.Root, { open: openOptions, onOpenChange: setOpenOptions }, /* @__PURE__ */ React34.createElement(
|
2824
|
+
Dropdown.Trigger,
|
2825
|
+
{
|
2826
|
+
onClick: (e) => e.stopPropagation(),
|
2827
|
+
className: "role_actions",
|
2828
|
+
asChild: true,
|
2829
|
+
css: {
|
2830
|
+
p: "$1",
|
2831
|
+
r: "$0",
|
2832
|
+
c: "$on_surface_high",
|
2833
|
+
visibility: openOptions ? "visible" : "hidden",
|
2834
|
+
"&:hover": {
|
2835
|
+
c: "$on_surface_medium"
|
2836
|
+
},
|
2837
|
+
"@md": {
|
2838
|
+
visibility: "visible"
|
2839
|
+
}
|
2840
|
+
}
|
2841
|
+
},
|
2842
|
+
/* @__PURE__ */ React34.createElement(Flex, null, /* @__PURE__ */ React34.createElement(VerticalMenuIcon3, null))
|
2843
|
+
), /* @__PURE__ */ React34.createElement(
|
2844
|
+
Dropdown.Content,
|
2845
|
+
{
|
2846
|
+
onClick: (e) => e.stopPropagation(),
|
2847
|
+
css: { w: "max-content", maxWidth: "$64", bg: "$surface_default", py: 0 },
|
2848
|
+
align: "end"
|
2849
|
+
},
|
2850
|
+
canRemoveRoleFromStage && /* @__PURE__ */ React34.createElement(
|
2851
|
+
Dropdown.Item,
|
2852
|
+
{
|
2853
|
+
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderBottom: "1px solid $border_bright" }),
|
2854
|
+
onClick: removeAllFromStage
|
2855
|
+
},
|
2856
|
+
/* @__PURE__ */ React34.createElement(PersonRectangleIcon, null),
|
2857
|
+
/* @__PURE__ */ React34.createElement(Text, { variant: "sm", css: optionTextCSS }, "Remove all from Stage")
|
2858
|
+
),
|
2859
|
+
canMuteRole && /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(Dropdown.Item, { css: dropdownItemCSS, onClick: () => setTrackEnabled("audio", !allPeersHaveAudioOn) }, allPeersHaveAudioOn ? /* @__PURE__ */ React34.createElement(MicOffIcon2, null) : /* @__PURE__ */ React34.createElement(MicOnIcon, null), /* @__PURE__ */ React34.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveAudioOn ? "Mute" : "Unmute", " Audio")), /* @__PURE__ */ React34.createElement(
|
2860
|
+
Dropdown.Item,
|
2861
|
+
{
|
2862
|
+
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright" }),
|
2863
|
+
onClick: () => setTrackEnabled("video", !allPeersHaveVideoOn)
|
2864
|
+
},
|
2865
|
+
allPeersHaveVideoOn ? /* @__PURE__ */ React34.createElement(VideoOffIcon, null) : /* @__PURE__ */ React34.createElement(VideoOnIcon, null),
|
2866
|
+
/* @__PURE__ */ React34.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveVideoOn ? "Mute" : "Unmute", " Video")
|
2867
|
+
)),
|
2868
|
+
canRemoveRoleFromRoom && /* @__PURE__ */ React34.createElement(
|
2869
|
+
Dropdown.Item,
|
2870
|
+
{
|
2871
|
+
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright", color: "$alert_error_default" }),
|
2872
|
+
onClick: removePeersFromRoom
|
2873
|
+
},
|
2874
|
+
/* @__PURE__ */ React34.createElement(RemoveUserIcon, null),
|
2875
|
+
/* @__PURE__ */ React34.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, optionTextCSS), { color: "inherit" }) }, "Remove all from Room")
|
2876
|
+
)
|
2877
|
+
));
|
2878
|
+
};
|
2879
|
+
|
2880
|
+
// src/Prebuilt/components/Footer/RoleAccordion.tsx
|
3127
2881
|
var ROW_HEIGHT = 50;
|
3128
2882
|
function itemKey(index, data3) {
|
3129
2883
|
return data3.peerList[index].id;
|
3130
2884
|
}
|
3131
|
-
var VirtualizedParticipantItem =
|
3132
|
-
return /* @__PURE__ */
|
3133
|
-
Participant,
|
3134
|
-
{
|
3135
|
-
key: data3.peerList[index].id,
|
3136
|
-
peer: data3.peerList[index],
|
3137
|
-
isConnected: data3.isConnected,
|
3138
|
-
setSelectedPeerId: data3.setSelectedPeerId
|
3139
|
-
}
|
3140
|
-
);
|
2885
|
+
var VirtualizedParticipantItem = React35.memo(({ index, data: data3 }) => {
|
2886
|
+
return /* @__PURE__ */ React35.createElement(Participant, { key: data3.peerList[index].id, peer: data3.peerList[index], isConnected: data3.isConnected });
|
3141
2887
|
});
|
3142
2888
|
var RoleAccordion = ({
|
3143
2889
|
peerList = [],
|
3144
2890
|
roleName,
|
3145
|
-
setSelectedPeerId,
|
3146
2891
|
isConnected,
|
3147
2892
|
filter,
|
3148
2893
|
isHandRaisedAccordion = false
|
3149
2894
|
}) => {
|
3150
2895
|
const [ref, { width }] = useMeasure();
|
3151
|
-
const height = ROW_HEIGHT * peerList.length;
|
3152
2896
|
const showAcordion = (filter == null ? void 0 : filter.search) ? peerList.some((peer) => peer.name.toLowerCase().includes(filter.search)) : true;
|
3153
2897
|
if (!showAcordion || isHandRaisedAccordion && (filter == null ? void 0 : filter.search) || peerList.length === 0) {
|
3154
2898
|
return null;
|
3155
2899
|
}
|
3156
|
-
|
2900
|
+
const height = ROW_HEIGHT * peerList.length;
|
2901
|
+
return /* @__PURE__ */ React35.createElement(Flex, { direction: "column", css: { flexGrow: 1, "&:hover .role_actions": { visibility: "visible" } }, ref }, /* @__PURE__ */ React35.createElement(
|
3157
2902
|
Accordion.Root,
|
3158
2903
|
{
|
3159
2904
|
type: "single",
|
3160
2905
|
collapsible: true,
|
3161
2906
|
defaultValue: roleName,
|
3162
|
-
css: { borderRadius: "$
|
2907
|
+
css: { borderRadius: "$1", border: "1px solid $border_bright" }
|
3163
2908
|
},
|
3164
|
-
/* @__PURE__ */
|
2909
|
+
/* @__PURE__ */ React35.createElement(Accordion.Item, { value: roleName }, /* @__PURE__ */ React35.createElement(
|
3165
2910
|
Accordion.Header,
|
3166
2911
|
{
|
2912
|
+
iconStyles: { c: "$on_surface_high" },
|
3167
2913
|
css: {
|
3168
2914
|
textTransform: "capitalize",
|
3169
2915
|
p: "$6 $8",
|
@@ -3172,14 +2918,21 @@ var RoleAccordion = ({
|
|
3172
2918
|
c: "$on_surface_medium"
|
3173
2919
|
}
|
3174
2920
|
},
|
3175
|
-
|
3176
|
-
|
3177
|
-
|
3178
|
-
|
2921
|
+
/* @__PURE__ */ React35.createElement(Flex, { justify: "between", css: { flexGrow: 1, pr: "$6" } }, /* @__PURE__ */ React35.createElement(
|
2922
|
+
Text,
|
2923
|
+
{
|
2924
|
+
variant: "sm",
|
2925
|
+
css: { fontWeight: "$semiBold", textTransform: "capitalize", color: "$on_surface_medium" }
|
2926
|
+
},
|
2927
|
+
roleName,
|
2928
|
+
" ",
|
2929
|
+
`(${getFormattedCount(peerList.length)})`
|
2930
|
+
), /* @__PURE__ */ React35.createElement(RoleOptions, { roleName, peerList }))
|
2931
|
+
), /* @__PURE__ */ React35.createElement(Accordion.Content, null, /* @__PURE__ */ React35.createElement(Box, { css: { borderTop: "1px solid $border_default" } }), /* @__PURE__ */ React35.createElement(
|
3179
2932
|
FixedSizeList,
|
3180
2933
|
{
|
3181
2934
|
itemSize: ROW_HEIGHT,
|
3182
|
-
itemData: { peerList, isConnected
|
2935
|
+
itemData: { peerList, isConnected },
|
3183
2936
|
itemKey,
|
3184
2937
|
itemCount: peerList.length,
|
3185
2938
|
width,
|
@@ -3195,7 +2948,7 @@ var ParticipantList = () => {
|
|
3195
2948
|
const [filter, setFilter] = useState19();
|
3196
2949
|
const { participants, isConnected, peerCount } = useParticipants(filter);
|
3197
2950
|
const peersOrderedByRoles = {};
|
3198
|
-
const handRaisedPeers = useHMSStore17(
|
2951
|
+
const handRaisedPeers = useHMSStore17(selectPeersByCondition2((peer) => {
|
3199
2952
|
var _a;
|
3200
2953
|
return (_a = JSON.parse(peer.metadata || "{}")) == null ? void 0 : _a.isHandRaised;
|
3201
2954
|
}));
|
@@ -3205,8 +2958,7 @@ var ParticipantList = () => {
|
|
3205
2958
|
}
|
3206
2959
|
peersOrderedByRoles[participant.roleName].push(participant);
|
3207
2960
|
});
|
3208
|
-
const
|
3209
|
-
const onSearch = useCallback7((value) => {
|
2961
|
+
const onSearch = useCallback6((value) => {
|
3210
2962
|
setFilter((filterValue) => {
|
3211
2963
|
if (!filterValue) {
|
3212
2964
|
filterValue = {};
|
@@ -3218,27 +2970,18 @@ var ParticipantList = () => {
|
|
3218
2970
|
if (peerCount === 0) {
|
3219
2971
|
return null;
|
3220
2972
|
}
|
3221
|
-
return /* @__PURE__ */
|
2973
|
+
return /* @__PURE__ */ React36.createElement(Fragment7, null, /* @__PURE__ */ React36.createElement(Flex, { direction: "column", css: { size: "100%", gap: "$4" } }, /* @__PURE__ */ React36.createElement(ChatParticipantHeader, { activeTabValue: SIDE_PANE_OPTIONS.PARTICIPANTS }), !(filter == null ? void 0 : filter.search) && participants.length === 0 ? null : /* @__PURE__ */ React36.createElement(ParticipantSearch, { onSearch, inSidePane: true }), participants.length === 0 ? /* @__PURE__ */ React36.createElement(Flex, { align: "center", justify: "center", css: { w: "100%", p: "$8 0" } }, /* @__PURE__ */ React36.createElement(Text, { variant: "sm" }, !filter ? "No participants" : "No matching participants")) : null, /* @__PURE__ */ React36.createElement(
|
3222
2974
|
VirtualizedParticipants,
|
3223
2975
|
{
|
3224
2976
|
peersOrderedByRoles,
|
3225
2977
|
handRaisedList: handRaisedPeers,
|
3226
2978
|
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
|
-
}
|
2979
|
+
filter
|
3237
2980
|
}
|
3238
2981
|
)));
|
3239
2982
|
};
|
3240
2983
|
var ParticipantCount = () => {
|
3241
|
-
const peerCount = useHMSStore17(
|
2984
|
+
const peerCount = useHMSStore17(selectPeerCount3);
|
3242
2985
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
3243
2986
|
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
3244
2987
|
useEffect6(() => {
|
@@ -3249,7 +2992,7 @@ var ParticipantCount = () => {
|
|
3249
2992
|
if (peerCount === 0) {
|
3250
2993
|
return null;
|
3251
2994
|
}
|
3252
|
-
return /* @__PURE__ */
|
2995
|
+
return /* @__PURE__ */ React36.createElement(
|
3253
2996
|
IconButton_default,
|
3254
2997
|
{
|
3255
2998
|
css: {
|
@@ -3265,18 +3008,12 @@ var ParticipantCount = () => {
|
|
3265
3008
|
active: !isParticipantsOpen,
|
3266
3009
|
"data-testid": "participant_list"
|
3267
3010
|
},
|
3268
|
-
/* @__PURE__ */
|
3269
|
-
/* @__PURE__ */
|
3011
|
+
/* @__PURE__ */ React36.createElement(PeopleIcon2, null),
|
3012
|
+
/* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: { mx: "$4", c: "inherit" } }, peerCount)
|
3270
3013
|
);
|
3271
3014
|
};
|
3272
|
-
var VirtualizedParticipants = ({
|
3273
|
-
|
3274
|
-
isConnected,
|
3275
|
-
setSelectedPeerId,
|
3276
|
-
filter,
|
3277
|
-
handRaisedList = []
|
3278
|
-
}) => {
|
3279
|
-
return /* @__PURE__ */ React35.createElement(
|
3015
|
+
var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter, handRaisedList = [] }) => {
|
3016
|
+
return /* @__PURE__ */ React36.createElement(
|
3280
3017
|
Flex,
|
3281
3018
|
{
|
3282
3019
|
direction: "column",
|
@@ -3288,33 +3025,31 @@ var VirtualizedParticipants = ({
|
|
3288
3025
|
pr: "$3"
|
3289
3026
|
}
|
3290
3027
|
},
|
3291
|
-
/* @__PURE__ */
|
3028
|
+
/* @__PURE__ */ React36.createElement(
|
3292
3029
|
RoleAccordion,
|
3293
3030
|
{
|
3294
3031
|
peerList: handRaisedList,
|
3295
3032
|
roleName: "Hand Raised",
|
3296
3033
|
filter,
|
3297
3034
|
isConnected,
|
3298
|
-
setSelectedPeerId,
|
3299
3035
|
isHandRaisedAccordion: true
|
3300
3036
|
}
|
3301
3037
|
),
|
3302
|
-
Object.keys(peersOrderedByRoles).map((role) => /* @__PURE__ */
|
3038
|
+
Object.keys(peersOrderedByRoles).map((role) => /* @__PURE__ */ React36.createElement(
|
3303
3039
|
RoleAccordion,
|
3304
3040
|
{
|
3305
3041
|
key: role,
|
3306
3042
|
peerList: peersOrderedByRoles[role],
|
3307
3043
|
roleName: role,
|
3308
3044
|
isConnected,
|
3309
|
-
setSelectedPeerId,
|
3310
3045
|
filter
|
3311
3046
|
}
|
3312
3047
|
))
|
3313
3048
|
);
|
3314
3049
|
};
|
3315
|
-
var Participant = ({ peer, isConnected
|
3050
|
+
var Participant = ({ peer, isConnected }) => {
|
3316
3051
|
const localPeerId = useHMSStore17(selectLocalPeerID4);
|
3317
|
-
return /* @__PURE__ */
|
3052
|
+
return /* @__PURE__ */ React36.createElement(
|
3318
3053
|
Flex,
|
3319
3054
|
{
|
3320
3055
|
key: peer.id,
|
@@ -3329,84 +3064,73 @@ var Participant = ({ peer, isConnected, setSelectedPeerId }) => {
|
|
3329
3064
|
justify: "between",
|
3330
3065
|
"data-testid": "participant_" + peer.name
|
3331
3066
|
},
|
3332
|
-
/* @__PURE__ */
|
3333
|
-
isConnected ? /* @__PURE__ */
|
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
|
3067
|
+
/* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, textEllipsis(150)), { fontWeight: "$semiBold", color: "$on_surface_high" }) }, peer.name, " ", localPeerId === peer.id ? "(You)" : ""),
|
3068
|
+
isConnected ? /* @__PURE__ */ React36.createElement(ParticipantActions, { peerId: peer.id, isLocal: peer.id === localPeerId, role: peer.roleName }) : null
|
3344
3069
|
);
|
3345
3070
|
};
|
3346
|
-
var ParticipantActions =
|
3071
|
+
var ParticipantActions = React36.memo(({ peerId, role, isLocal }) => {
|
3347
3072
|
var _a, _b;
|
3348
|
-
const isHandRaised = (_a = useHMSStore17(
|
3349
|
-
const canChangeRole = (_b = useHMSStore17(
|
3073
|
+
const isHandRaised = (_a = useHMSStore17(selectPeerMetadata2(peerId))) == null ? void 0 : _a.isHandRaised;
|
3074
|
+
const canChangeRole = (_b = useHMSStore17(selectPermissions8)) == null ? void 0 : _b.changeRole;
|
3350
3075
|
const shouldShowMoreActions = canChangeRole;
|
3351
3076
|
const isAudioMuted = !useHMSStore17(selectIsPeerAudioEnabled(peerId));
|
3352
|
-
return /* @__PURE__ */
|
3077
|
+
return /* @__PURE__ */ React36.createElement(
|
3353
3078
|
Flex,
|
3354
3079
|
{
|
3355
3080
|
align: "center",
|
3356
3081
|
css: {
|
3357
3082
|
flexShrink: 0,
|
3358
|
-
gap: "$8"
|
3359
|
-
mt: "$2"
|
3083
|
+
gap: "$8"
|
3360
3084
|
}
|
3361
3085
|
},
|
3362
|
-
/* @__PURE__ */
|
3363
|
-
isHandRaised && /* @__PURE__ */
|
3086
|
+
/* @__PURE__ */ React36.createElement(ConnectionIndicator, { peerId }),
|
3087
|
+
isHandRaised && /* @__PURE__ */ React36.createElement(
|
3364
3088
|
Flex,
|
3365
3089
|
{
|
3366
3090
|
align: "center",
|
3367
3091
|
justify: "center",
|
3368
3092
|
css: { p: "$1", c: "$on_surface_high", bg: "$surface_bright", borderRadius: "$round" }
|
3369
3093
|
},
|
3370
|
-
/* @__PURE__ */
|
3094
|
+
/* @__PURE__ */ React36.createElement(HandIcon3, { height: 19, width: 19 })
|
3371
3095
|
),
|
3372
|
-
isAudioMuted ? /* @__PURE__ */
|
3096
|
+
isAudioMuted ? /* @__PURE__ */ React36.createElement(
|
3373
3097
|
Flex,
|
3374
3098
|
{
|
3375
3099
|
align: "center",
|
3376
3100
|
justify: "center",
|
3377
3101
|
css: { p: "$2", c: "$on_surface_high", bg: "$surface_bright", borderRadius: "$round" }
|
3378
3102
|
},
|
3379
|
-
/* @__PURE__ */
|
3103
|
+
/* @__PURE__ */ React36.createElement(MicOffIcon3, { height: 19, width: 19 })
|
3380
3104
|
) : null,
|
3381
|
-
shouldShowMoreActions && !isInternalRole(role) && !isLocal ? /* @__PURE__ */
|
3105
|
+
shouldShowMoreActions && !isInternalRole(role) && !isLocal ? /* @__PURE__ */ React36.createElement(ParticipantMoreActions, { peerId, role }) : null
|
3382
3106
|
);
|
3383
3107
|
});
|
3384
|
-
var ParticipantMoreActions = ({
|
3385
|
-
var _a
|
3386
|
-
const hmsActions =
|
3387
|
-
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } = useHMSStore17(
|
3388
|
-
const
|
3108
|
+
var ParticipantMoreActions = ({ peerId, role }) => {
|
3109
|
+
var _a;
|
3110
|
+
const hmsActions = useHMSActions11();
|
3111
|
+
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } = useHMSStore17(selectPermissions8);
|
3112
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
3389
3113
|
const {
|
3390
3114
|
bring_to_stage_label,
|
3391
3115
|
remove_from_stage_label,
|
3392
3116
|
on_stage_role,
|
3393
3117
|
off_stage_roles = []
|
3394
|
-
} =
|
3395
|
-
const canBringToStage = off_stage_roles.includes(role);
|
3118
|
+
} = elements.on_stage_exp || {};
|
3396
3119
|
const isInStage = role === on_stage_role;
|
3397
|
-
const
|
3120
|
+
const shouldShowStageRoleChange = canChangeRole && (isInStage && remove_from_stage_label || (off_stage_roles == null ? void 0 : off_stage_roles.includes(role)) && bring_to_stage_label);
|
3121
|
+
const prevRole = (_a = useHMSStore17(selectPeerMetadata2(peerId))) == null ? void 0 : _a.prevRole;
|
3398
3122
|
const localPeerId = useHMSStore17(selectLocalPeerID4);
|
3399
3123
|
const isLocal = localPeerId === peerId;
|
3400
3124
|
const [open, setOpen] = useState19(false);
|
3401
3125
|
const handleStageAction = () => __async(void 0, null, function* () {
|
3402
3126
|
if (isInStage) {
|
3403
|
-
hmsActions.changeRoleOfPeer(peerId, prevRole
|
3127
|
+
prevRole && hmsActions.changeRoleOfPeer(peerId, prevRole, true);
|
3404
3128
|
} else {
|
3405
3129
|
yield hmsActions.changeRoleOfPeer(peerId, on_stage_role);
|
3406
3130
|
}
|
3407
3131
|
setOpen(false);
|
3408
3132
|
});
|
3409
|
-
return /* @__PURE__ */
|
3133
|
+
return /* @__PURE__ */ React36.createElement(Dropdown.Root, { open, onOpenChange: (value) => setOpen(value), modal: false }, /* @__PURE__ */ React36.createElement(
|
3410
3134
|
Dropdown.Trigger,
|
3411
3135
|
{
|
3412
3136
|
asChild: true,
|
@@ -3426,8 +3150,8 @@ var ParticipantMoreActions = ({ onRoleChange, peerId, role }) => {
|
|
3426
3150
|
},
|
3427
3151
|
tabIndex: 0
|
3428
3152
|
},
|
3429
|
-
/* @__PURE__ */
|
3430
|
-
), /* @__PURE__ */
|
3153
|
+
/* @__PURE__ */ React36.createElement(Box, { css: { my: "auto" } }, /* @__PURE__ */ React36.createElement(VerticalMenuIcon4, null))
|
3154
|
+
), /* @__PURE__ */ React36.createElement(Dropdown.Portal, null, /* @__PURE__ */ React36.createElement(Dropdown.Content, { align: "end", sideOffset: 8, css: { w: "$64", bg: "$surface_default" } }, shouldShowStageRoleChange ? /* @__PURE__ */ React36.createElement(Dropdown.Item, { css: { bg: "$surface_default" }, onClick: () => handleStageAction() }, /* @__PURE__ */ React36.createElement(ChangeRoleIcon2, null), /* @__PURE__ */ React36.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__ */ React36.createElement(
|
3431
3155
|
Dropdown.Item,
|
3432
3156
|
{
|
3433
3157
|
css: { color: "$alert_error_default", bg: "$surface_default" },
|
@@ -3439,12 +3163,12 @@ var ParticipantMoreActions = ({ onRoleChange, peerId, role }) => {
|
|
3439
3163
|
}
|
3440
3164
|
})
|
3441
3165
|
},
|
3442
|
-
/* @__PURE__ */
|
3443
|
-
/* @__PURE__ */
|
3166
|
+
/* @__PURE__ */ React36.createElement(PeopleRemoveIcon, null),
|
3167
|
+
/* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: { ml: "$4", color: "inherit", fontWeight: "$semiBold" } }, "Remove Participant")
|
3444
3168
|
))));
|
3445
3169
|
};
|
3446
3170
|
var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
3447
|
-
const [value, setValue] =
|
3171
|
+
const [value, setValue] = React36.useState("");
|
3448
3172
|
const isMobile = useMedia4(config.media.md);
|
3449
3173
|
useDebounce(
|
3450
3174
|
() => {
|
@@ -3453,7 +3177,7 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3453
3177
|
300,
|
3454
3178
|
[value, onSearch]
|
3455
3179
|
);
|
3456
|
-
return /* @__PURE__ */
|
3180
|
+
return /* @__PURE__ */ React36.createElement(
|
3457
3181
|
Flex,
|
3458
3182
|
{
|
3459
3183
|
align: "center",
|
@@ -3465,8 +3189,8 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3465
3189
|
mt: inSidePane ? "$4" : ""
|
3466
3190
|
}
|
3467
3191
|
},
|
3468
|
-
/* @__PURE__ */
|
3469
|
-
/* @__PURE__ */
|
3192
|
+
/* @__PURE__ */ React36.createElement(SearchIcon, { style: { position: "absolute", left: isMobile ? "1.25rem" : "0.5rem" } }),
|
3193
|
+
/* @__PURE__ */ React36.createElement(
|
3470
3194
|
Input,
|
3471
3195
|
{
|
3472
3196
|
type: "text",
|
@@ -3487,12 +3211,17 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3487
3211
|
};
|
3488
3212
|
|
3489
3213
|
// src/Prebuilt/components/Footer/Footer.tsx
|
3214
|
+
var VirtualBackground = React37.lazy(() => import("./VirtualBackground-UM2FOUHQ.js"));
|
3490
3215
|
var Footer2 = ({
|
3491
3216
|
screenType,
|
3492
3217
|
elements
|
3493
3218
|
}) => {
|
3219
|
+
var _a, _b;
|
3494
3220
|
const isMobile = useMedia5(config.media.md);
|
3495
|
-
|
3221
|
+
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay);
|
3222
|
+
const openByDefault = ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.initial_state) === Chat_ChatState.CHAT_STATE_OPEN;
|
3223
|
+
const isVideoOn = useHMSStore18(selectIsLocalVideoEnabled2);
|
3224
|
+
return /* @__PURE__ */ React37.createElement(
|
3496
3225
|
Footer.Root,
|
3497
3226
|
{
|
3498
3227
|
css: {
|
@@ -3501,11 +3230,12 @@ var Footer2 = ({
|
|
3501
3230
|
justifyContent: "center",
|
3502
3231
|
gap: "$10",
|
3503
3232
|
position: "relative",
|
3504
|
-
|
3233
|
+
// To prevent it from showing over the sidepane if chat type is not overlay
|
3234
|
+
zIndex: isOverlayChat ? 20 : 1
|
3505
3235
|
}
|
3506
3236
|
}
|
3507
3237
|
},
|
3508
|
-
/* @__PURE__ */
|
3238
|
+
/* @__PURE__ */ React37.createElement(
|
3509
3239
|
Footer.Left,
|
3510
3240
|
{
|
3511
3241
|
css: {
|
@@ -3516,10 +3246,11 @@ var Footer2 = ({
|
|
3516
3246
|
}
|
3517
3247
|
}
|
3518
3248
|
},
|
3519
|
-
isMobile ? /* @__PURE__ */
|
3520
|
-
/* @__PURE__ */
|
3249
|
+
isMobile ? /* @__PURE__ */ React37.createElement(LeaveRoom, { screenType }) : null,
|
3250
|
+
/* @__PURE__ */ React37.createElement(AudioVideoToggle, null),
|
3251
|
+
isMobile ? null : /* @__PURE__ */ React37.createElement(Suspense, { fallback: /* @__PURE__ */ React37.createElement(React37.Fragment, null) }, isVideoOn ? /* @__PURE__ */ React37.createElement(VirtualBackground, null) : null)
|
3521
3252
|
),
|
3522
|
-
/* @__PURE__ */
|
3253
|
+
/* @__PURE__ */ React37.createElement(
|
3523
3254
|
Footer.Center,
|
3524
3255
|
{
|
3525
3256
|
css: {
|
@@ -3529,21 +3260,21 @@ var Footer2 = ({
|
|
3529
3260
|
}
|
3530
3261
|
}
|
3531
3262
|
},
|
3532
|
-
isMobile ? /* @__PURE__ */
|
3263
|
+
isMobile ? /* @__PURE__ */ React37.createElement(React37.Fragment, null, screenType === "hls_live_streaming" ? /* @__PURE__ */ React37.createElement(RaiseHand, null) : null, (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React37.createElement(ChatToggle, { openByDefault }), /* @__PURE__ */ React37.createElement(MoreSettings, { elements, screenType })) : /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(ScreenshareToggle, null), /* @__PURE__ */ React37.createElement(RaiseHand, null), (elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React37.createElement(EmojiReaction, null), /* @__PURE__ */ React37.createElement(LeaveRoom, { screenType }))
|
3533
3264
|
),
|
3534
|
-
/* @__PURE__ */
|
3265
|
+
/* @__PURE__ */ React37.createElement(Footer.Right, null, !isMobile && (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React37.createElement(ChatToggle, { openByDefault }), (elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React37.createElement(ParticipantCount, null), /* @__PURE__ */ React37.createElement(MoreSettings, { elements, screenType }))
|
3535
3266
|
);
|
3536
3267
|
};
|
3537
3268
|
|
3538
3269
|
// src/Prebuilt/components/Notifications/HLSFailureModal.jsx
|
3539
|
-
import
|
3540
|
-
import { selectHLSState, useHMSActions as
|
3270
|
+
import React38, { useCallback as useCallback7, useState as useState20 } from "react";
|
3271
|
+
import { selectHLSState as selectHLSState2, useHMSActions as useHMSActions12, useHMSStore as useHMSStore19 } from "@100mslive/react-sdk";
|
3541
3272
|
function HLSFailureModal() {
|
3542
|
-
const { hlsError } =
|
3273
|
+
const { hlsError } = useHMSStore19(selectHLSState2).error || false;
|
3543
3274
|
const [openModal, setOpenModal] = useState20(!!hlsError);
|
3544
|
-
const hmsActions =
|
3275
|
+
const hmsActions = useHMSActions12();
|
3545
3276
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
3546
|
-
const startHLS =
|
3277
|
+
const startHLS = useCallback7(() => __async(this, null, function* () {
|
3547
3278
|
try {
|
3548
3279
|
if (isHLSStarted) {
|
3549
3280
|
return;
|
@@ -3558,7 +3289,7 @@ function HLSFailureModal() {
|
|
3558
3289
|
setHLSStarted(false);
|
3559
3290
|
}
|
3560
3291
|
}), [hmsActions, isHLSStarted, setHLSStarted]);
|
3561
|
-
return hlsError ? /* @__PURE__ */
|
3292
|
+
return hlsError ? /* @__PURE__ */ React38.createElement(
|
3562
3293
|
Dialog.Root,
|
3563
3294
|
{
|
3564
3295
|
open: openModal,
|
@@ -3568,7 +3299,7 @@ function HLSFailureModal() {
|
|
3568
3299
|
}
|
3569
3300
|
}
|
3570
3301
|
},
|
3571
|
-
/* @__PURE__ */
|
3302
|
+
/* @__PURE__ */ React38.createElement(Dialog.Portal, null, /* @__PURE__ */ React38.createElement(Dialog.Overlay, null), /* @__PURE__ */ React38.createElement(Dialog.Content, { css: { w: "min(360px, 90%)" } }, /* @__PURE__ */ React38.createElement(
|
3572
3303
|
Dialog.Title,
|
3573
3304
|
{
|
3574
3305
|
css: {
|
@@ -3579,45 +3310,58 @@ function HLSFailureModal() {
|
|
3579
3310
|
mt: "$4"
|
3580
3311
|
}
|
3581
3312
|
},
|
3582
|
-
/* @__PURE__ */
|
3583
|
-
), /* @__PURE__ */
|
3313
|
+
/* @__PURE__ */ React38.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, "Failed to Go Live")
|
3314
|
+
), /* @__PURE__ */ React38.createElement(Text, { variant: "sm", css: { mb: "$10", color: "$on_surface_medium" } }, "Something went wrong and your live broadcast failed. Please try again."), /* @__PURE__ */ React38.createElement(Flex, { align: "center", justify: "between", css: { w: "100%", gap: "$8" } }, /* @__PURE__ */ React38.createElement(Button, { outlined: true, variant: "standard", css: { w: "100%" }, onClick: () => setOpenModal(false) }, "Dismiss"), /* @__PURE__ */ React38.createElement(Button, { css: { w: "100%" }, onClick: startHLS }, "Go Live"))))
|
3584
3315
|
) : null;
|
3585
3316
|
}
|
3586
3317
|
|
3587
3318
|
// 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";
|
3319
|
+
import React60, { Suspense as Suspense2, useEffect as useEffect22 } from "react";
|
3320
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as selectLocalPeerRoleName2, useHMSActions as useHMSActions20, useHMSStore as useHMSStore35 } from "@100mslive/react-sdk";
|
3597
3321
|
|
3598
3322
|
// src/Prebuilt/components/VideoLayouts/GridLayout.tsx
|
3599
|
-
import
|
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";
|
3323
|
+
import React50, { useEffect as useEffect14, useMemo as useMemo6, useState as useState27 } from "react";
|
3324
|
+
import { selectPeers as selectPeers2, selectPeerScreenSharing, useHMSStore as useHMSStore25, useHMSVanillaStore as useHMSVanillaStore4 } from "@100mslive/react-sdk";
|
3607
3325
|
|
3608
3326
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3609
|
-
import
|
3327
|
+
import React43, { useEffect as useEffect10, useMemo as useMemo3, useState as useState22 } from "react";
|
3610
3328
|
import { useMedia as useMedia8 } from "react-use";
|
3611
|
-
import { selectLocalPeer as selectLocalPeer3, useHMSStore as
|
3329
|
+
import { selectLocalPeer as selectLocalPeer3, useHMSStore as useHMSStore21 } from "@100mslive/react-sdk";
|
3612
3330
|
|
3613
3331
|
// src/Prebuilt/components/InsetTile.tsx
|
3614
|
-
import
|
3332
|
+
import React40, { useEffect as useEffect7, useRef as useRef6 } from "react";
|
3615
3333
|
import Draggable from "react-draggable";
|
3616
3334
|
import { useMedia as useMedia6 } from "react-use";
|
3617
|
-
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer as selectLocalPeer2, selectVideoTrackByID, useHMSStore as
|
3335
|
+
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer as selectLocalPeer2, selectVideoTrackByID, useHMSStore as useHMSStore20 } from "@100mslive/react-sdk";
|
3618
3336
|
import { ExpandIcon as ExpandIcon2 } from "@100mslive/react-icons";
|
3337
|
+
|
3338
|
+
// src/Prebuilt/components/hooks/useVideoTileLayout.ts
|
3339
|
+
import React39, { useContext } from "react";
|
3340
|
+
var VideoTileContext = React39.createContext({
|
3341
|
+
enableSpotlightingPeer: true,
|
3342
|
+
hideParticipantNameOnTile: false,
|
3343
|
+
roundedVideoTile: true,
|
3344
|
+
hideAudioMuteOnTile: false,
|
3345
|
+
hideAudioLevelOnTile: false,
|
3346
|
+
objectFit: "contain",
|
3347
|
+
hideMetadataOnTile: false
|
3348
|
+
});
|
3349
|
+
var useVideoTileContext = () => {
|
3350
|
+
const context = useContext(VideoTileContext);
|
3351
|
+
return context;
|
3352
|
+
};
|
3353
|
+
|
3354
|
+
// src/Prebuilt/components/InsetTile.tsx
|
3619
3355
|
var MinimisedTile = ({ setMinimised }) => {
|
3620
|
-
return /* @__PURE__ */
|
3356
|
+
return /* @__PURE__ */ React40.createElement(Flex, { align: "center", css: { gap: "$6", r: "$1", bg: "$surface_default", p: "$4", color: "$on_surface_high" } }, /* @__PURE__ */ React40.createElement(AudioVideoToggle, { hideOptions: true }), /* @__PURE__ */ React40.createElement(Text, null, "You"), /* @__PURE__ */ React40.createElement(
|
3357
|
+
IconButton_default,
|
3358
|
+
{
|
3359
|
+
className: "__cancel-drag-event",
|
3360
|
+
onClick: () => setMinimised(false),
|
3361
|
+
css: { bg: "transparent", border: "transparent" }
|
3362
|
+
},
|
3363
|
+
/* @__PURE__ */ React40.createElement(ExpandIcon2, null)
|
3364
|
+
));
|
3621
3365
|
};
|
3622
3366
|
var insetHeightPx = 180;
|
3623
3367
|
var insetMaxWidthPx = 240;
|
@@ -3626,18 +3370,22 @@ var desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
|
3626
3370
|
var InsetTile = () => {
|
3627
3371
|
const isMobile = useMedia6(config.media.md);
|
3628
3372
|
const isLandscape = useMedia6(config.media.ls);
|
3629
|
-
const localPeer =
|
3373
|
+
const localPeer = useHMSStore20(selectLocalPeer2);
|
3630
3374
|
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
3631
|
-
const videoTrack =
|
3632
|
-
const isAllowedToPublish =
|
3633
|
-
const
|
3375
|
+
const videoTrack = useHMSStore20(selectVideoTrackByID(localPeer == null ? void 0 : localPeer.videoTrack));
|
3376
|
+
const isAllowedToPublish = useHMSStore20(selectIsAllowedToPublish2);
|
3377
|
+
const videoTileProps = useVideoTileContext();
|
3378
|
+
let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;
|
3379
|
+
if ((videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) && !isMobile) {
|
3380
|
+
aspectRatio = videoTrack.width / videoTrack.height;
|
3381
|
+
}
|
3634
3382
|
let height = insetHeightPx;
|
3635
3383
|
let width = height * aspectRatio;
|
3636
3384
|
if (isLandscape && width > insetMaxWidthPx) {
|
3637
3385
|
width = 240;
|
3638
3386
|
height = width / aspectRatio;
|
3639
3387
|
}
|
3640
|
-
const nodeRef =
|
3388
|
+
const nodeRef = useRef6(null);
|
3641
3389
|
useEffect7(() => {
|
3642
3390
|
const node = nodeRef.current;
|
3643
3391
|
if (!node || !window.ResizeObserver) {
|
@@ -3659,7 +3407,7 @@ var InsetTile = () => {
|
|
3659
3407
|
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
3660
3408
|
return null;
|
3661
3409
|
}
|
3662
|
-
return /* @__PURE__ */
|
3410
|
+
return /* @__PURE__ */ React40.createElement(Draggable, { bounds: "parent", nodeRef, cancel: ".__cancel-drag-event" }, /* @__PURE__ */ React40.createElement(
|
3663
3411
|
Box,
|
3664
3412
|
{
|
3665
3413
|
ref: nodeRef,
|
@@ -3675,9 +3423,9 @@ var InsetTile = () => {
|
|
3675
3423
|
h: height
|
3676
3424
|
} : {})
|
3677
3425
|
},
|
3678
|
-
minimised ? /* @__PURE__ */
|
3426
|
+
minimised ? /* @__PURE__ */ React40.createElement(MinimisedTile, { setMinimised }) : /* @__PURE__ */ React40.createElement(
|
3679
3427
|
VideoTile_default,
|
3680
|
-
{
|
3428
|
+
__spreadValues({
|
3681
3429
|
peerId: localPeer == null ? void 0 : localPeer.id,
|
3682
3430
|
trackid: localPeer == null ? void 0 : localPeer.videoTrack,
|
3683
3431
|
rootCSS: {
|
@@ -3687,14 +3435,15 @@ var InsetTile = () => {
|
|
3687
3435
|
width,
|
3688
3436
|
height,
|
3689
3437
|
containerCSS: { background: "$surface_default" },
|
3690
|
-
canMinimise: true
|
3691
|
-
|
3438
|
+
canMinimise: true,
|
3439
|
+
isDragabble: true
|
3440
|
+
}, videoTileProps)
|
3692
3441
|
)
|
3693
3442
|
));
|
3694
3443
|
};
|
3695
3444
|
|
3696
3445
|
// src/Prebuilt/components/Pagination.tsx
|
3697
|
-
import
|
3446
|
+
import React41, { useEffect as useEffect8 } from "react";
|
3698
3447
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@100mslive/react-icons";
|
3699
3448
|
var Pagination = ({
|
3700
3449
|
page,
|
@@ -3719,7 +3468,7 @@ var Pagination = ({
|
|
3719
3468
|
if (numPages <= 1) {
|
3720
3469
|
return null;
|
3721
3470
|
}
|
3722
|
-
return /* @__PURE__ */
|
3471
|
+
return /* @__PURE__ */ React41.createElement(StyledPagination.Root, { css: { flexShrink: 0 } }, /* @__PURE__ */ React41.createElement(StyledPagination.Chevron, { disabled: disableLeft, onClick: prevPage }, /* @__PURE__ */ React41.createElement(ChevronLeftIcon2, { width: 16, height: 16, style: { cursor: disableLeft ? "not-allowed" : "pointer" } })), numPages <= 5 ? /* @__PURE__ */ React41.createElement(StyledPagination.Dots, null, [...Array(numPages)].map((_, i) => /* @__PURE__ */ React41.createElement(
|
3723
3472
|
StyledPagination.Dot,
|
3724
3473
|
{
|
3725
3474
|
key: i,
|
@@ -3729,62 +3478,48 @@ var Pagination = ({
|
|
3729
3478
|
onPageChange(i);
|
3730
3479
|
}
|
3731
3480
|
}
|
3732
|
-
))), /* @__PURE__ */
|
3733
|
-
};
|
3734
|
-
|
3735
|
-
// src/Prebuilt/components/VideoLayouts/Grid.tsx
|
3736
|
-
import React41 from "react";
|
3737
|
-
|
3738
|
-
// src/Prebuilt/components/hooks/useVideoTileLayout.ts
|
3739
|
-
import React40, { useContext } from "react";
|
3740
|
-
var VideoTileContext = React40.createContext({
|
3741
|
-
enableSpotlightingPeer: true,
|
3742
|
-
hideParticipantNameOnTile: false,
|
3743
|
-
roundedVideoTile: true,
|
3744
|
-
hideAudioMuteOnTile: false,
|
3745
|
-
objectFit: "contain"
|
3746
|
-
});
|
3747
|
-
var useVideoTileContext = () => {
|
3748
|
-
const context = useContext(VideoTileContext);
|
3749
|
-
return context;
|
3481
|
+
))) : null, /* @__PURE__ */ React41.createElement(StyledPagination.Chevron, { disabled: disableRight, onClick: nextPage }, /* @__PURE__ */ React41.createElement(ChevronRightIcon2, { width: 16, height: 16, style: { cursor: disableRight ? "not-allowed" : "pointer" } })));
|
3750
3482
|
};
|
3751
3483
|
|
3752
3484
|
// src/Prebuilt/components/VideoLayouts/Grid.tsx
|
3753
|
-
|
3754
|
-
|
3755
|
-
|
3756
|
-
|
3757
|
-
|
3758
|
-
|
3759
|
-
|
3760
|
-
|
3761
|
-
|
3762
|
-
|
3763
|
-
|
3764
|
-
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3768
|
-
|
3769
|
-
|
3770
|
-
|
3771
|
-
|
3772
|
-
|
3773
|
-
|
3774
|
-
|
3775
|
-
|
3776
|
-
|
3777
|
-
|
3778
|
-
|
3779
|
-
|
3780
|
-
|
3781
|
-
|
3782
|
-
|
3783
|
-
|
3784
|
-
|
3785
|
-
|
3786
|
-
|
3787
|
-
})
|
3485
|
+
import React42 from "react";
|
3486
|
+
var Grid = React42.forwardRef(
|
3487
|
+
({ tiles, edgeToEdge }, ref) => {
|
3488
|
+
const videoTileProps = useVideoTileContext();
|
3489
|
+
return /* @__PURE__ */ React42.createElement(
|
3490
|
+
Box,
|
3491
|
+
{
|
3492
|
+
ref,
|
3493
|
+
css: {
|
3494
|
+
flex: "1 1 0",
|
3495
|
+
gap: "$4",
|
3496
|
+
display: "flex",
|
3497
|
+
placeContent: "center",
|
3498
|
+
alignItems: "center",
|
3499
|
+
justifyContent: "center",
|
3500
|
+
flexFlow: "row wrap",
|
3501
|
+
minHeight: 0,
|
3502
|
+
"@md": { gap: edgeToEdge ? 0 : "$4" }
|
3503
|
+
}
|
3504
|
+
},
|
3505
|
+
tiles == null ? void 0 : tiles.map((tile) => {
|
3506
|
+
var _a, _b, _c, _d;
|
3507
|
+
return /* @__PURE__ */ React42.createElement(
|
3508
|
+
VideoTile_default,
|
3509
|
+
__spreadValues({
|
3510
|
+
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
3511
|
+
width: tile.width,
|
3512
|
+
height: tile.height,
|
3513
|
+
peerId: (_c = tile.peer) == null ? void 0 : _c.id,
|
3514
|
+
trackId: (_d = tile.track) == null ? void 0 : _d.id,
|
3515
|
+
rootCSS: { padding: 0 },
|
3516
|
+
objectFit: "contain"
|
3517
|
+
}, videoTileProps)
|
3518
|
+
);
|
3519
|
+
})
|
3520
|
+
);
|
3521
|
+
}
|
3522
|
+
);
|
3788
3523
|
|
3789
3524
|
// src/Prebuilt/components/hooks/useTileLayout.tsx
|
3790
3525
|
import { useEffect as useEffect9, useMemo as useMemo2, useState as useState21 } from "react";
|
@@ -3795,7 +3530,6 @@ import {
|
|
3795
3530
|
useHMSVanillaStore as useHMSVanillaStore3
|
3796
3531
|
} from "@100mslive/react-sdk";
|
3797
3532
|
var aspectRatioConfig = { default: [1 / 1, 4 / 3, 16 / 9], mobile: [1 / 1, 3 / 4, 9 / 16] };
|
3798
|
-
var gap = 8;
|
3799
3533
|
var usePagesWithTiles = ({ peers, maxTileCount }) => {
|
3800
3534
|
const vanillaStore = useHMSVanillaStore3();
|
3801
3535
|
const tracksMap = vanillaStore.getState(selectTracksMap3);
|
@@ -3820,7 +3554,8 @@ var usePagesWithTiles = ({ peers, maxTileCount }) => {
|
|
3820
3554
|
};
|
3821
3555
|
var useTileLayout = ({
|
3822
3556
|
pageList,
|
3823
|
-
maxTileCount
|
3557
|
+
maxTileCount,
|
3558
|
+
edgeToEdge = false
|
3824
3559
|
}) => {
|
3825
3560
|
const vanillaStore = useHMSVanillaStore3();
|
3826
3561
|
const [ref, { width, height }] = useMeasure2();
|
@@ -3848,28 +3583,33 @@ var useTileLayout = ({
|
|
3848
3583
|
}
|
3849
3584
|
return rowElements;
|
3850
3585
|
});
|
3586
|
+
const gap = edgeToEdge && isMobile ? 0 : 8;
|
3851
3587
|
const maxHeight = height - (maxRows - 1) * gap;
|
3852
3588
|
const maxRowHeight = maxHeight / matrix.length;
|
3853
3589
|
const aspectRatios = isMobile && (noOfTilesInPage === 1 || noOfTilesInPage > 3) ? aspectRatioConfig.mobile : aspectRatioConfig.default;
|
3854
3590
|
for (const row of matrix) {
|
3855
3591
|
let tileWidth = (width - (row.length - 1) * gap) / row.length;
|
3856
3592
|
let tileHeight = 0;
|
3857
|
-
|
3858
|
-
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3593
|
+
if (edgeToEdge) {
|
3594
|
+
tileHeight = maxRowHeight;
|
3595
|
+
} else {
|
3596
|
+
const calcHeights = aspectRatios.map((aR) => tileWidth / aR);
|
3597
|
+
for (const h of calcHeights) {
|
3598
|
+
if (h < maxRowHeight) {
|
3599
|
+
if (tileHeight < h) {
|
3600
|
+
tileHeight = h;
|
3601
|
+
}
|
3862
3602
|
}
|
3863
3603
|
}
|
3864
|
-
|
3865
|
-
|
3866
|
-
|
3867
|
-
|
3868
|
-
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
3872
|
-
|
3604
|
+
if (tileHeight === 0) {
|
3605
|
+
tileHeight = maxRowHeight;
|
3606
|
+
const calcWidths = aspectRatios.map((aR) => tileHeight * aR);
|
3607
|
+
tileWidth = 0;
|
3608
|
+
for (const w of calcWidths) {
|
3609
|
+
if (w < width) {
|
3610
|
+
if (tileWidth < w) {
|
3611
|
+
tileWidth = w;
|
3612
|
+
}
|
3873
3613
|
}
|
3874
3614
|
}
|
3875
3615
|
}
|
@@ -3881,14 +3621,14 @@ var useTileLayout = ({
|
|
3881
3621
|
}
|
3882
3622
|
}
|
3883
3623
|
setPagesWithTiles([...pageList]);
|
3884
|
-
}, [width, height, maxTileCount, pageList, vanillaStore, isMobile]);
|
3624
|
+
}, [width, height, maxTileCount, pageList, vanillaStore, isMobile, edgeToEdge]);
|
3885
3625
|
return { pagesWithTiles, ref };
|
3886
3626
|
};
|
3887
3627
|
|
3888
3628
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3889
|
-
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize }) {
|
3629
|
+
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }) {
|
3890
3630
|
var _a;
|
3891
|
-
const localPeer =
|
3631
|
+
const localPeer = useHMSStore21(selectLocalPeer3);
|
3892
3632
|
const isMobile = useMedia8(config.media.md);
|
3893
3633
|
let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
|
3894
3634
|
maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
|
@@ -3906,7 +3646,8 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3906
3646
|
});
|
3907
3647
|
const { ref, pagesWithTiles } = useTileLayout({
|
3908
3648
|
pageList,
|
3909
|
-
maxTileCount
|
3649
|
+
maxTileCount,
|
3650
|
+
edgeToEdge
|
3910
3651
|
});
|
3911
3652
|
const [page, setPage] = useState22(0);
|
3912
3653
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
@@ -3915,7 +3656,7 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3915
3656
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3916
3657
|
}
|
3917
3658
|
}, [pageSize, onPageSize]);
|
3918
|
-
return /* @__PURE__ */
|
3659
|
+
return /* @__PURE__ */ React43.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React43.createElement(Grid, { tiles: pagesWithTiles[page], ref, edgeToEdge }), !edgeToEdge && /* @__PURE__ */ React43.createElement(
|
3919
3660
|
Pagination,
|
3920
3661
|
{
|
3921
3662
|
page,
|
@@ -3925,48 +3666,73 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3925
3666
|
},
|
3926
3667
|
numPages: pagesWithTiles.length
|
3927
3668
|
}
|
3928
|
-
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */
|
3669
|
+
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */ React43.createElement(InsetTile, null));
|
3929
3670
|
}
|
3930
3671
|
|
3931
3672
|
// src/Prebuilt/components/VideoLayouts/RoleProminence.tsx
|
3932
|
-
import
|
3933
|
-
import { selectLocalPeer as selectLocalPeer4, useHMSStore as
|
3673
|
+
import React46, { useEffect as useEffect12, useState as useState24 } from "react";
|
3674
|
+
import { selectLocalPeer as selectLocalPeer4, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
3934
3675
|
|
3935
3676
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3936
|
-
import
|
3677
|
+
import React45, { useEffect as useEffect11, useState as useState23 } from "react";
|
3937
3678
|
import { useMedia as useMedia9 } from "react-use";
|
3938
3679
|
|
3939
3680
|
// src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx
|
3940
|
-
import
|
3941
|
-
var Root = ({ children }) => /* @__PURE__ */
|
3681
|
+
import React44 from "react";
|
3682
|
+
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React44.createElement(
|
3683
|
+
Flex,
|
3684
|
+
{
|
3685
|
+
direction: "column",
|
3686
|
+
css: { h: "100%", flex: "1 1 0", minWidth: 0, gap: "$6", "@md": { gap: edgeToEdge ? 0 : "$6" } }
|
3687
|
+
},
|
3688
|
+
children
|
3689
|
+
);
|
3942
3690
|
var ProminentSection = ({ children, css = {} }) => {
|
3943
|
-
return /* @__PURE__ */
|
3691
|
+
return /* @__PURE__ */ React44.createElement(Flex, { direction: "column", css: __spreadValues({ flex: "1 1 0", gap: "$2", minHeight: 0 }, css) }, children);
|
3944
3692
|
};
|
3945
|
-
var SecondarySection = ({
|
3693
|
+
var SecondarySection = ({
|
3694
|
+
tiles,
|
3695
|
+
children,
|
3696
|
+
edgeToEdge
|
3697
|
+
}) => {
|
3946
3698
|
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
|
-
|
3699
|
+
if (!(tiles == null ? void 0 : tiles.length)) {
|
3700
|
+
return null;
|
3701
|
+
}
|
3702
|
+
return /* @__PURE__ */ React44.createElement(
|
3703
|
+
Box,
|
3704
|
+
{
|
3705
|
+
css: {
|
3706
|
+
display: "grid",
|
3707
|
+
gridTemplateRows: React44.Children.count(children) > 0 ? "136px auto" : "154px",
|
3708
|
+
gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`,
|
3709
|
+
margin: "0 auto",
|
3710
|
+
gap: "$2 $4",
|
3711
|
+
placeItems: "center",
|
3712
|
+
"@md": { gap: edgeToEdge ? 0 : "$4" }
|
3713
|
+
}
|
3714
|
+
},
|
3715
|
+
tiles.map((tile) => {
|
3716
|
+
var _a, _b, _c, _d;
|
3717
|
+
return /* @__PURE__ */ React44.createElement(
|
3718
|
+
VideoTile_default,
|
3719
|
+
__spreadValues({
|
3720
|
+
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
3721
|
+
peerId: (_c = tile.peer) == null ? void 0 : _c.id,
|
3722
|
+
trackId: (_d = tile.track) == null ? void 0 : _d.id,
|
3723
|
+
rootCSS: {
|
3724
|
+
padding: 0,
|
3725
|
+
maxWidth: 240,
|
3726
|
+
maxHeight: "100%",
|
3727
|
+
aspectRatio: 16 / 9,
|
3728
|
+
"@md": { aspectRatio: 1 }
|
3729
|
+
},
|
3730
|
+
objectFit: "contain"
|
3731
|
+
}, tileLayoutProps)
|
3732
|
+
);
|
3733
|
+
}),
|
3734
|
+
/* @__PURE__ */ React44.createElement(Box, { css: { gridColumn: `1/span ${tiles.length}` } }, children)
|
3735
|
+
);
|
3970
3736
|
};
|
3971
3737
|
var ProminenceLayout = {
|
3972
3738
|
Root,
|
@@ -3975,7 +3741,7 @@ var ProminenceLayout = {
|
|
3975
3741
|
};
|
3976
3742
|
|
3977
3743
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3978
|
-
var SecondaryTiles = ({ peers, onPageChange, onPageSize }) => {
|
3744
|
+
var SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
3979
3745
|
var _a;
|
3980
3746
|
const isMobile = useMedia9(config.media.md);
|
3981
3747
|
const maxTileCount = isMobile ? 2 : 4;
|
@@ -3987,7 +3753,7 @@ var SecondaryTiles = ({ peers, onPageChange, onPageSize }) => {
|
|
3987
3753
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3988
3754
|
}
|
3989
3755
|
}, [pageSize, onPageSize]);
|
3990
|
-
return /* @__PURE__ */
|
3756
|
+
return /* @__PURE__ */ React45.createElement(ProminenceLayout.SecondarySection, { tiles: pagesWithTiles[page], edgeToEdge }, !edgeToEdge && /* @__PURE__ */ React45.createElement(
|
3991
3757
|
Pagination,
|
3992
3758
|
{
|
3993
3759
|
page,
|
@@ -4010,7 +3776,7 @@ var useRoleProminencePeers = (prominentRoles, peers, isInsetEnabled) => {
|
|
4010
3776
|
if (pinnedTrack) {
|
4011
3777
|
if (pinnedTrack.peerId === peer.id) {
|
4012
3778
|
acc[0].push(peer);
|
4013
|
-
} else {
|
3779
|
+
} else if (!(isInsetEnabled && peer.isLocal)) {
|
4014
3780
|
acc[1].push(peer);
|
4015
3781
|
}
|
4016
3782
|
return acc;
|
@@ -4040,11 +3806,12 @@ function RoleProminence({
|
|
4040
3806
|
prominentRoles = [],
|
4041
3807
|
peers,
|
4042
3808
|
onPageChange,
|
4043
|
-
onPageSize
|
3809
|
+
onPageSize,
|
3810
|
+
edgeToEdge
|
4044
3811
|
}) {
|
4045
3812
|
var _a;
|
4046
3813
|
const { prominentPeers, secondaryPeers } = useRoleProminencePeers(prominentRoles, peers, isInsetEnabled);
|
4047
|
-
const localPeer =
|
3814
|
+
const localPeer = useHMSStore22(selectLocalPeer4);
|
4048
3815
|
const maxTileCount = 4;
|
4049
3816
|
const pageList = usePagesWithTiles({
|
4050
3817
|
peers: prominentPeers,
|
@@ -4061,7 +3828,7 @@ function RoleProminence({
|
|
4061
3828
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
4062
3829
|
}
|
4063
3830
|
}, [pageSize, onPageSize]);
|
4064
|
-
return /* @__PURE__ */
|
3831
|
+
return /* @__PURE__ */ React46.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React46.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React46.createElement(Grid, { ref, tiles: pagesWithTiles[page] })), !edgeToEdge && /* @__PURE__ */ React46.createElement(
|
4065
3832
|
Pagination,
|
4066
3833
|
{
|
4067
3834
|
page,
|
@@ -4071,15 +3838,16 @@ function RoleProminence({
|
|
4071
3838
|
},
|
4072
3839
|
numPages: pagesWithTiles.length
|
4073
3840
|
}
|
4074
|
-
), /* @__PURE__ */
|
3841
|
+
), /* @__PURE__ */ React46.createElement(SecondaryTiles, { peers: secondaryPeers, isInsetEnabled, edgeToEdge }), isInsetEnabled && localPeer && !prominentPeers.includes(localPeer) && /* @__PURE__ */ React46.createElement(InsetTile, null));
|
4075
3842
|
}
|
4076
3843
|
|
4077
3844
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
4078
|
-
import
|
4079
|
-
import {
|
3845
|
+
import React49, { useEffect as useEffect13, useMemo as useMemo5, useState as useState26 } from "react";
|
3846
|
+
import { useMedia as useMedia10 } from "react-use";
|
3847
|
+
import { selectPeersScreenSharing, useHMSStore as useHMSStore24 } from "@100mslive/react-sdk";
|
4080
3848
|
|
4081
3849
|
// src/Prebuilt/components/ScreenshareTile.jsx
|
4082
|
-
import
|
3850
|
+
import React48, { useRef as useRef7, useState as useState25 } from "react";
|
4083
3851
|
import { useFullscreen as useFullscreen2 } from "react-use";
|
4084
3852
|
import screenfull2 from "screenfull";
|
4085
3853
|
import {
|
@@ -4087,17 +3855,17 @@ import {
|
|
4087
3855
|
selectPeerByID as selectPeerByID2,
|
4088
3856
|
selectScreenShareAudioByPeerID,
|
4089
3857
|
selectScreenShareByPeerID,
|
4090
|
-
useHMSStore as
|
3858
|
+
useHMSStore as useHMSStore23
|
4091
3859
|
} from "@100mslive/react-sdk";
|
4092
3860
|
import { ExpandIcon as ExpandIcon3, ShrinkIcon } from "@100mslive/react-icons";
|
4093
3861
|
|
4094
3862
|
// src/Prebuilt/components/ScreenshareDisplay.jsx
|
4095
|
-
import
|
4096
|
-
import { useHMSActions as
|
3863
|
+
import React47 from "react";
|
3864
|
+
import { useHMSActions as useHMSActions13 } from "@100mslive/react-sdk";
|
4097
3865
|
import { CrossIcon as CrossIcon6, ShareScreenIcon as ShareScreenIcon2 } from "@100mslive/react-icons";
|
4098
3866
|
var ScreenshareDisplay = () => {
|
4099
|
-
const hmsActions =
|
4100
|
-
return /* @__PURE__ */
|
3867
|
+
const hmsActions = useHMSActions13();
|
3868
|
+
return /* @__PURE__ */ React47.createElement(
|
4101
3869
|
Flex,
|
4102
3870
|
{
|
4103
3871
|
direction: "column",
|
@@ -4109,9 +3877,9 @@ var ScreenshareDisplay = () => {
|
|
4109
3877
|
color: "$on_surface_high"
|
4110
3878
|
}
|
4111
3879
|
},
|
4112
|
-
/* @__PURE__ */
|
4113
|
-
/* @__PURE__ */
|
4114
|
-
/* @__PURE__ */
|
3880
|
+
/* @__PURE__ */ React47.createElement(ShareScreenIcon2, { width: 48, height: 48 }),
|
3881
|
+
/* @__PURE__ */ React47.createElement(Text, { variant: "h5", css: { m: "$8 0" } }, "You are sharing your screen"),
|
3882
|
+
/* @__PURE__ */ React47.createElement(
|
4115
3883
|
Button,
|
4116
3884
|
{
|
4117
3885
|
variant: "danger",
|
@@ -4121,7 +3889,7 @@ var ScreenshareDisplay = () => {
|
|
4121
3889
|
}),
|
4122
3890
|
"data-testid": "stop_screen_share_btn"
|
4123
3891
|
},
|
4124
|
-
/* @__PURE__ */
|
3892
|
+
/* @__PURE__ */ React47.createElement(CrossIcon6, { width: 18, height: 18 }),
|
4125
3893
|
"\xA0 Stop screen share"
|
4126
3894
|
)
|
4127
3895
|
);
|
@@ -4134,15 +3902,13 @@ var labelStyles = {
|
|
4134
3902
|
textAlign: "center",
|
4135
3903
|
c: "$on_surface_high",
|
4136
3904
|
transform: "none",
|
4137
|
-
mt: "$2",
|
4138
3905
|
flexShrink: 0
|
4139
3906
|
};
|
4140
3907
|
var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
4141
|
-
const isLocal =
|
4142
|
-
const track =
|
4143
|
-
const peer =
|
3908
|
+
const isLocal = useHMSStore23(selectLocalPeerID5) === peerId;
|
3909
|
+
const track = useHMSStore23(selectScreenShareByPeerID(peerId));
|
3910
|
+
const peer = useHMSStore23(selectPeerByID2(peerId));
|
4144
3911
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
4145
|
-
const isHeadless = useIsHeadless();
|
4146
3912
|
const [isMouseHovered, setIsMouseHovered] = useState25(false);
|
4147
3913
|
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
4148
3914
|
const label = getVideoTileLabel({
|
@@ -4150,63 +3916,76 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
4150
3916
|
isLocal: false,
|
4151
3917
|
track
|
4152
3918
|
});
|
4153
|
-
const fullscreenRef =
|
3919
|
+
const fullscreenRef = useRef7(null);
|
4154
3920
|
const [fullscreen, setFullscreen] = useState25(false);
|
4155
3921
|
const isFullscreen = useFullscreen2(fullscreenRef, fullscreen, {
|
4156
3922
|
onClose: () => setFullscreen(false)
|
4157
3923
|
});
|
4158
3924
|
const isFullScreenSupported = screenfull2.isEnabled;
|
4159
|
-
const audioTrack =
|
3925
|
+
const audioTrack = useHMSStore23(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
4160
3926
|
if (isLocal && !["browser", "window", "application"].includes(track == null ? void 0 : track.displaySurface)) {
|
4161
|
-
return /* @__PURE__ */
|
3927
|
+
return /* @__PURE__ */ React48.createElement(ScreenshareDisplay, null);
|
4162
3928
|
}
|
4163
3929
|
if (!peer) {
|
4164
3930
|
return null;
|
4165
3931
|
}
|
4166
|
-
return /* @__PURE__ */
|
3932
|
+
return /* @__PURE__ */ React48.createElement(StyledVideoTile.Root, { css: { width, height, p: 0, minHeight: 0 }, "data-testid": "screenshare_tile" }, /* @__PURE__ */ React48.createElement(
|
4167
3933
|
StyledVideoTile.Container,
|
4168
3934
|
{
|
4169
3935
|
transparentBg: true,
|
4170
3936
|
ref: fullscreenRef,
|
4171
|
-
css: { flexDirection: "column" },
|
3937
|
+
css: { flexDirection: "column", gap: "$2" },
|
4172
3938
|
onMouseEnter: () => setIsMouseHovered(true),
|
4173
3939
|
onMouseLeave: () => {
|
4174
3940
|
setIsMouseHovered(false);
|
4175
3941
|
}
|
4176
3942
|
},
|
4177
|
-
showStatsOnTiles ? /* @__PURE__ */
|
4178
|
-
isFullScreenSupported &&
|
4179
|
-
track ? /* @__PURE__ */
|
3943
|
+
showStatsOnTiles ? /* @__PURE__ */ React48.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
3944
|
+
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */ React48.createElement(StyledVideoTile.FullScreenButton, { onClick: () => setFullscreen(!fullscreen) }, isFullscreen ? /* @__PURE__ */ React48.createElement(ShrinkIcon, null) : /* @__PURE__ */ React48.createElement(ExpandIcon3, null)) : null,
|
3945
|
+
track ? /* @__PURE__ */ React48.createElement(
|
4180
3946
|
Video,
|
4181
3947
|
{
|
4182
3948
|
screenShare: true,
|
4183
3949
|
mirror: peer.isLocal && (track == null ? void 0 : track.source) === "regular",
|
4184
3950
|
attach: !isAudioOnly,
|
4185
|
-
trackId: track.id
|
3951
|
+
trackId: track.id,
|
3952
|
+
css: { minHeight: 0 }
|
4186
3953
|
}
|
4187
3954
|
) : null,
|
4188
|
-
/* @__PURE__ */
|
4189
|
-
isMouseHovered && !
|
3955
|
+
/* @__PURE__ */ React48.createElement(StyledVideoTile.Info, { css: labelStyles }, label),
|
3956
|
+
isMouseHovered && !(peer == null ? void 0 : peer.isLocal) ? /* @__PURE__ */ React48.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
3957
|
));
|
4191
3958
|
};
|
4192
|
-
var ScreenshareTile =
|
3959
|
+
var ScreenshareTile = React48.memo(Tile);
|
4193
3960
|
var ScreenshareTile_default = ScreenshareTile;
|
4194
3961
|
|
4195
3962
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
4196
|
-
var ScreenshareLayout = ({ peers, onPageChange, onPageSize }) => {
|
3963
|
+
var ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
4197
3964
|
var _a;
|
4198
|
-
const peersSharing =
|
3965
|
+
const peersSharing = useHMSStore24(selectPeersScreenSharing);
|
4199
3966
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
4200
3967
|
const [page, setPage] = useState26(0);
|
4201
|
-
const
|
4202
|
-
const
|
3968
|
+
const activeSharePeer = peersSharing[page];
|
3969
|
+
const isMobile = useMedia10(config.media.md);
|
3970
|
+
const secondaryPeers = useMemo5(
|
3971
|
+
() => 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)),
|
3972
|
+
[activeSharePeer, peers, isMobile]
|
3973
|
+
);
|
4203
3974
|
useEffect13(() => {
|
4204
|
-
setActiveScreenSharePeer(
|
3975
|
+
setActiveScreenSharePeer(isMobile ? "" : activeSharePeer == null ? void 0 : activeSharePeer.id);
|
4205
3976
|
return () => {
|
4206
3977
|
setActiveScreenSharePeer("");
|
4207
3978
|
};
|
4208
|
-
}, [
|
4209
|
-
return /* @__PURE__ */
|
3979
|
+
}, [activeSharePeer == null ? void 0 : activeSharePeer.id, isMobile, setActiveScreenSharePeer]);
|
3980
|
+
return /* @__PURE__ */ React49.createElement(ProminenceLayout.Root, { edgeToEdge }, /* @__PURE__ */ React49.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React49.createElement(ScreenshareTile_default, { peerId: (_a = peersSharing[page]) == null ? void 0 : _a.id }), !edgeToEdge && /* @__PURE__ */ React49.createElement(Pagination, { page, onPageChange: setPage, numPages: peersSharing.length })), /* @__PURE__ */ React49.createElement(
|
3981
|
+
SecondaryTiles,
|
3982
|
+
{
|
3983
|
+
peers: secondaryPeers,
|
3984
|
+
onPageChange,
|
3985
|
+
onPageSize,
|
3986
|
+
edgeToEdge
|
3987
|
+
}
|
3988
|
+
));
|
4210
3989
|
};
|
4211
3990
|
|
4212
3991
|
// src/Prebuilt/common/PeersSorter.ts
|
@@ -4255,7 +4034,7 @@ var PeersSorter = class {
|
|
4255
4034
|
}
|
4256
4035
|
this.lruPeers.delete(speaker.id);
|
4257
4036
|
const lruPeerArray = Array.from(this.lruPeers);
|
4258
|
-
while (lruPeerArray.length >= this.tilesPerPage) {
|
4037
|
+
while (lruPeerArray.length >= this.tilesPerPage && lruPeerArray.length) {
|
4259
4038
|
lruPeerArray.pop();
|
4260
4039
|
}
|
4261
4040
|
this.lruPeers = /* @__PURE__ */ new Set([speaker.id, ...lruPeerArray]);
|
@@ -4299,14 +4078,24 @@ var GridLayout = ({
|
|
4299
4078
|
hide_participant_name_on_tile = false,
|
4300
4079
|
rounded_video_tile = true,
|
4301
4080
|
hide_audio_mute_on_tile = false,
|
4302
|
-
video_object_fit = "contain"
|
4081
|
+
video_object_fit = "contain",
|
4082
|
+
edge_to_edge = false,
|
4083
|
+
hide_metadata_on_tile = false
|
4303
4084
|
}) => {
|
4304
|
-
const peerSharing =
|
4085
|
+
const peerSharing = useHMSStore25(selectPeerScreenSharing);
|
4305
4086
|
const pinnedTrack = usePinnedTrack();
|
4306
|
-
const
|
4307
|
-
const
|
4087
|
+
const peers = useHMSStore25(selectPeers2);
|
4088
|
+
const isRoleProminence = prominentRoles.length && peers.some(
|
4089
|
+
(peer) => peer.roleName && prominentRoles.includes(peer.roleName) && (peer.videoTrack || peer.audioTrack)
|
4090
|
+
) || pinnedTrack;
|
4091
|
+
const updatedPeers = useMemo6(() => {
|
4092
|
+
if (isInsetEnabled && !isRoleProminence && !peerSharing) {
|
4093
|
+
return peers.filter((peer) => !peer.isLocal);
|
4094
|
+
}
|
4095
|
+
return peers;
|
4096
|
+
}, [isInsetEnabled, isRoleProminence, peerSharing, peers]);
|
4308
4097
|
const vanillaStore = useHMSVanillaStore4();
|
4309
|
-
const [sortedPeers, setSortedPeers] = useState27(
|
4098
|
+
const [sortedPeers, setSortedPeers] = useState27(updatedPeers);
|
4310
4099
|
const peersSorter = useMemo6(() => new PeersSorter_default(vanillaStore), [vanillaStore]);
|
4311
4100
|
const [pageSize, setPageSize] = useState27(0);
|
4312
4101
|
const [mainPage, setMainPage] = useState27(0);
|
@@ -4315,6 +4104,7 @@ var GridLayout = ({
|
|
4315
4104
|
hideParticipantNameOnTile: hide_participant_name_on_tile,
|
4316
4105
|
roundedVideoTile: rounded_video_tile,
|
4317
4106
|
hideAudioMuteOnTile: hide_audio_mute_on_tile,
|
4107
|
+
hideMetadataOnTile: hide_metadata_on_tile,
|
4318
4108
|
objectFit: video_object_fit
|
4319
4109
|
};
|
4320
4110
|
useEffect14(() => {
|
@@ -4322,83 +4112,82 @@ var GridLayout = ({
|
|
4322
4112
|
return;
|
4323
4113
|
}
|
4324
4114
|
peersSorter.setPeersAndTilesPerPage({
|
4325
|
-
peers,
|
4115
|
+
peers: updatedPeers,
|
4326
4116
|
tilesPerPage: pageSize
|
4327
4117
|
});
|
4328
4118
|
peersSorter.onUpdate(setSortedPeers);
|
4329
|
-
}, [mainPage, peersSorter,
|
4119
|
+
}, [mainPage, peersSorter, updatedPeers, pageSize]);
|
4330
4120
|
if (peerSharing) {
|
4331
|
-
return /* @__PURE__ */
|
4121
|
+
return /* @__PURE__ */ React50.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React50.createElement(
|
4122
|
+
ScreenshareLayout,
|
4123
|
+
{
|
4124
|
+
peers: sortedPeers,
|
4125
|
+
onPageSize: setPageSize,
|
4126
|
+
onPageChange: setMainPage,
|
4127
|
+
edgeToEdge: edge_to_edge
|
4128
|
+
}
|
4129
|
+
));
|
4332
4130
|
} else if (isRoleProminence) {
|
4333
|
-
return /* @__PURE__ */
|
4131
|
+
return /* @__PURE__ */ React50.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React50.createElement(
|
4334
4132
|
RoleProminence,
|
4335
4133
|
{
|
4336
4134
|
peers: sortedPeers,
|
4337
4135
|
onPageSize: setPageSize,
|
4338
4136
|
onPageChange: setMainPage,
|
4339
4137
|
prominentRoles,
|
4340
|
-
isInsetEnabled
|
4138
|
+
isInsetEnabled,
|
4139
|
+
edgeToEdge: edge_to_edge
|
4341
4140
|
}
|
4342
4141
|
));
|
4343
4142
|
}
|
4344
|
-
return /* @__PURE__ */
|
4143
|
+
return /* @__PURE__ */ React50.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React50.createElement(
|
4345
4144
|
EqualProminence,
|
4346
4145
|
{
|
4347
4146
|
peers: sortedPeers,
|
4348
4147
|
onPageSize: setPageSize,
|
4349
4148
|
onPageChange: setMainPage,
|
4350
|
-
isInsetEnabled
|
4149
|
+
isInsetEnabled,
|
4150
|
+
edgeToEdge: edge_to_edge
|
4351
4151
|
}
|
4352
4152
|
));
|
4353
4153
|
};
|
4354
4154
|
|
4355
4155
|
// src/Prebuilt/layouts/EmbedView.jsx
|
4356
|
-
import
|
4156
|
+
import React51, { useCallback as useCallback8, useEffect as useEffect15, useMemo as useMemo7, useRef as useRef8, useState as useState28 } from "react";
|
4357
4157
|
import {
|
4358
|
-
|
4359
|
-
selectLocalPeerRoleName,
|
4360
|
-
selectPeers as selectPeers4,
|
4158
|
+
selectPeers as selectPeers3,
|
4361
4159
|
selectPeerScreenSharing as selectPeerScreenSharing2,
|
4362
4160
|
throwErrorHandler,
|
4363
|
-
useHMSStore as
|
4161
|
+
useHMSStore as useHMSStore26,
|
4364
4162
|
useScreenShare as useScreenShare3
|
4365
4163
|
} from "@100mslive/react-sdk";
|
4366
4164
|
var EmbedView = () => {
|
4367
|
-
return /* @__PURE__ */
|
4165
|
+
return /* @__PURE__ */ React51.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React51.createElement(EmbedComponent, null));
|
4368
4166
|
};
|
4369
4167
|
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;
|
4168
|
+
const peers = useHMSStore26(selectPeers3);
|
4169
|
+
const peerPresenting = useHMSStore26(selectPeerScreenSharing2);
|
4378
4170
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
4379
4171
|
const smallTilePeers = useMemo7(() => {
|
4380
4172
|
const smallTilePeers2 = peers.filter((peer) => peer.id !== (peerPresenting == null ? void 0 : peerPresenting.id));
|
4381
|
-
if (showPresenterInSmallTile && peerPresenting) {
|
4382
|
-
smallTilePeers2.unshift(peerPresenting);
|
4383
|
-
}
|
4384
4173
|
return smallTilePeers2;
|
4385
|
-
}, [peers, peerPresenting
|
4174
|
+
}, [peers, peerPresenting]);
|
4386
4175
|
useEffect15(() => {
|
4387
4176
|
setActiveScreenSharePeer(peerPresenting == null ? void 0 : peerPresenting.id);
|
4388
4177
|
return () => {
|
4389
4178
|
setActiveScreenSharePeer("");
|
4390
4179
|
};
|
4391
4180
|
}, [peerPresenting == null ? void 0 : peerPresenting.id, setActiveScreenSharePeer]);
|
4392
|
-
return /* @__PURE__ */
|
4181
|
+
return /* @__PURE__ */ React51.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React51.createElement(ProminenceLayout.ProminentSection, null, children), /* @__PURE__ */ React51.createElement(SecondaryTiles, { peers: smallTilePeers }));
|
4393
4182
|
};
|
4394
4183
|
var EmbedComponent = () => {
|
4395
4184
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare3(throwErrorHandler);
|
4396
4185
|
const [embedConfig, setEmbedConfig] = useSetAppDataByKey(APP_DATA.embedConfig);
|
4397
4186
|
const [wasScreenShared, setWasScreenShared] = useState28(false);
|
4398
|
-
const screenShareAttemptInProgress =
|
4187
|
+
const screenShareAttemptInProgress = useRef8(false);
|
4399
4188
|
const src = embedConfig.url;
|
4400
|
-
const iframeRef =
|
4401
|
-
const resetEmbedConfig =
|
4189
|
+
const iframeRef = useRef8();
|
4190
|
+
const resetEmbedConfig = useCallback8(() => {
|
4402
4191
|
if (src) {
|
4403
4192
|
setEmbedConfig({ url: "" });
|
4404
4193
|
}
|
@@ -4427,7 +4216,7 @@ var EmbedComponent = () => {
|
|
4427
4216
|
}
|
4428
4217
|
};
|
4429
4218
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4430
|
-
return /* @__PURE__ */
|
4219
|
+
return /* @__PURE__ */ React51.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React51.createElement(
|
4431
4220
|
"iframe",
|
4432
4221
|
{
|
4433
4222
|
src,
|
@@ -4440,13 +4229,13 @@ var EmbedComponent = () => {
|
|
4440
4229
|
};
|
4441
4230
|
|
4442
4231
|
// src/Prebuilt/layouts/PDFView.jsx
|
4443
|
-
import
|
4232
|
+
import React52, { useCallback as useCallback9, useEffect as useEffect16, useRef as useRef9, useState as useState29 } from "react";
|
4444
4233
|
import { throwErrorHandler as throwErrorHandler2, useScreenShare as useScreenShare4 } from "@100mslive/react-sdk";
|
4445
4234
|
var PDFView = () => {
|
4446
|
-
return /* @__PURE__ */
|
4235
|
+
return /* @__PURE__ */ React52.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React52.createElement(PDFEmbedComponent, null));
|
4447
4236
|
};
|
4448
4237
|
var PDFEmbedComponent = () => {
|
4449
|
-
const ref =
|
4238
|
+
const ref = useRef9();
|
4450
4239
|
const themeType = useTheme().themeType;
|
4451
4240
|
const [isPDFLoaded, setIsPDFLoaded] = useState29(false);
|
4452
4241
|
let pdfJSURL = define_process_env_default.REACT_APP_PDFJS_IFRAME_URL;
|
@@ -4456,9 +4245,9 @@ var PDFEmbedComponent = () => {
|
|
4456
4245
|
pdfJSURL = pdfJSURL + "?file=" + encodeURIComponent(pdfConfig.url);
|
4457
4246
|
}
|
4458
4247
|
const [wasScreenShared, setWasScreenShared] = useState29(false);
|
4459
|
-
const screenShareAttemptInProgress =
|
4460
|
-
const iframeRef =
|
4461
|
-
const resetEmbedConfig =
|
4248
|
+
const screenShareAttemptInProgress = useRef9(false);
|
4249
|
+
const iframeRef = useRef9();
|
4250
|
+
const resetEmbedConfig = useCallback9(() => {
|
4462
4251
|
setPDFConfig({ state: false });
|
4463
4252
|
}, [setPDFConfig]);
|
4464
4253
|
useEffect16(() => {
|
@@ -4496,7 +4285,7 @@ var PDFEmbedComponent = () => {
|
|
4496
4285
|
}
|
4497
4286
|
};
|
4498
4287
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4499
|
-
return /* @__PURE__ */
|
4288
|
+
return /* @__PURE__ */ React52.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React52.createElement(
|
4500
4289
|
"iframe",
|
4501
4290
|
{
|
4502
4291
|
src: pdfJSURL,
|
@@ -4529,61 +4318,61 @@ var PDFEmbedComponent = () => {
|
|
4529
4318
|
};
|
4530
4319
|
|
4531
4320
|
// src/Prebuilt/layouts/SidePane.tsx
|
4532
|
-
import
|
4533
|
-
import { useMedia as
|
4534
|
-
import { selectAppData as selectAppData3, selectVideoTrackByPeerID, useHMSStore as
|
4321
|
+
import React58 from "react";
|
4322
|
+
import { useMedia as useMedia14 } from "react-use";
|
4323
|
+
import { selectAppData as selectAppData3, selectVideoTrackByPeerID, useHMSStore as useHMSStore34 } from "@100mslive/react-sdk";
|
4535
4324
|
|
4536
4325
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4537
|
-
import
|
4538
|
-
import { useMedia as
|
4326
|
+
import React55, { useCallback as useCallback14, useEffect as useEffect20, useRef as useRef13, useState as useState32 } from "react";
|
4327
|
+
import { useMedia as useMedia13 } from "react-use";
|
4539
4328
|
import {
|
4540
4329
|
HMSNotificationTypes,
|
4541
4330
|
selectHMSMessagesCount,
|
4542
4331
|
selectPeerNameByID as selectPeerNameByID3,
|
4543
|
-
selectPermissions as
|
4332
|
+
selectPermissions as selectPermissions10,
|
4544
4333
|
selectSessionStore,
|
4545
|
-
useHMSActions as
|
4334
|
+
useHMSActions as useHMSActions18,
|
4546
4335
|
useHMSNotifications,
|
4547
|
-
useHMSStore as
|
4336
|
+
useHMSStore as useHMSStore31
|
4548
4337
|
} from "@100mslive/react-sdk";
|
4549
4338
|
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as CrossIcon7, PinIcon as PinIcon2 } from "@100mslive/react-icons";
|
4550
4339
|
|
4551
4340
|
// src/Prebuilt/components/Chat/ChatBody.jsx
|
4552
|
-
import
|
4341
|
+
import React53, { Fragment as Fragment8, useCallback as useCallback11, useEffect as useEffect17, useLayoutEffect, useMemo as useMemo8, useRef as useRef10, useState as useState30 } from "react";
|
4553
4342
|
import { useInView } from "react-intersection-observer";
|
4554
|
-
import { useMedia as
|
4343
|
+
import { useMedia as useMedia11 } from "react-use";
|
4555
4344
|
import AutoSizer from "react-virtualized-auto-sizer";
|
4556
4345
|
import { VariableSizeList } from "react-window";
|
4557
4346
|
import {
|
4558
4347
|
selectHMSMessages,
|
4559
|
-
selectLocalPeerID as
|
4560
|
-
selectLocalPeerRoleName
|
4348
|
+
selectLocalPeerID as selectLocalPeerID6,
|
4349
|
+
selectLocalPeerRoleName,
|
4561
4350
|
selectMessagesByPeerID,
|
4562
4351
|
selectMessagesByRole,
|
4563
4352
|
selectPeerNameByID as selectPeerNameByID2,
|
4564
|
-
selectPermissions as
|
4565
|
-
useHMSActions as
|
4566
|
-
useHMSStore as
|
4353
|
+
selectPermissions as selectPermissions9,
|
4354
|
+
useHMSActions as useHMSActions15,
|
4355
|
+
useHMSStore as useHMSStore28
|
4567
4356
|
} from "@100mslive/react-sdk";
|
4568
|
-
import {
|
4357
|
+
import { PinIcon, VerticalMenuIcon as VerticalMenuIcon5 } from "@100mslive/react-icons";
|
4569
4358
|
|
4570
4359
|
// src/Prebuilt/images/empty-chat.svg
|
4571
4360
|
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
4361
|
|
4573
4362
|
// src/Prebuilt/components/hooks/useSetPinnedMessage.js
|
4574
|
-
import { useCallback as
|
4363
|
+
import { useCallback as useCallback10 } from "react";
|
4575
4364
|
import {
|
4576
4365
|
selectPeerNameByID,
|
4577
4366
|
selectSessionMetadata,
|
4578
|
-
useHMSActions as
|
4579
|
-
useHMSStore as
|
4367
|
+
useHMSActions as useHMSActions14,
|
4368
|
+
useHMSStore as useHMSStore27,
|
4580
4369
|
useHMSVanillaStore as useHMSVanillaStore5
|
4581
4370
|
} from "@100mslive/react-sdk";
|
4582
4371
|
var useSetPinnedMessage = () => {
|
4583
|
-
const hmsActions =
|
4372
|
+
const hmsActions = useHMSActions14();
|
4584
4373
|
const vanillaStore = useHMSVanillaStore5();
|
4585
|
-
const pinnedMessage =
|
4586
|
-
const setPinnedMessage =
|
4374
|
+
const pinnedMessage = useHMSStore27(selectSessionMetadata);
|
4375
|
+
const setPinnedMessage = useCallback10(
|
4587
4376
|
/**
|
4588
4377
|
* @param {import("@100mslive/react-sdk").HMSMessage | undefined} message
|
4589
4378
|
*/
|
@@ -4616,7 +4405,7 @@ var formatTime = (date) => {
|
|
4616
4405
|
return `${hours}:${mins} ${suffix}`;
|
4617
4406
|
};
|
4618
4407
|
var MessageTypeContainer = ({ left, right }) => {
|
4619
|
-
return /* @__PURE__ */
|
4408
|
+
return /* @__PURE__ */ React53.createElement(
|
4620
4409
|
Flex,
|
4621
4410
|
{
|
4622
4411
|
align: "center",
|
@@ -4628,16 +4417,16 @@ var MessageTypeContainer = ({ left, right }) => {
|
|
4628
4417
|
r: "$0"
|
4629
4418
|
}
|
4630
4419
|
},
|
4631
|
-
left && /* @__PURE__ */
|
4632
|
-
left && right && /* @__PURE__ */
|
4633
|
-
right && /* @__PURE__ */
|
4420
|
+
left && /* @__PURE__ */ React53.createElement(SenderName, { variant: "tiny", as: "span", css: { color: "$on_surface_medium" } }, left),
|
4421
|
+
left && right && /* @__PURE__ */ React53.createElement(Box, { css: { borderLeft: "1px solid $border_bright", mx: "$4", h: "$8" } }),
|
4422
|
+
right && /* @__PURE__ */ React53.createElement(SenderName, { as: "span", variant: "tiny", css: { textTransform: "uppercase" } }, right)
|
4634
4423
|
);
|
4635
4424
|
};
|
4636
4425
|
var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
4637
|
-
const peerName =
|
4638
|
-
const localPeerRoleName =
|
4426
|
+
const peerName = useHMSStore28(selectPeerNameByID2(receiver));
|
4427
|
+
const localPeerRoleName = useHMSStore28(selectLocalPeerRoleName);
|
4639
4428
|
if (receiver) {
|
4640
|
-
return /* @__PURE__ */
|
4429
|
+
return /* @__PURE__ */ React53.createElement(
|
4641
4430
|
MessageTypeContainer,
|
4642
4431
|
{
|
4643
4432
|
left: hasCurrentUserSent ? `${peerName ? `TO ${peerName}` : ""}` : "TO YOU",
|
@@ -4646,7 +4435,7 @@ var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
|
4646
4435
|
);
|
4647
4436
|
}
|
4648
4437
|
if (roles && roles.length) {
|
4649
|
-
return /* @__PURE__ */
|
4438
|
+
return /* @__PURE__ */ React53.createElement(MessageTypeContainer, { left: "TO", right: hasCurrentUserSent ? roles.join(",") : localPeerRoleName });
|
4650
4439
|
}
|
4651
4440
|
return null;
|
4652
4441
|
};
|
@@ -4660,10 +4449,10 @@ var Link = styled("a", {
|
|
4660
4449
|
});
|
4661
4450
|
var AnnotisedMessage = ({ message }) => {
|
4662
4451
|
if (!message) {
|
4663
|
-
return /* @__PURE__ */
|
4452
|
+
return /* @__PURE__ */ React53.createElement(Fragment8, null);
|
4664
4453
|
}
|
4665
|
-
return /* @__PURE__ */
|
4666
|
-
(part) => URL_REGEX.test(part) ? /* @__PURE__ */
|
4454
|
+
return /* @__PURE__ */ React53.createElement(Fragment8, null, message.trim().split(/(\s)/).map(
|
4455
|
+
(part) => URL_REGEX.test(part) ? /* @__PURE__ */ React53.createElement(Link, { href: part, key: part, target: "_blank", rel: "noopener noreferrer" }, part) : part
|
4667
4456
|
));
|
4668
4457
|
};
|
4669
4458
|
var getMessageType = ({ roles, receiver }) => {
|
@@ -4672,42 +4461,19 @@ var getMessageType = ({ roles, receiver }) => {
|
|
4672
4461
|
}
|
4673
4462
|
return receiver ? "private" : "";
|
4674
4463
|
};
|
4675
|
-
var ChatActions = ({ onPin, showPinAction
|
4464
|
+
var ChatActions = ({ onPin, showPinAction }) => {
|
4676
4465
|
const [open, setOpen] = useState30(false);
|
4677
|
-
|
4678
|
-
if (!isMobile && !showPinAction) {
|
4466
|
+
if (!showPinAction) {
|
4679
4467
|
return null;
|
4680
4468
|
}
|
4681
|
-
return /* @__PURE__ */
|
4469
|
+
return /* @__PURE__ */ React53.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React53.createElement(Dropdown.Trigger, { className: "chat_actions", css: { opacity: open ? 1 : 0, "@md": { opacity: 1 } }, asChild: true }, /* @__PURE__ */ React53.createElement(IconButton, null, /* @__PURE__ */ React53.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React53.createElement(VerticalMenuIcon5, null)))), /* @__PURE__ */ React53.createElement(Dropdown.Portal, null, /* @__PURE__ */ React53.createElement(
|
4682
4470
|
Dropdown.Content,
|
4683
4471
|
{
|
4684
4472
|
sideOffset: 5,
|
4685
4473
|
align: "end",
|
4686
4474
|
css: { width: "$48", backgroundColor: "$surface_bright", py: "$0", border: "1px solid $border_bright" }
|
4687
4475
|
},
|
4688
|
-
/* @__PURE__ */
|
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
|
4476
|
+
/* @__PURE__ */ React53.createElement(Dropdown.Item, { "data-testid": "pin_message_btn", onClick: onPin }, /* @__PURE__ */ React53.createElement(PinIcon, null), /* @__PURE__ */ React53.createElement(Text, { variant: "sm", css: { ml: "$4" } }, "Pin Message"))
|
4711
4477
|
)));
|
4712
4478
|
};
|
4713
4479
|
var SenderName = styled(Text, {
|
@@ -4719,29 +4485,32 @@ var SenderName = styled(Text, {
|
|
4719
4485
|
color: "$on_surface_high",
|
4720
4486
|
fontWeight: "$semiBold"
|
4721
4487
|
});
|
4722
|
-
var ChatMessage =
|
4488
|
+
var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPin }) => {
|
4489
|
+
var _a, _b;
|
4723
4490
|
const { ref, inView } = useInView({ threshold: 0.5, triggerOnce: true });
|
4724
|
-
const rowRef =
|
4491
|
+
const rowRef = useRef10(null);
|
4725
4492
|
useEffect17(() => {
|
4726
4493
|
if (rowRef.current) {
|
4727
4494
|
setRowHeight(index, rowRef.current.clientHeight);
|
4728
4495
|
}
|
4729
4496
|
}, [index, setRowHeight]);
|
4730
|
-
const isMobile =
|
4731
|
-
const
|
4732
|
-
const
|
4733
|
-
const
|
4497
|
+
const isMobile = useMedia11(config.media.md);
|
4498
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4499
|
+
const isOverlay = ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
4500
|
+
const hmsActions = useHMSActions15();
|
4501
|
+
const localPeerId = useHMSStore28(selectLocalPeerID6);
|
4502
|
+
const permissions = useHMSStore28(selectPermissions9);
|
4734
4503
|
const messageType = getMessageType({
|
4735
4504
|
roles: message.recipientRoles,
|
4736
4505
|
receiver: message.recipientPeer
|
4737
4506
|
});
|
4738
|
-
const showPinAction = permissions.removeOthers && !messageType;
|
4507
|
+
const showPinAction = permissions.removeOthers && !messageType && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.allow_pinning_messages);
|
4739
4508
|
useEffect17(() => {
|
4740
4509
|
if (message.id && !message.read && inView) {
|
4741
4510
|
hmsActions.setMessageRead(true, message.id);
|
4742
4511
|
}
|
4743
4512
|
}, [message.read, hmsActions, inView, message.id]);
|
4744
|
-
return /* @__PURE__ */
|
4513
|
+
return /* @__PURE__ */ React53.createElement(
|
4745
4514
|
Box,
|
4746
4515
|
{
|
4747
4516
|
ref,
|
@@ -4749,7 +4518,7 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4749
4518
|
css: { mb: "$10", pr: "$10", mt: "$8", "&:hover .chat_actions": { opacity: 1 } },
|
4750
4519
|
style
|
4751
4520
|
},
|
4752
|
-
/* @__PURE__ */
|
4521
|
+
/* @__PURE__ */ React53.createElement(
|
4753
4522
|
Flex,
|
4754
4523
|
{
|
4755
4524
|
ref: rowRef,
|
@@ -4757,7 +4526,7 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4757
4526
|
css: {
|
4758
4527
|
flexWrap: "wrap",
|
4759
4528
|
// Theme independent color, token should not be used for transparent chat
|
4760
|
-
bg: messageType ?
|
4529
|
+
bg: messageType ? isOverlay ? "rgba(0, 0, 0, 0.64)" : "$surface_default" : void 0,
|
4761
4530
|
r: messageType ? "$1" : void 0,
|
4762
4531
|
px: messageType ? "$4" : "$2",
|
4763
4532
|
py: messageType ? "$4" : 0,
|
@@ -4766,11 +4535,11 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4766
4535
|
key: message.time,
|
4767
4536
|
"data-testid": "chat_msg"
|
4768
4537
|
},
|
4769
|
-
/* @__PURE__ */
|
4538
|
+
/* @__PURE__ */ React53.createElement(
|
4770
4539
|
Text,
|
4771
4540
|
{
|
4772
4541
|
css: {
|
4773
|
-
color: "$on_surface_high",
|
4542
|
+
color: isOverlay ? "#FFF" : "$on_surface_high",
|
4774
4543
|
fontWeight: "$semiBold",
|
4775
4544
|
display: "inline-flex",
|
4776
4545
|
alignItems: "center",
|
@@ -4779,20 +4548,20 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4779
4548
|
},
|
4780
4549
|
as: "div"
|
4781
4550
|
},
|
4782
|
-
/* @__PURE__ */
|
4551
|
+
/* @__PURE__ */ React53.createElement(Flex, { align: "baseline" }, message.senderName === "You" || !message.senderName ? /* @__PURE__ */ React53.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName || "Anonymous") : /* @__PURE__ */ React53.createElement(Tooltip, { title: message.senderName, side: "top", align: "start" }, /* @__PURE__ */ React53.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName)), !isOverlay ? /* @__PURE__ */ React53.createElement(
|
4783
4552
|
Text,
|
4784
4553
|
{
|
4785
4554
|
as: "span",
|
4786
4555
|
variant: "xs",
|
4787
4556
|
css: {
|
4788
4557
|
ml: "$4",
|
4789
|
-
color: "$
|
4558
|
+
color: "$on_surface_medium",
|
4790
4559
|
flexShrink: 0
|
4791
4560
|
}
|
4792
4561
|
},
|
4793
4562
|
formatTime(message.time)
|
4794
4563
|
) : null),
|
4795
|
-
/* @__PURE__ */
|
4564
|
+
/* @__PURE__ */ React53.createElement(
|
4796
4565
|
MessageType,
|
4797
4566
|
{
|
4798
4567
|
hasCurrentUserSent: message.sender === localPeerId,
|
@@ -4800,27 +4569,28 @@ var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4800
4569
|
roles: message.recipientRoles
|
4801
4570
|
}
|
4802
4571
|
),
|
4803
|
-
!
|
4572
|
+
!isOverlay ? /* @__PURE__ */ React53.createElement(ChatActions, { onPin, showPinAction }) : null
|
4804
4573
|
),
|
4805
|
-
/* @__PURE__ */
|
4574
|
+
/* @__PURE__ */ React53.createElement(
|
4806
4575
|
Text,
|
4807
4576
|
{
|
4808
|
-
variant: "
|
4577
|
+
variant: "sm",
|
4809
4578
|
css: {
|
4810
4579
|
w: "100%",
|
4811
4580
|
mt: "$2",
|
4812
4581
|
wordBreak: "break-word",
|
4813
4582
|
whiteSpace: "pre-wrap",
|
4814
|
-
userSelect: "all"
|
4583
|
+
userSelect: "all",
|
4584
|
+
color: isOverlay ? "#FFF" : "$on_surface_high"
|
4815
4585
|
},
|
4816
4586
|
onClick: (e) => e.stopPropagation()
|
4817
4587
|
},
|
4818
|
-
/* @__PURE__ */
|
4588
|
+
/* @__PURE__ */ React53.createElement(AnnotisedMessage, { message: message.message })
|
4819
4589
|
)
|
4820
4590
|
)
|
4821
4591
|
);
|
4822
4592
|
});
|
4823
|
-
var ChatList =
|
4593
|
+
var ChatList = React53.forwardRef(
|
4824
4594
|
({ width, height, setRowHeight, getRowHeight, messages, scrollToBottom }, listRef) => {
|
4825
4595
|
const { setPinnedMessage } = useSetPinnedMessage();
|
4826
4596
|
useLayoutEffect(() => {
|
@@ -4828,7 +4598,7 @@ var ChatList = React52.forwardRef(
|
|
4828
4598
|
scrollToBottom(1);
|
4829
4599
|
}
|
4830
4600
|
}, [listRef]);
|
4831
|
-
return /* @__PURE__ */
|
4601
|
+
return /* @__PURE__ */ React53.createElement(
|
4832
4602
|
VariableSizeList,
|
4833
4603
|
{
|
4834
4604
|
ref: listRef,
|
@@ -4840,7 +4610,7 @@ var ChatList = React52.forwardRef(
|
|
4840
4610
|
overflowX: "hidden"
|
4841
4611
|
}
|
4842
4612
|
},
|
4843
|
-
({ index, style }) => /* @__PURE__ */
|
4613
|
+
({ index, style }) => /* @__PURE__ */ React53.createElement(
|
4844
4614
|
ChatMessage,
|
4845
4615
|
{
|
4846
4616
|
style,
|
@@ -4854,19 +4624,19 @@ var ChatList = React52.forwardRef(
|
|
4854
4624
|
);
|
4855
4625
|
}
|
4856
4626
|
);
|
4857
|
-
var VirtualizedChatMessages =
|
4858
|
-
const rowHeights =
|
4627
|
+
var VirtualizedChatMessages = React53.forwardRef(({ messages, scrollToBottom }, listRef) => {
|
4628
|
+
const rowHeights = useRef10({});
|
4859
4629
|
function getRowHeight(index) {
|
4860
4630
|
return rowHeights.current[index] + 16 || 72;
|
4861
4631
|
}
|
4862
|
-
const setRowHeight =
|
4632
|
+
const setRowHeight = useCallback11(
|
4863
4633
|
(index, size) => {
|
4864
4634
|
listRef.current.resetAfterIndex(0);
|
4865
4635
|
rowHeights.current = __spreadProps(__spreadValues({}, rowHeights.current), { [index]: size });
|
4866
4636
|
},
|
4867
4637
|
[listRef]
|
4868
4638
|
);
|
4869
|
-
return /* @__PURE__ */
|
4639
|
+
return /* @__PURE__ */ React53.createElement(
|
4870
4640
|
Box,
|
4871
4641
|
{
|
4872
4642
|
css: {
|
@@ -4875,14 +4645,14 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4875
4645
|
},
|
4876
4646
|
as: "div"
|
4877
4647
|
},
|
4878
|
-
/* @__PURE__ */
|
4648
|
+
/* @__PURE__ */ React53.createElement(
|
4879
4649
|
AutoSizer,
|
4880
4650
|
{
|
4881
4651
|
style: {
|
4882
4652
|
width: "90%"
|
4883
4653
|
}
|
4884
4654
|
},
|
4885
|
-
({ height, width }) => /* @__PURE__ */
|
4655
|
+
({ height, width }) => /* @__PURE__ */ React53.createElement(
|
4886
4656
|
ChatList,
|
4887
4657
|
{
|
4888
4658
|
width,
|
@@ -4897,13 +4667,15 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4897
4667
|
)
|
4898
4668
|
);
|
4899
4669
|
});
|
4900
|
-
var ChatBody =
|
4670
|
+
var ChatBody = React53.forwardRef(({ role, peerId, scrollToBottom }, listRef) => {
|
4671
|
+
var _a;
|
4901
4672
|
const storeMessageSelector = role ? selectMessagesByRole(role) : peerId ? selectMessagesByPeerID(peerId) : selectHMSMessages;
|
4902
|
-
let messages =
|
4673
|
+
let messages = useHMSStore28(storeMessageSelector);
|
4903
4674
|
messages = useMemo8(() => (messages == null ? void 0 : messages.filter((message) => message.type === "chat")) || [], [messages]);
|
4904
|
-
const isMobile =
|
4905
|
-
|
4906
|
-
|
4675
|
+
const isMobile = useMedia11(config.media.md);
|
4676
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4677
|
+
if (messages.length === 0 && !(isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay))) {
|
4678
|
+
return /* @__PURE__ */ React53.createElement(
|
4907
4679
|
Flex,
|
4908
4680
|
{
|
4909
4681
|
css: {
|
@@ -4915,7 +4687,7 @@ var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4915
4687
|
align: "center",
|
4916
4688
|
justify: "center"
|
4917
4689
|
},
|
4918
|
-
/* @__PURE__ */
|
4690
|
+
/* @__PURE__ */ React53.createElement(Box, null, /* @__PURE__ */ React53.createElement("img", { src: empty_chat_default, alt: "Empty Chat", height: 132, width: 185, style: { margin: "0 auto" } }), /* @__PURE__ */ React53.createElement(Text, { variant: "h5", css: { mt: "$8", c: "$on_surface_high" } }, "Start a conversation"), /* @__PURE__ */ React53.createElement(
|
4919
4691
|
Text,
|
4920
4692
|
{
|
4921
4693
|
variant: "sm",
|
@@ -4925,27 +4697,27 @@ var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4925
4697
|
))
|
4926
4698
|
);
|
4927
4699
|
}
|
4928
|
-
return /* @__PURE__ */
|
4700
|
+
return /* @__PURE__ */ React53.createElement(Fragment8, null, /* @__PURE__ */ React53.createElement(VirtualizedChatMessages, { messages, scrollToBottom, ref: listRef }));
|
4929
4701
|
});
|
4930
4702
|
|
4931
|
-
// src/Prebuilt/components/Chat/ChatFooter.
|
4932
|
-
import
|
4933
|
-
import { useMedia as
|
4703
|
+
// src/Prebuilt/components/Chat/ChatFooter.tsx
|
4704
|
+
import React54, { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef12, useState as useState31 } from "react";
|
4705
|
+
import { useMedia as useMedia12 } from "react-use";
|
4934
4706
|
import data2 from "@emoji-mart/data";
|
4935
4707
|
import Picker from "@emoji-mart/react";
|
4936
|
-
import { useHMSActions as
|
4708
|
+
import { useHMSActions as useHMSActions17 } from "@100mslive/react-sdk";
|
4937
4709
|
import { EmojiIcon as EmojiIcon3, SendIcon } from "@100mslive/react-icons";
|
4938
4710
|
|
4939
4711
|
// src/Prebuilt/components/AppData/useChatState.js
|
4940
|
-
import { useCallback as
|
4941
|
-
import { selectAppData as selectAppData2, useHMSActions as
|
4712
|
+
import { useCallback as useCallback12 } from "react";
|
4713
|
+
import { selectAppData as selectAppData2, useHMSActions as useHMSActions16, useHMSStore as useHMSStore29 } from "@100mslive/react-sdk";
|
4942
4714
|
var useChatDraftMessage = () => {
|
4943
|
-
const hmsActions =
|
4944
|
-
let chatDraftMessage =
|
4715
|
+
const hmsActions = useHMSActions16();
|
4716
|
+
let chatDraftMessage = useHMSStore29(selectAppData2(APP_DATA.chatDraft));
|
4945
4717
|
if (chatDraftMessage === void 0 || chatDraftMessage === null) {
|
4946
4718
|
chatDraftMessage = "";
|
4947
4719
|
}
|
4948
|
-
const setDraftMessage =
|
4720
|
+
const setDraftMessage = useCallback12(
|
4949
4721
|
(message) => {
|
4950
4722
|
hmsActions.setAppData(APP_DATA.chatDraft, message, true);
|
4951
4723
|
},
|
@@ -4955,9 +4727,9 @@ var useChatDraftMessage = () => {
|
|
4955
4727
|
};
|
4956
4728
|
|
4957
4729
|
// src/Prebuilt/components/Chat/useEmojiPickerStyles.js
|
4958
|
-
import { useEffect as useEffect18, useRef as
|
4730
|
+
import { useEffect as useEffect18, useRef as useRef11 } from "react";
|
4959
4731
|
var useEmojiPickerStyles = (showing) => {
|
4960
|
-
const ref =
|
4732
|
+
const ref = useRef11(null);
|
4961
4733
|
useEffect18(() => {
|
4962
4734
|
if (showing) {
|
4963
4735
|
setTimeout(() => {
|
@@ -4966,16 +4738,17 @@ var useEmojiPickerStyles = (showing) => {
|
|
4966
4738
|
const style = document.createElement("style");
|
4967
4739
|
style.textContent = `
|
4968
4740
|
#root {
|
4969
|
-
--em-rgb-color: var(--hms-ui-colors-
|
4741
|
+
--em-rgb-color: var(--hms-ui-colors-on_surface_high);
|
4970
4742
|
--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-
|
4743
|
+
--em-color-border: var(--hms-ui-colors-surface_bright);
|
4744
|
+
--color-b: var(--hms-ui-colors-on_surface_high);
|
4973
4745
|
--rgb-background: transparent;
|
4974
|
-
color: var(--hms-ui-colors-
|
4746
|
+
color: var(--hms-ui-colors-on_surface_high);
|
4975
4747
|
font-family: var(--hms-ui-fonts-sans);
|
4976
4748
|
}
|
4977
4749
|
.sticky {
|
4978
4750
|
background-color: var(--hms-ui-colors-surface_bright);
|
4751
|
+
margin-top: 0.5rem;
|
4979
4752
|
}
|
4980
4753
|
`;
|
4981
4754
|
root == null ? void 0 : root.appendChild(style);
|
@@ -4985,7 +4758,7 @@ var useEmojiPickerStyles = (showing) => {
|
|
4985
4758
|
return ref;
|
4986
4759
|
};
|
4987
4760
|
|
4988
|
-
// src/Prebuilt/components/Chat/ChatFooter.
|
4761
|
+
// src/Prebuilt/components/Chat/ChatFooter.tsx
|
4989
4762
|
var TextArea = styled("textarea", {
|
4990
4763
|
width: "100%",
|
4991
4764
|
bg: "transparent",
|
@@ -5006,7 +4779,7 @@ var TextArea = styled("textarea", {
|
|
5006
4779
|
function EmojiPicker({ onSelect }) {
|
5007
4780
|
const [showEmoji, setShowEmoji] = useState31(false);
|
5008
4781
|
const ref = useEmojiPickerStyles(showEmoji);
|
5009
|
-
return /* @__PURE__ */
|
4782
|
+
return /* @__PURE__ */ React54.createElement(Popover.Root, { open: showEmoji, onOpenChange: setShowEmoji }, /* @__PURE__ */ React54.createElement(Popover.Trigger, { asChild: true, css: { appearance: "none" } }, /* @__PURE__ */ React54.createElement(IconButton, { as: "div" }, /* @__PURE__ */ React54.createElement(EmojiIcon3, null))), /* @__PURE__ */ React54.createElement(Popover.Portal, null, /* @__PURE__ */ React54.createElement(
|
5010
4783
|
Popover.Content,
|
5011
4784
|
{
|
5012
4785
|
alignOffset: -40,
|
@@ -5016,7 +4789,7 @@ function EmojiPicker({ onSelect }) {
|
|
5016
4789
|
p: 0
|
5017
4790
|
}
|
5018
4791
|
},
|
5019
|
-
/* @__PURE__ */
|
4792
|
+
/* @__PURE__ */ React54.createElement(
|
5020
4793
|
Box,
|
5021
4794
|
{
|
5022
4795
|
css: {
|
@@ -5025,7 +4798,7 @@ function EmojiPicker({ onSelect }) {
|
|
5025
4798
|
},
|
5026
4799
|
ref
|
5027
4800
|
},
|
5028
|
-
/* @__PURE__ */
|
4801
|
+
/* @__PURE__ */ React54.createElement(Picker, { onEmojiSelect: onSelect, data: data2, previewPosition: "none", skinPosition: "search" })
|
5029
4802
|
)
|
5030
4803
|
)));
|
5031
4804
|
}
|
@@ -5034,14 +4807,17 @@ var ChatFooter = ({
|
|
5034
4807
|
peerId,
|
5035
4808
|
onSend,
|
5036
4809
|
children
|
5037
|
-
/* onSelect, selection, screenType */
|
5038
4810
|
}) => {
|
5039
|
-
|
5040
|
-
const
|
4811
|
+
var _a;
|
4812
|
+
const hmsActions = useHMSActions17();
|
4813
|
+
const inputRef = useRef12(null);
|
5041
4814
|
const [draftMessage, setDraftMessage] = useChatDraftMessage();
|
5042
|
-
const isMobile =
|
5043
|
-
const
|
5044
|
-
|
4815
|
+
const isMobile = useMedia12(config.media.md);
|
4816
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4817
|
+
const isOverlayChat = (_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay;
|
4818
|
+
const sendMessage = useCallback13(() => __async(void 0, null, function* () {
|
4819
|
+
var _a2;
|
4820
|
+
const message = (_a2 = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a2.value;
|
5045
4821
|
if (!message || !message.trim().length) {
|
5046
4822
|
return;
|
5047
4823
|
}
|
@@ -5058,7 +4834,8 @@ var ChatFooter = ({
|
|
5058
4834
|
onSend();
|
5059
4835
|
}, 0);
|
5060
4836
|
} catch (error) {
|
5061
|
-
|
4837
|
+
const err = error;
|
4838
|
+
ToastManager.addToast({ title: err.message });
|
5062
4839
|
}
|
5063
4840
|
}), [role, peerId, hmsActions, onSend]);
|
5064
4841
|
useEffect19(() => {
|
@@ -5073,12 +4850,12 @@ var ChatFooter = ({
|
|
5073
4850
|
setDraftMessage((messageElement == null ? void 0 : messageElement.value) || "");
|
5074
4851
|
};
|
5075
4852
|
}, [setDraftMessage]);
|
5076
|
-
return /* @__PURE__ */
|
4853
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Flex, { align: "center", css: { gap: "$4", w: "100%" } }, /* @__PURE__ */ React54.createElement(
|
5077
4854
|
Flex,
|
5078
4855
|
{
|
5079
4856
|
align: "center",
|
5080
4857
|
css: {
|
5081
|
-
bg: isMobile ? "$surface_dim" : "$surface_default",
|
4858
|
+
bg: isOverlayChat && isMobile ? "$surface_dim" : "$surface_default",
|
5082
4859
|
minHeight: "$16",
|
5083
4860
|
maxHeight: "$24",
|
5084
4861
|
position: "relative",
|
@@ -5094,12 +4871,18 @@ var ChatFooter = ({
|
|
5094
4871
|
}
|
5095
4872
|
},
|
5096
4873
|
children,
|
5097
|
-
/* @__PURE__ */
|
4874
|
+
/* @__PURE__ */ React54.createElement(
|
5098
4875
|
TextArea,
|
5099
4876
|
{
|
4877
|
+
css: {
|
4878
|
+
c: "$on_surface_high",
|
4879
|
+
"&:valid ~ .send-msg": { color: "$on_surface_high" },
|
4880
|
+
"& ~ .send-msg": { color: "$on_surface_low" }
|
4881
|
+
},
|
5100
4882
|
placeholder: "Send a message....",
|
5101
4883
|
ref: inputRef,
|
5102
|
-
|
4884
|
+
required: true,
|
4885
|
+
autoFocus: !isMobile,
|
5103
4886
|
onKeyPress: (event) => __async(void 0, null, function* () {
|
5104
4887
|
if (event.key === "Enter") {
|
5105
4888
|
if (!event.shiftKey) {
|
@@ -5115,28 +4898,30 @@ var ChatFooter = ({
|
|
5115
4898
|
onCopy: (e) => e.stopPropagation()
|
5116
4899
|
}
|
5117
4900
|
),
|
5118
|
-
!isMobile ? /* @__PURE__ */
|
4901
|
+
!isMobile ? /* @__PURE__ */ React54.createElement(
|
5119
4902
|
EmojiPicker,
|
5120
4903
|
{
|
5121
4904
|
onSelect: (emoji) => {
|
5122
|
-
inputRef.current
|
4905
|
+
if (inputRef.current) {
|
4906
|
+
inputRef.current.value += ` ${emoji.native} `;
|
4907
|
+
}
|
5123
4908
|
}
|
5124
4909
|
}
|
5125
4910
|
) : null,
|
5126
|
-
/* @__PURE__ */
|
4911
|
+
/* @__PURE__ */ React54.createElement(
|
5127
4912
|
IconButton,
|
5128
4913
|
{
|
4914
|
+
className: "send-msg",
|
5129
4915
|
onClick: sendMessage,
|
5130
4916
|
css: {
|
5131
4917
|
ml: "auto",
|
5132
4918
|
height: "max-content",
|
5133
4919
|
mr: "$4",
|
5134
|
-
|
5135
|
-
"&:hover": { c: "$on_surface_high" }
|
4920
|
+
"&:hover": { c: isMobile ? "" : "$on_surface_medium" }
|
5136
4921
|
},
|
5137
4922
|
"data-testid": "send_msg_btn"
|
5138
4923
|
},
|
5139
|
-
/* @__PURE__ */
|
4924
|
+
/* @__PURE__ */ React54.createElement(SendIcon, null)
|
5140
4925
|
)
|
5141
4926
|
)));
|
5142
4927
|
};
|
@@ -5146,21 +4931,21 @@ import {
|
|
5146
4931
|
selectMessagesUnreadCountByPeerID,
|
5147
4932
|
selectMessagesUnreadCountByRole,
|
5148
4933
|
selectUnreadHMSMessagesCount as selectUnreadHMSMessagesCount2,
|
5149
|
-
useHMSStore as
|
4934
|
+
useHMSStore as useHMSStore30
|
5150
4935
|
} from "@100mslive/react-sdk";
|
5151
4936
|
var useUnreadCount = ({ role, peerId }) => {
|
5152
4937
|
const unreadCountSelector = role ? selectMessagesUnreadCountByRole(role) : peerId ? selectMessagesUnreadCountByPeerID(peerId) : selectUnreadHMSMessagesCount2;
|
5153
|
-
const unreadCount =
|
4938
|
+
const unreadCount = useHMSStore30(unreadCountSelector);
|
5154
4939
|
return unreadCount;
|
5155
4940
|
};
|
5156
4941
|
|
5157
4942
|
// src/Prebuilt/components/Chat/Chat.jsx
|
5158
4943
|
var PINNED_MESSAGE_LENGTH = 80;
|
5159
4944
|
var PinnedMessage = ({ clearPinnedMessage }) => {
|
5160
|
-
const permissions =
|
5161
|
-
const pinnedMessage =
|
4945
|
+
const permissions = useHMSStore31(selectPermissions10);
|
4946
|
+
const pinnedMessage = useHMSStore31(selectSessionStore(SESSION_STORE_KEY.PINNED_MESSAGE));
|
5162
4947
|
const formattedPinnedMessage = (pinnedMessage == null ? void 0 : pinnedMessage.length) && pinnedMessage.length > PINNED_MESSAGE_LENGTH ? `${pinnedMessage.slice(0, PINNED_MESSAGE_LENGTH)}...` : pinnedMessage;
|
5163
|
-
return pinnedMessage ? /* @__PURE__ */
|
4948
|
+
return pinnedMessage ? /* @__PURE__ */ React55.createElement(
|
5164
4949
|
Flex,
|
5165
4950
|
{
|
5166
4951
|
title: pinnedMessage,
|
@@ -5168,8 +4953,8 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
5168
4953
|
align: "center",
|
5169
4954
|
justify: "between"
|
5170
4955
|
},
|
5171
|
-
/* @__PURE__ */
|
5172
|
-
/* @__PURE__ */
|
4956
|
+
/* @__PURE__ */ React55.createElement(PinIcon2, null),
|
4957
|
+
/* @__PURE__ */ React55.createElement(
|
5173
4958
|
Box,
|
5174
4959
|
{
|
5175
4960
|
css: {
|
@@ -5179,31 +4964,32 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
5179
4964
|
overflowY: "auto"
|
5180
4965
|
}
|
5181
4966
|
},
|
5182
|
-
/* @__PURE__ */
|
4967
|
+
/* @__PURE__ */ React55.createElement(Text, { variant: "sm" }, /* @__PURE__ */ React55.createElement(AnnotisedMessage, { message: formattedPinnedMessage }))
|
5183
4968
|
),
|
5184
|
-
permissions.removeOthers && /* @__PURE__ */
|
4969
|
+
permissions.removeOthers && /* @__PURE__ */ React55.createElement(
|
5185
4970
|
Flex,
|
5186
4971
|
{
|
5187
4972
|
onClick: () => clearPinnedMessage(),
|
5188
4973
|
css: { cursor: "pointer", color: "$on_surface_medium", "&:hover": { color: "$on_surface_high" } }
|
5189
4974
|
},
|
5190
|
-
/* @__PURE__ */
|
4975
|
+
/* @__PURE__ */ React55.createElement(CrossIcon7, null)
|
5191
4976
|
)
|
5192
4977
|
) : null;
|
5193
4978
|
};
|
5194
|
-
var Chat = ({ screenType }) => {
|
4979
|
+
var Chat = ({ screenType, hideControls = false }) => {
|
4980
|
+
var _a, _b, _c;
|
5195
4981
|
const notification = useHMSNotifications(HMSNotificationTypes.PEER_LEFT);
|
5196
4982
|
const [peerSelector, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER_ID);
|
5197
4983
|
const [roleSelector, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
5198
|
-
const peerName =
|
4984
|
+
const peerName = useHMSStore31(selectPeerNameByID3(peerSelector));
|
5199
4985
|
const [chatOptions, setChatOptions] = useState32({
|
5200
4986
|
role: roleSelector || "",
|
5201
4987
|
peerId: peerSelector && peerName ? peerSelector : "",
|
5202
4988
|
selection: roleSelector ? roleSelector : peerSelector && peerName ? peerName : "Everyone"
|
5203
4989
|
});
|
5204
4990
|
const [isSelectorOpen, setSelectorOpen] = useState32(false);
|
5205
|
-
const listRef =
|
5206
|
-
const hmsActions =
|
4991
|
+
const listRef = useRef13(null);
|
4992
|
+
const hmsActions = useHMSActions18();
|
5207
4993
|
const { setPinnedMessage } = useSetPinnedMessage();
|
5208
4994
|
useEffect20(() => {
|
5209
4995
|
if (notification && notification.data && peerSelector === notification.data.id) {
|
@@ -5216,58 +5002,78 @@ var Chat = ({ screenType }) => {
|
|
5216
5002
|
}
|
5217
5003
|
}, [notification, peerSelector, setPeerSelector]);
|
5218
5004
|
const storeMessageSelector = selectHMSMessagesCount;
|
5219
|
-
const
|
5220
|
-
const
|
5221
|
-
|
5005
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
5006
|
+
const isMobile = useMedia13(config.media.md);
|
5007
|
+
let isScrolledToBottom = false;
|
5008
|
+
if (listRef.current) {
|
5009
|
+
const currentRef = listRef.current._outerRef;
|
5010
|
+
isScrolledToBottom = currentRef.scrollHeight - currentRef.clientHeight - currentRef.scrollTop < 10;
|
5011
|
+
}
|
5012
|
+
const messagesCount = useHMSStore31(storeMessageSelector) || 0;
|
5013
|
+
const scrollToBottom = useCallback14(
|
5222
5014
|
(unreadCount = 0) => {
|
5223
|
-
var
|
5015
|
+
var _a2;
|
5224
5016
|
if (listRef.current && listRef.current.scrollToItem && unreadCount > 0) {
|
5225
|
-
(
|
5017
|
+
(_a2 = listRef.current) == null ? void 0 : _a2.scrollToItem(messagesCount, "end");
|
5226
5018
|
requestAnimationFrame(() => {
|
5227
|
-
var
|
5228
|
-
(
|
5019
|
+
var _a3;
|
5020
|
+
(_a3 = listRef.current) == null ? void 0 : _a3.scrollToItem(messagesCount, "end");
|
5229
5021
|
});
|
5230
5022
|
hmsActions.setMessageRead(true);
|
5231
5023
|
}
|
5232
5024
|
},
|
5233
5025
|
[hmsActions, messagesCount]
|
5234
5026
|
);
|
5235
|
-
return /* @__PURE__ */
|
5236
|
-
|
5237
|
-
{
|
5238
|
-
role: chatOptions.role,
|
5239
|
-
peerId: chatOptions.peerId,
|
5240
|
-
ref: listRef,
|
5241
|
-
scrollToBottom,
|
5242
|
-
screenType
|
5243
|
-
}
|
5244
|
-
), /* @__PURE__ */ React54.createElement(
|
5245
|
-
ChatFooter,
|
5027
|
+
return /* @__PURE__ */ React55.createElement(
|
5028
|
+
Flex,
|
5246
5029
|
{
|
5247
|
-
|
5248
|
-
|
5249
|
-
|
5250
|
-
|
5251
|
-
|
5252
|
-
|
5253
|
-
|
5254
|
-
peerId,
|
5255
|
-
selection
|
5256
|
-
});
|
5257
|
-
setPeerSelector(peerId);
|
5258
|
-
setRoleSelector(role);
|
5259
|
-
},
|
5260
|
-
peerId: chatOptions.peerId
|
5030
|
+
direction: "column",
|
5031
|
+
css: {
|
5032
|
+
size: "100%",
|
5033
|
+
gap: "$4",
|
5034
|
+
marginTop: hideControls && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? "$17" : "0",
|
5035
|
+
transition: "margin 0.3s ease-in-out"
|
5036
|
+
}
|
5261
5037
|
},
|
5262
|
-
|
5263
|
-
|
5038
|
+
isMobile && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.is_overlay) ? null : /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(ChatParticipantHeader, { selectorOpen: isSelectorOpen, onToggle: () => setSelectorOpen((value) => !value) }), ((_c = elements == null ? void 0 : elements.chat) == null ? void 0 : _c.allow_pinning_messages) ? /* @__PURE__ */ React55.createElement(PinnedMessage, { clearPinnedMessage: setPinnedMessage }) : null),
|
5039
|
+
/* @__PURE__ */ React55.createElement(
|
5040
|
+
ChatBody,
|
5041
|
+
{
|
5042
|
+
role: chatOptions.role,
|
5043
|
+
peerId: chatOptions.peerId,
|
5044
|
+
ref: listRef,
|
5045
|
+
scrollToBottom,
|
5046
|
+
screenType
|
5047
|
+
}
|
5048
|
+
),
|
5049
|
+
/* @__PURE__ */ React55.createElement(
|
5050
|
+
ChatFooter,
|
5051
|
+
{
|
5052
|
+
role: chatOptions.role,
|
5053
|
+
onSend: () => scrollToBottom(1),
|
5054
|
+
selection: chatOptions.selection,
|
5055
|
+
screenType,
|
5056
|
+
onSelect: ({ role, peerId, selection }) => {
|
5057
|
+
setChatOptions({
|
5058
|
+
role,
|
5059
|
+
peerId,
|
5060
|
+
selection
|
5061
|
+
});
|
5062
|
+
setPeerSelector(peerId);
|
5063
|
+
setRoleSelector(role);
|
5064
|
+
},
|
5065
|
+
peerId: chatOptions.peerId
|
5066
|
+
},
|
5067
|
+
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */ React55.createElement(NewMessageIndicator, { role: chatOptions.role, peerId: chatOptions.peerId, scrollToBottom })
|
5068
|
+
)
|
5069
|
+
);
|
5264
5070
|
};
|
5265
5071
|
var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
5266
5072
|
const unreadCount = useUnreadCount({ role, peerId });
|
5267
5073
|
if (!unreadCount) {
|
5268
5074
|
return null;
|
5269
5075
|
}
|
5270
|
-
return /* @__PURE__ */
|
5076
|
+
return /* @__PURE__ */ React55.createElement(
|
5271
5077
|
Flex,
|
5272
5078
|
{
|
5273
5079
|
justify: "center",
|
@@ -5278,7 +5084,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5278
5084
|
position: "absolute"
|
5279
5085
|
}
|
5280
5086
|
},
|
5281
|
-
/* @__PURE__ */
|
5087
|
+
/* @__PURE__ */ React55.createElement(
|
5282
5088
|
Button,
|
5283
5089
|
{
|
5284
5090
|
variant: "standard",
|
@@ -5301,22 +5107,22 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5301
5107
|
},
|
5302
5108
|
"New ",
|
5303
5109
|
unreadCount === 1 ? "message" : "messages",
|
5304
|
-
/* @__PURE__ */
|
5110
|
+
/* @__PURE__ */ React55.createElement(ChevronDownIcon2, null)
|
5305
5111
|
)
|
5306
5112
|
);
|
5307
5113
|
};
|
5308
5114
|
|
5309
5115
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5310
|
-
import
|
5311
|
-
import { selectPermissions as
|
5116
|
+
import React57, { Fragment as Fragment10, useState as useState34 } from "react";
|
5117
|
+
import { selectPermissions as selectPermissions11, useHMSStore as useHMSStore33, useRecordingStreaming as useRecordingStreaming7 } from "@100mslive/react-sdk";
|
5312
5118
|
import { ColoredHandIcon, CrossIcon as CrossIcon8, GoLiveIcon as GoLiveIcon3 } from "@100mslive/react-icons";
|
5313
5119
|
|
5314
5120
|
// src/Prebuilt/images/rtmp.png
|
5315
5121
|
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
5122
|
|
5317
5123
|
// src/Prebuilt/components/Streaming/HLSStreaming.jsx
|
5318
|
-
import
|
5319
|
-
import { selectRoomID, useHMSActions as
|
5124
|
+
import React56, { Fragment as Fragment9, useCallback as useCallback15, useEffect as useEffect21, useState as useState33 } from "react";
|
5125
|
+
import { selectRoomID, useHMSActions as useHMSActions19, useHMSStore as useHMSStore32, useRecordingStreaming as useRecordingStreaming6 } from "@100mslive/react-sdk";
|
5320
5126
|
import {
|
5321
5127
|
EndStreamIcon as EndStreamIcon2,
|
5322
5128
|
EyeOpenIcon,
|
@@ -5335,7 +5141,7 @@ var getCardData = (roleName, roomId) => {
|
|
5335
5141
|
data3 = {
|
5336
5142
|
title: formattedRoleName,
|
5337
5143
|
content: "Broadcasters can livestream audio or video, manage stream appearance and control the room via HLS.",
|
5338
|
-
icon: /* @__PURE__ */
|
5144
|
+
icon: /* @__PURE__ */ React56.createElement(SupportIcon, null)
|
5339
5145
|
};
|
5340
5146
|
break;
|
5341
5147
|
}
|
@@ -5343,7 +5149,7 @@ var getCardData = (roleName, roomId) => {
|
|
5343
5149
|
data3 = {
|
5344
5150
|
title: "HLS Viewer",
|
5345
5151
|
content: "Viewers can view and send chat messages, but need to be made broadcasters to participate with audio or video.",
|
5346
|
-
icon: /* @__PURE__ */
|
5152
|
+
icon: /* @__PURE__ */ React56.createElement(EyeOpenIcon, null)
|
5347
5153
|
};
|
5348
5154
|
break;
|
5349
5155
|
}
|
@@ -5351,7 +5157,7 @@ var getCardData = (roleName, roomId) => {
|
|
5351
5157
|
data3 = {
|
5352
5158
|
title: formattedRoleName,
|
5353
5159
|
content: `${formattedRoleName} is customised with specific permissions, which will determine how it interacts with this room.`,
|
5354
|
-
icon: /* @__PURE__ */
|
5160
|
+
icon: /* @__PURE__ */ React56.createElement(WrenchIcon, null),
|
5355
5161
|
order: 1
|
5356
5162
|
};
|
5357
5163
|
}
|
@@ -5360,7 +5166,7 @@ var getCardData = (roleName, roomId) => {
|
|
5360
5166
|
};
|
5361
5167
|
var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
5362
5168
|
const [copied, setCopied] = useState33(false);
|
5363
|
-
return isHLSRunning ? /* @__PURE__ */
|
5169
|
+
return isHLSRunning ? /* @__PURE__ */ React56.createElement(
|
5364
5170
|
Box,
|
5365
5171
|
{
|
5366
5172
|
key: title,
|
@@ -5371,9 +5177,9 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5371
5177
|
borderRadius: "$2"
|
5372
5178
|
}
|
5373
5179
|
},
|
5374
|
-
/* @__PURE__ */
|
5375
|
-
/* @__PURE__ */
|
5376
|
-
/* @__PURE__ */
|
5180
|
+
/* @__PURE__ */ React56.createElement(Flex, { align: "center", gap: "2", css: { color: "$primary_bright" } }, icon, /* @__PURE__ */ React56.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, title)),
|
5181
|
+
/* @__PURE__ */ React56.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium", mt: "$6" } }, content),
|
5182
|
+
/* @__PURE__ */ React56.createElement(
|
5377
5183
|
Button,
|
5378
5184
|
{
|
5379
5185
|
variant: "standard",
|
@@ -5385,24 +5191,24 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5385
5191
|
css: { w: "100%", r: "$1", mt: "$10", fontWeight: "$semiBold" },
|
5386
5192
|
icon: true
|
5387
5193
|
},
|
5388
|
-
copied ? /* @__PURE__ */
|
5194
|
+
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
5195
|
)
|
5390
5196
|
) : null;
|
5391
5197
|
};
|
5392
5198
|
var HLSStreaming = ({ onBack }) => {
|
5393
5199
|
const roleNames = useFilteredRoles();
|
5394
|
-
const roomId =
|
5200
|
+
const roomId = useHMSStore32(selectRoomID);
|
5395
5201
|
const cards = roleNames.map((roleName) => getCardData(roleName, roomId));
|
5396
5202
|
const { isHLSRunning } = useRecordingStreaming6();
|
5397
5203
|
const [showLinks, setShowLinks] = useState33(false);
|
5398
|
-
return !showLinks ? /* @__PURE__ */
|
5204
|
+
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
5205
|
};
|
5400
5206
|
var StartHLS = () => {
|
5401
5207
|
const [record, setRecord] = useState33(false);
|
5402
5208
|
const [error, setError] = useState33(false);
|
5403
|
-
const hmsActions =
|
5209
|
+
const hmsActions = useHMSActions19();
|
5404
5210
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5405
|
-
const startHLS =
|
5211
|
+
const startHLS = useCallback15(
|
5406
5212
|
(variants) => __async(void 0, null, function* () {
|
5407
5213
|
try {
|
5408
5214
|
if (isHLSStarted) {
|
@@ -5421,7 +5227,7 @@ var StartHLS = () => {
|
|
5421
5227
|
}),
|
5422
5228
|
[hmsActions, record, isHLSStarted, setHLSStarted]
|
5423
5229
|
);
|
5424
|
-
return /* @__PURE__ */
|
5230
|
+
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
5231
|
Button,
|
5426
5232
|
{
|
5427
5233
|
"data-testid": "start_hls",
|
@@ -5430,12 +5236,12 @@ var StartHLS = () => {
|
|
5430
5236
|
onClick: () => startHLS(),
|
5431
5237
|
disabled: isHLSStarted
|
5432
5238
|
},
|
5433
|
-
isHLSStarted ? /* @__PURE__ */
|
5239
|
+
isHLSStarted ? /* @__PURE__ */ React56.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React56.createElement(GoLiveIcon2, null),
|
5434
5240
|
isHLSStarted ? "Starting stream..." : "Go Live"
|
5435
|
-
)), /* @__PURE__ */
|
5241
|
+
)), /* @__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
5242
|
};
|
5437
5243
|
var EndHLS = ({ setShowLinks }) => {
|
5438
|
-
const hmsActions =
|
5244
|
+
const hmsActions = useHMSActions19();
|
5439
5245
|
const [inProgress, setInProgress] = useState33(false);
|
5440
5246
|
const [error, setError] = useState33("");
|
5441
5247
|
const { isHLSRunning } = useRecordingStreaming6();
|
@@ -5444,7 +5250,7 @@ var EndHLS = ({ setShowLinks }) => {
|
|
5444
5250
|
setInProgress(false);
|
5445
5251
|
}
|
5446
5252
|
}, [inProgress, isHLSRunning]);
|
5447
|
-
return /* @__PURE__ */
|
5253
|
+
return /* @__PURE__ */ React56.createElement(Box, { css: { p: "$4 $10" } }, /* @__PURE__ */ React56.createElement(ErrorText, { error }), /* @__PURE__ */ React56.createElement(
|
5448
5254
|
Button,
|
5449
5255
|
{
|
5450
5256
|
"data-testid": "stop_hls",
|
@@ -5463,23 +5269,23 @@ var EndHLS = ({ setShowLinks }) => {
|
|
5463
5269
|
}
|
5464
5270
|
})
|
5465
5271
|
},
|
5466
|
-
/* @__PURE__ */
|
5272
|
+
/* @__PURE__ */ React56.createElement(EndStreamIcon2, null),
|
5467
5273
|
"End Stream"
|
5468
|
-
), /* @__PURE__ */
|
5274
|
+
), /* @__PURE__ */ React56.createElement(Button, { icon: true, css: { w: "100%", r: "$0", mt: "$8" }, onClick: () => setShowLinks(true) }, /* @__PURE__ */ React56.createElement(PeopleIcon3, null), " Invite People"));
|
5469
5275
|
};
|
5470
5276
|
|
5471
5277
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5472
5278
|
var StreamingLanding = () => {
|
5473
5279
|
const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
|
5474
5280
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming7();
|
5475
|
-
const permissions =
|
5281
|
+
const permissions = useHMSStore33(selectPermissions11);
|
5476
5282
|
const [showHLS, setShowHLS] = useState34(isHLSRunning);
|
5477
5283
|
const [showRTMP, setShowRTMP] = useState34(isRTMPRunning);
|
5478
5284
|
if (!(permissions == null ? void 0 : permissions.hlsStreaming) && !(permissions == null ? void 0 : permissions.rtmpStreaming)) {
|
5479
5285
|
toggleStreaming();
|
5480
5286
|
return null;
|
5481
5287
|
}
|
5482
|
-
return /* @__PURE__ */
|
5288
|
+
return /* @__PURE__ */ React57.createElement(Fragment10, null, /* @__PURE__ */ React57.createElement(Flex, { css: { w: "100%", py: "$8" } }, /* @__PURE__ */ React57.createElement(
|
5483
5289
|
Box,
|
5484
5290
|
{
|
5485
5291
|
css: {
|
@@ -5489,8 +5295,8 @@ var StreamingLanding = () => {
|
|
5489
5295
|
r: "$round"
|
5490
5296
|
}
|
5491
5297
|
},
|
5492
|
-
/* @__PURE__ */
|
5493
|
-
), /* @__PURE__ */
|
5298
|
+
/* @__PURE__ */ React57.createElement(ColoredHandIcon, { width: 40, height: 40 })
|
5299
|
+
), /* @__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
5300
|
StreamCard,
|
5495
5301
|
{
|
5496
5302
|
testId: "hls_stream",
|
@@ -5500,7 +5306,7 @@ var StreamingLanding = () => {
|
|
5500
5306
|
onClick: () => setShowHLS(true),
|
5501
5307
|
Icon: GoLiveIcon3
|
5502
5308
|
}
|
5503
|
-
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */
|
5309
|
+
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */ React57.createElement(
|
5504
5310
|
StreamCard,
|
5505
5311
|
{
|
5506
5312
|
testId: "rtmp_stream",
|
@@ -5512,29 +5318,34 @@ var StreamingLanding = () => {
|
|
5512
5318
|
},
|
5513
5319
|
imgSrc: rtmp_default
|
5514
5320
|
}
|
5515
|
-
), showHLS && /* @__PURE__ */
|
5321
|
+
), showHLS && /* @__PURE__ */ React57.createElement(HLSStreaming, { onBack: () => setShowHLS(false) }), showRTMP && /* @__PURE__ */ React57.createElement(RTMPStreaming, { onBack: () => setShowRTMP(false) }));
|
5516
5322
|
};
|
5517
5323
|
|
5518
5324
|
// src/Prebuilt/layouts/SidePane.tsx
|
5519
|
-
var SidePane = ({
|
5520
|
-
|
5521
|
-
|
5522
|
-
|
5523
|
-
|
5524
|
-
|
5325
|
+
var SidePane = ({
|
5326
|
+
screenType,
|
5327
|
+
tileProps,
|
5328
|
+
hideControls = false
|
5329
|
+
}) => {
|
5330
|
+
var _a, _b;
|
5331
|
+
const isMobile = useMedia14(config.media.md);
|
5332
|
+
const sidepane = useHMSStore34(selectAppData3(APP_DATA.sidePane));
|
5333
|
+
const activeScreensharePeerId = useHMSStore34(selectAppData3(APP_DATA.activeScreensharePeerId));
|
5334
|
+
const trackId = (_a = useHMSStore34(selectVideoTrackByPeerID(activeScreensharePeerId))) == null ? void 0 : _a.id;
|
5335
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
5525
5336
|
let ViewComponent;
|
5526
5337
|
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
5527
|
-
ViewComponent = /* @__PURE__ */
|
5338
|
+
ViewComponent = /* @__PURE__ */ React58.createElement(ParticipantList, null);
|
5528
5339
|
} else if (sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
5529
|
-
ViewComponent = /* @__PURE__ */
|
5340
|
+
ViewComponent = /* @__PURE__ */ React58.createElement(Chat, { screenType, hideControls });
|
5530
5341
|
} else if (sidepane === SIDE_PANE_OPTIONS.STREAMING) {
|
5531
|
-
ViewComponent = /* @__PURE__ */
|
5342
|
+
ViewComponent = /* @__PURE__ */ React58.createElement(StreamingLanding, null);
|
5532
5343
|
}
|
5533
5344
|
if (!ViewComponent && !trackId) {
|
5534
5345
|
return null;
|
5535
5346
|
}
|
5536
|
-
const mwebStreamingChat = isMobile && sidepane === SIDE_PANE_OPTIONS.CHAT;
|
5537
|
-
return /* @__PURE__ */
|
5347
|
+
const mwebStreamingChat = isMobile && sidepane === SIDE_PANE_OPTIONS.CHAT && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.is_overlay);
|
5348
|
+
return /* @__PURE__ */ React58.createElement(
|
5538
5349
|
Flex,
|
5539
5350
|
{
|
5540
5351
|
direction: "column",
|
@@ -5547,18 +5358,18 @@ var SidePane = ({ screenType }) => {
|
|
5547
5358
|
"@md": { position: mwebStreamingChat ? "absolute" : "", zIndex: 12 }
|
5548
5359
|
}
|
5549
5360
|
},
|
5550
|
-
trackId && /* @__PURE__ */
|
5361
|
+
trackId && /* @__PURE__ */ React58.createElement(
|
5551
5362
|
VideoTile_default,
|
5552
|
-
{
|
5363
|
+
__spreadValues({
|
5553
5364
|
peerId: activeScreensharePeerId,
|
5554
5365
|
trackId,
|
5555
5366
|
width: "100%",
|
5556
5367
|
height: 225,
|
5557
5368
|
rootCSS: { p: 0, alignSelf: "start", flexShrink: 0 },
|
5558
5369
|
objectFit: "contain"
|
5559
|
-
}
|
5370
|
+
}, tileProps)
|
5560
5371
|
),
|
5561
|
-
!!ViewComponent && /* @__PURE__ */
|
5372
|
+
!!ViewComponent && /* @__PURE__ */ React58.createElement(
|
5562
5373
|
Box,
|
5563
5374
|
{
|
5564
5375
|
css: {
|
@@ -5594,10 +5405,10 @@ var SidePane = ({ screenType }) => {
|
|
5594
5405
|
var SidePane_default = SidePane;
|
5595
5406
|
|
5596
5407
|
// src/Prebuilt/layouts/WaitingView.jsx
|
5597
|
-
import
|
5408
|
+
import React59 from "react";
|
5598
5409
|
import { ColoredTimeIcon } from "@100mslive/react-icons";
|
5599
|
-
var WaitingView =
|
5600
|
-
return /* @__PURE__ */
|
5410
|
+
var WaitingView = React59.memo(() => {
|
5411
|
+
return /* @__PURE__ */ React59.createElement(
|
5601
5412
|
Box,
|
5602
5413
|
{
|
5603
5414
|
css: {
|
@@ -5611,7 +5422,7 @@ var WaitingView = React58.memo(() => {
|
|
5611
5422
|
},
|
5612
5423
|
"data-testid": "waiting_view"
|
5613
5424
|
},
|
5614
|
-
/* @__PURE__ */
|
5425
|
+
/* @__PURE__ */ React59.createElement(
|
5615
5426
|
Flex,
|
5616
5427
|
{
|
5617
5428
|
align: "center",
|
@@ -5625,8 +5436,8 @@ var WaitingView = React58.memo(() => {
|
|
5625
5436
|
gap: "$8"
|
5626
5437
|
}
|
5627
5438
|
},
|
5628
|
-
/* @__PURE__ */
|
5629
|
-
/* @__PURE__ */
|
5439
|
+
/* @__PURE__ */ React59.createElement(ColoredTimeIcon, { width: "80px", height: "80px" }),
|
5440
|
+
/* @__PURE__ */ React59.createElement(
|
5630
5441
|
Flex,
|
5631
5442
|
{
|
5632
5443
|
direction: "column",
|
@@ -5636,53 +5447,27 @@ var WaitingView = React58.memo(() => {
|
|
5636
5447
|
gap: "$4"
|
5637
5448
|
}
|
5638
5449
|
},
|
5639
|
-
/* @__PURE__ */
|
5640
|
-
/* @__PURE__ */
|
5450
|
+
/* @__PURE__ */ React59.createElement(Text, { color: "white", variant: "h6", css: { "@md": { fontSize: "$md" } } }, "Please wait"),
|
5451
|
+
/* @__PURE__ */ React59.createElement(Text, { color: "$on_surface_medium", css: { mt: "$4", "@md": { fontSize: "$sm" } } }, "Sit back and relax till others let you join.")
|
5641
5452
|
)
|
5642
5453
|
)
|
5643
5454
|
);
|
5644
5455
|
});
|
5645
5456
|
|
5646
5457
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
5647
|
-
var HLSView =
|
5458
|
+
var HLSView = React60.lazy(() => import("./HLSView-HNVYG5VE.js"));
|
5648
5459
|
var VideoStreamingSection = ({
|
5649
5460
|
screenType,
|
5650
|
-
elements
|
5461
|
+
elements,
|
5462
|
+
hideControls = false
|
5651
5463
|
}) => {
|
5652
|
-
var _a;
|
5653
|
-
const localPeerRole =
|
5654
|
-
const isConnected =
|
5655
|
-
const hmsActions =
|
5464
|
+
var _a, _b;
|
5465
|
+
const localPeerRole = useHMSStore35(selectLocalPeerRoleName2);
|
5466
|
+
const isConnected = useHMSStore35(selectIsConnectedToRoom6);
|
5467
|
+
const hmsActions = useHMSActions20();
|
5656
5468
|
const waitingViewerRole = useWaitingViewerRole();
|
5657
5469
|
const urlToIframe = useUrlToEmbed();
|
5658
5470
|
const pdfAnnotatorActive = usePDFAnnotator();
|
5659
|
-
const { isHLSRunning } = useRecordingStreaming8();
|
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
5471
|
useEffect22(() => {
|
5687
5472
|
if (!isConnected) {
|
5688
5473
|
return;
|
@@ -5694,17 +5479,17 @@ var VideoStreamingSection = ({
|
|
5694
5479
|
}
|
5695
5480
|
let ViewComponent;
|
5696
5481
|
if (screenType === "hls_live_streaming") {
|
5697
|
-
ViewComponent = /* @__PURE__ */
|
5482
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(HLSView, null);
|
5698
5483
|
} else if (localPeerRole === waitingViewerRole) {
|
5699
|
-
ViewComponent = /* @__PURE__ */
|
5484
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(WaitingView, null);
|
5700
5485
|
} else if (pdfAnnotatorActive) {
|
5701
|
-
ViewComponent = /* @__PURE__ */
|
5486
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(PDFView, null);
|
5702
5487
|
} else if (urlToIframe) {
|
5703
|
-
ViewComponent = /* @__PURE__ */
|
5488
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(EmbedView, null);
|
5704
5489
|
} else {
|
5705
|
-
ViewComponent = /* @__PURE__ */
|
5490
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(GridLayout, __spreadValues({}, (_a = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a.grid));
|
5706
5491
|
}
|
5707
|
-
return /* @__PURE__ */
|
5492
|
+
return /* @__PURE__ */ React60.createElement(Suspense2, { fallback: /* @__PURE__ */ React60.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React60.createElement(
|
5708
5493
|
Flex,
|
5709
5494
|
{
|
5710
5495
|
css: {
|
@@ -5714,36 +5499,44 @@ var VideoStreamingSection = ({
|
|
5714
5499
|
}
|
5715
5500
|
},
|
5716
5501
|
ViewComponent,
|
5717
|
-
/* @__PURE__ */
|
5502
|
+
/* @__PURE__ */ React60.createElement(
|
5503
|
+
SidePane_default,
|
5504
|
+
{
|
5505
|
+
screenType,
|
5506
|
+
tileProps: (_b = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _b.grid,
|
5507
|
+
hideControls
|
5508
|
+
}
|
5509
|
+
)
|
5718
5510
|
));
|
5719
5511
|
};
|
5720
5512
|
|
5721
|
-
// src/Prebuilt/components/RoleChangeRequestModal.
|
5722
|
-
import
|
5513
|
+
// src/Prebuilt/components/RoleChangeRequestModal.tsx
|
5514
|
+
import React61, { useEffect as useEffect23 } from "react";
|
5723
5515
|
import {
|
5724
5516
|
selectLocalPeerName,
|
5725
|
-
selectLocalPeerRoleName as
|
5517
|
+
selectLocalPeerRoleName as selectLocalPeerRoleName3,
|
5726
5518
|
selectRoleChangeRequest,
|
5727
|
-
|
5728
|
-
|
5519
|
+
useCustomEvent as useCustomEvent2,
|
5520
|
+
useHMSActions as useHMSActions21,
|
5521
|
+
useHMSStore as useHMSStore36
|
5729
5522
|
} from "@100mslive/react-sdk";
|
5730
5523
|
var RoleChangeRequestModal = () => {
|
5731
|
-
const hmsActions =
|
5732
|
-
const
|
5733
|
-
const
|
5734
|
-
const
|
5735
|
-
const
|
5736
|
-
const
|
5524
|
+
const hmsActions = useHMSActions21();
|
5525
|
+
const { updateMetaData } = useMyMetadata();
|
5526
|
+
const currentRole = useHMSStore36(selectLocalPeerRoleName3);
|
5527
|
+
const roleChangeRequest = useHMSStore36(selectRoleChangeRequest);
|
5528
|
+
const name = useHMSStore36(selectLocalPeerName);
|
5529
|
+
const { sendEvent } = useCustomEvent2({ type: ROLE_CHANGE_DECLINED });
|
5737
5530
|
useEffect23(() => {
|
5738
|
-
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)
|
5531
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5739
5532
|
return;
|
5740
5533
|
}
|
5741
5534
|
hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
5742
|
-
}, [hmsActions, roleChangeRequest
|
5743
|
-
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)
|
5535
|
+
}, [hmsActions, roleChangeRequest]);
|
5536
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5744
5537
|
return null;
|
5745
5538
|
}
|
5746
|
-
const body = /* @__PURE__ */
|
5539
|
+
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
5540
|
Flex,
|
5748
5541
|
{
|
5749
5542
|
align: "center",
|
@@ -5754,10 +5547,10 @@ var RoleChangeRequestModal = () => {
|
|
5754
5547
|
mt: "$6"
|
5755
5548
|
}
|
5756
5549
|
},
|
5757
|
-
/* @__PURE__ */
|
5758
|
-
/* @__PURE__ */
|
5550
|
+
/* @__PURE__ */ React61.createElement(PreviewTile, { name: name || "" }),
|
5551
|
+
/* @__PURE__ */ React61.createElement(PreviewControls, { hideSettings: true })
|
5759
5552
|
));
|
5760
|
-
return /* @__PURE__ */
|
5553
|
+
return /* @__PURE__ */ React61.createElement(
|
5761
5554
|
RequestDialog,
|
5762
5555
|
{
|
5763
5556
|
title: `You're invited to join the ${roleChangeRequest.role.name} role`,
|
@@ -5765,45 +5558,52 @@ var RoleChangeRequestModal = () => {
|
|
5765
5558
|
var _a;
|
5766
5559
|
if (!value) {
|
5767
5560
|
yield hmsActions.rejectChangeRole(roleChangeRequest);
|
5768
|
-
|
5561
|
+
sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
|
5769
5562
|
yield hmsActions.cancelMidCallPreview();
|
5563
|
+
yield updateMetaData({ isHandRaised: false });
|
5770
5564
|
}
|
5771
5565
|
}),
|
5772
5566
|
body,
|
5773
|
-
onAction: () => {
|
5774
|
-
hmsActions.acceptChangeRole(roleChangeRequest);
|
5775
|
-
|
5776
|
-
},
|
5567
|
+
onAction: () => __async(void 0, null, function* () {
|
5568
|
+
yield hmsActions.acceptChangeRole(roleChangeRequest);
|
5569
|
+
yield updateMetaData({ isHandRaised: false, prevRole: currentRole });
|
5570
|
+
}),
|
5777
5571
|
actionText: "Accept"
|
5778
5572
|
}
|
5779
5573
|
);
|
5780
5574
|
};
|
5781
|
-
var RequestDialog = ({
|
5575
|
+
var RequestDialog = ({
|
5576
|
+
open = true,
|
5577
|
+
onOpenChange,
|
5578
|
+
title,
|
5579
|
+
body,
|
5580
|
+
actionText = "Accept",
|
5581
|
+
onAction
|
5582
|
+
}) => /* @__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
5583
|
|
5783
5584
|
// src/Prebuilt/components/conference.jsx
|
5784
5585
|
var Conference = () => {
|
5785
|
-
var _a, _b;
|
5786
|
-
const navigate =
|
5787
|
-
const { roomId, role } =
|
5788
|
-
const
|
5789
|
-
const { userName } = useHMSPrebuiltContext();
|
5586
|
+
var _a, _b, _c, _d, _e;
|
5587
|
+
const navigate = useNavigate();
|
5588
|
+
const { roomId, role } = useParams();
|
5589
|
+
const { userName, endpoints } = useHMSPrebuiltContext();
|
5790
5590
|
const screenProps = useRoomLayoutConferencingScreen();
|
5791
5591
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
5792
|
-
const roomState =
|
5592
|
+
const roomState = useHMSStore37(selectRoomState);
|
5793
5593
|
const prevState = usePrevious(roomState);
|
5794
|
-
const isConnectedToRoom =
|
5795
|
-
const hmsActions =
|
5594
|
+
const isConnectedToRoom = useHMSStore37(selectIsConnectedToRoom7);
|
5595
|
+
const hmsActions = useHMSActions22();
|
5796
5596
|
const [hideControls, setHideControls] = useState35(false);
|
5797
|
-
const dropdownList =
|
5597
|
+
const dropdownList = useHMSStore37(selectAppData4(APP_DATA.dropdownList));
|
5798
5598
|
const authTokenInAppData = useAuthToken();
|
5799
|
-
const headerRef =
|
5800
|
-
const footerRef =
|
5801
|
-
const
|
5802
|
-
const
|
5599
|
+
const headerRef = useRef14();
|
5600
|
+
const footerRef = useRef14();
|
5601
|
+
const isMobileDevice = isAndroid || isIOS || isIPadOS;
|
5602
|
+
const dropdownListRef = useRef14();
|
5803
5603
|
const [isHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5804
5604
|
const toggleControls = () => {
|
5805
5605
|
var _a2;
|
5806
|
-
if (((_a2 = dropdownListRef.current) == null ? void 0 : _a2.length) === 0) {
|
5606
|
+
if (((_a2 = dropdownListRef.current) == null ? void 0 : _a2.length) === 0 && isMobileDevice) {
|
5807
5607
|
setHideControls((value) => !value);
|
5808
5608
|
}
|
5809
5609
|
};
|
@@ -5814,14 +5614,14 @@ var Conference = () => {
|
|
5814
5614
|
clearTimeout(timeout);
|
5815
5615
|
timeout = setTimeout(() => {
|
5816
5616
|
if (dropdownListRef.current.length === 0) {
|
5817
|
-
setHideControls(
|
5617
|
+
setHideControls(isMobileDevice);
|
5818
5618
|
}
|
5819
5619
|
}, 5e3);
|
5820
5620
|
}
|
5821
5621
|
return () => {
|
5822
5622
|
clearTimeout(timeout);
|
5823
5623
|
};
|
5824
|
-
}, [dropdownList, hideControls]);
|
5624
|
+
}, [dropdownList, hideControls, isMobileDevice]);
|
5825
5625
|
useEffect24(() => {
|
5826
5626
|
if (!roomId) {
|
5827
5627
|
navigate(`/`);
|
@@ -5842,7 +5642,7 @@ var Conference = () => {
|
|
5842
5642
|
hmsActions.join({
|
5843
5643
|
userName,
|
5844
5644
|
authToken: authTokenInAppData,
|
5845
|
-
initEndpoint:
|
5645
|
+
initEndpoint: endpoints == null ? void 0 : endpoints.init,
|
5846
5646
|
initialSettings: {
|
5847
5647
|
isAudioMuted: !isPreviewScreenEnabled,
|
5848
5648
|
isVideoMuted: !isPreviewScreenEnabled,
|
@@ -5850,57 +5650,57 @@ var Conference = () => {
|
|
5850
5650
|
}
|
5851
5651
|
}).catch(console.error);
|
5852
5652
|
}
|
5853
|
-
}, [authTokenInAppData, hmsActions, isConnectedToRoom, isPreviewScreenEnabled, roomState, userName]);
|
5854
|
-
useEffect24(() => {
|
5855
|
-
if (isHeadless) {
|
5856
|
-
hmsActions.ignoreMessageTypes(["chat", EMOJI_REACTION_TYPE]);
|
5857
|
-
}
|
5858
|
-
}, [isHeadless, hmsActions]);
|
5653
|
+
}, [authTokenInAppData, endpoints == null ? void 0 : endpoints.init, hmsActions, isConnectedToRoom, isPreviewScreenEnabled, roomState, userName]);
|
5859
5654
|
useEffect24(() => {
|
5860
5655
|
return () => {
|
5861
5656
|
PictureInPicture.stop().catch((error) => console.error("stopping pip", error));
|
5862
5657
|
};
|
5863
5658
|
}, []);
|
5864
5659
|
if (!isConnectedToRoom) {
|
5865
|
-
return /* @__PURE__ */
|
5866
|
-
}
|
5867
|
-
if (isHLSStarted) {
|
5868
|
-
return /* @__PURE__ */ React61.createElement(FullPageProgress_default, { loadingText: "Starting live stream..." });
|
5660
|
+
return /* @__PURE__ */ React62.createElement(FullPageProgress_default, { text: "Joining..." });
|
5869
5661
|
}
|
5870
|
-
return /* @__PURE__ */
|
5662
|
+
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
5663
|
Box,
|
5872
5664
|
{
|
5873
5665
|
ref: headerRef,
|
5874
5666
|
css: {
|
5875
5667
|
h: "$18",
|
5876
5668
|
transition: "margin 0.3s ease-in-out",
|
5877
|
-
marginTop:
|
5669
|
+
marginTop: hideControls ? `-${(_a = headerRef.current) == null ? void 0 : _a.clientHeight}px` : "none",
|
5878
5670
|
"@md": {
|
5879
5671
|
h: "$17"
|
5880
5672
|
}
|
5881
5673
|
},
|
5882
5674
|
"data-testid": "header"
|
5883
5675
|
},
|
5884
|
-
/* @__PURE__ */
|
5885
|
-
), /* @__PURE__ */
|
5676
|
+
/* @__PURE__ */ React62.createElement(Header, { elements: screenProps.elements, screenType: screenProps.screenType })
|
5677
|
+
), /* @__PURE__ */ React62.createElement(
|
5886
5678
|
Box,
|
5887
5679
|
{
|
5888
5680
|
css: {
|
5889
5681
|
w: "100%",
|
5890
5682
|
flex: "1 1 0",
|
5891
5683
|
minHeight: 0,
|
5892
|
-
px: "$10",
|
5684
|
+
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",
|
5685
|
+
// TODO: padding to be controlled by section/element
|
5893
5686
|
paddingBottom: "env(safe-area-inset-bottom)",
|
5894
5687
|
"@lg": {
|
5895
|
-
px:
|
5688
|
+
px: 0
|
5896
5689
|
}
|
5897
5690
|
},
|
5898
5691
|
id: "conferencing",
|
5899
5692
|
"data-testid": "conferencing",
|
5900
5693
|
onClick: toggleControls
|
5901
5694
|
},
|
5902
|
-
/* @__PURE__ */
|
5903
|
-
|
5695
|
+
/* @__PURE__ */ React62.createElement(
|
5696
|
+
VideoStreamingSection,
|
5697
|
+
{
|
5698
|
+
screenType: screenProps.screenType,
|
5699
|
+
elements: screenProps.elements,
|
5700
|
+
hideControls
|
5701
|
+
}
|
5702
|
+
)
|
5703
|
+
), !screenProps.hideSections.includes("footer") && /* @__PURE__ */ React62.createElement(
|
5904
5704
|
Box,
|
5905
5705
|
{
|
5906
5706
|
ref: footerRef,
|
@@ -5909,7 +5709,7 @@ var Conference = () => {
|
|
5909
5709
|
maxHeight: "$24",
|
5910
5710
|
transition: "margin 0.3s ease-in-out",
|
5911
5711
|
bg: "$background_dim",
|
5912
|
-
marginBottom:
|
5712
|
+
marginBottom: hideControls ? `-${(_e = footerRef.current) == null ? void 0 : _e.clientHeight}px` : void 0,
|
5913
5713
|
"@md": {
|
5914
5714
|
maxHeight: "unset",
|
5915
5715
|
bg: screenProps.screenType === "hls_live_streaming" ? "transparent" : "$background_dim"
|
@@ -5917,11 +5717,11 @@ var Conference = () => {
|
|
5917
5717
|
},
|
5918
5718
|
"data-testid": "footer"
|
5919
5719
|
},
|
5920
|
-
/* @__PURE__ */
|
5921
|
-
), /* @__PURE__ */
|
5720
|
+
/* @__PURE__ */ React62.createElement(Footer2, { elements: screenProps.elements, screenType: screenProps.screenType })
|
5721
|
+
), /* @__PURE__ */ React62.createElement(RoleChangeRequestModal, null), /* @__PURE__ */ React62.createElement(HLSFailureModal, null), /* @__PURE__ */ React62.createElement(ActivatedPIP, null)));
|
5922
5722
|
};
|
5923
5723
|
var conference_default = Conference;
|
5924
5724
|
export {
|
5925
5725
|
conference_default as default
|
5926
5726
|
};
|
5927
|
-
//# sourceMappingURL=conference-
|
5727
|
+
//# sourceMappingURL=conference-UWLJHMB2.js.map
|