@100mslive/roomkit-react 0.3.22-alpha.1 → 0.3.22-alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/ConferenceScreen-CSVWECB5.js +1778 -0
- package/dist/ConferenceScreen-CSVWECB5.js.map +7 -0
- package/dist/ConferenceScreen-YRURU3RV.css +2780 -0
- package/dist/{HLSView-Z2JID2W7.css.map → ConferenceScreen-YRURU3RV.css.map} +1 -1
- package/dist/EmbedView-N2E4DZQA.js +17 -0
- package/dist/EmbedView-N2E4DZQA.js.map +7 -0
- package/dist/EmbedView-S54NTHF5.css +2780 -0
- package/dist/EmbedView-S54NTHF5.css.map +7 -0
- package/dist/EmojiReaction-3X4ST4AU.js +11 -0
- package/dist/EmojiReaction-3X4ST4AU.js.map +7 -0
- package/dist/{HLSView-LCFZPBH3.js → HLSView-EYGGK6BH.js} +38 -24
- package/dist/HLSView-EYGGK6BH.js.map +7 -0
- package/dist/{HLSView-Z2JID2W7.css → HLSView-LBTFLMI4.css} +3 -3
- package/dist/HLSView-LBTFLMI4.css.map +7 -0
- package/dist/LeaveScreen-D6XU64JL.js +556 -0
- package/dist/LeaveScreen-D6XU64JL.js.map +7 -0
- package/dist/LeaveScreen-ZAG5UJZL.css +2780 -0
- package/dist/LeaveScreen-ZAG5UJZL.css.map +7 -0
- package/dist/MoreSettings-R7B4BSNT.css +2780 -0
- package/dist/MoreSettings-R7B4BSNT.css.map +7 -0
- package/dist/MoreSettings-TBJVM7OY.js +16 -0
- package/dist/MoreSettings-TBJVM7OY.js.map +7 -0
- package/dist/PDFView-JOIJDP65.js +84 -0
- package/dist/PDFView-JOIJDP65.js.map +7 -0
- package/dist/PDFView-RMR33QH4.css +2780 -0
- package/dist/PDFView-RMR33QH4.css.map +7 -0
- package/dist/Polls-IN3V2HFI.js +1584 -0
- package/dist/Polls-IN3V2HFI.js.map +7 -0
- package/dist/Polls-JW7JWGTE.css +2780 -0
- package/dist/Polls-JW7JWGTE.css.map +7 -0
- package/dist/Prebuilt/components/Notifications/RoleChangeNotification.d.ts +1 -0
- package/dist/RaiseHand-WES4KKMD.js +10 -0
- package/dist/RaiseHand-WES4KKMD.js.map +7 -0
- package/dist/RoleProminence-4ZBDBCMU.css +2780 -0
- package/dist/RoleProminence-4ZBDBCMU.css.map +7 -0
- package/dist/RoleProminence-PB32DLIB.js +116 -0
- package/dist/RoleProminence-PB32DLIB.js.map +7 -0
- package/dist/RoomDetailsPane-CZH2SNLE.js +53 -0
- package/dist/RoomDetailsPane-CZH2SNLE.js.map +7 -0
- package/dist/RoomDetailsPane-XWH2KEFI.css +2780 -0
- package/dist/RoomDetailsPane-XWH2KEFI.css.map +7 -0
- package/dist/ScreenshareLayout-XVENPVK3.js +358 -0
- package/dist/ScreenshareLayout-XVENPVK3.js.map +7 -0
- package/dist/ScreenshareLayout-YUW3KHAB.css +2780 -0
- package/dist/ScreenshareLayout-YUW3KHAB.css.map +7 -0
- package/dist/SidePaneTabs-QXCDHOGG.js +1354 -0
- package/dist/SidePaneTabs-QXCDHOGG.js.map +7 -0
- package/dist/SidePaneTabs-WQGVOWRP.css +2780 -0
- package/dist/SidePaneTabs-WQGVOWRP.css.map +7 -0
- package/dist/VBPicker-XN74N67R.js +322 -0
- package/dist/VBPicker-XN74N67R.js.map +7 -0
- package/dist/VBPicker-YDM2YIOM.css +2780 -0
- package/dist/VBPicker-YDM2YIOM.css.map +7 -0
- package/dist/WaitingView-77PRTIBV.js +10 -0
- package/dist/WaitingView-77PRTIBV.js.map +7 -0
- package/dist/WhiteboardLayout-FZC7SOSG.js +96 -0
- package/dist/WhiteboardLayout-FZC7SOSG.js.map +7 -0
- package/dist/WhiteboardLayout-MNTUWEVK.css +2780 -0
- package/dist/WhiteboardLayout-MNTUWEVK.css.map +7 -0
- package/dist/android-perm-1.png +0 -0
- package/dist/audio-level.png +0 -0
- package/dist/chunk-26D5FDBW.js +16812 -0
- package/dist/chunk-26D5FDBW.js.map +7 -0
- package/dist/chunk-2J5WS52X.js +2595 -0
- package/dist/chunk-2J5WS52X.js.map +7 -0
- package/dist/chunk-2LWOQMYY.js +30 -0
- package/dist/chunk-2LWOQMYY.js.map +7 -0
- package/dist/chunk-3MRQJSIY.js +171 -0
- package/dist/chunk-3MRQJSIY.js.map +7 -0
- package/dist/chunk-4X4WB7X3.js +98 -0
- package/dist/chunk-4X4WB7X3.js.map +7 -0
- package/dist/chunk-7QZJMUHM.js +90 -0
- package/dist/chunk-7QZJMUHM.js.map +7 -0
- package/dist/chunk-ABCV7TX5.js +71 -0
- package/dist/chunk-ABCV7TX5.js.map +7 -0
- package/dist/chunk-BQOT4DK7.js +418 -0
- package/dist/chunk-BQOT4DK7.js.map +7 -0
- package/dist/chunk-ENHSO6YN.js +6337 -0
- package/dist/chunk-ENHSO6YN.js.map +7 -0
- package/dist/chunk-JKWX7W4K.js +161 -0
- package/dist/chunk-JKWX7W4K.js.map +7 -0
- package/dist/chunk-LO4BXA4G.js +114 -0
- package/dist/chunk-LO4BXA4G.js.map +7 -0
- package/dist/chunk-MRVWNFXC.js +59 -0
- package/dist/chunk-MRVWNFXC.js.map +7 -0
- package/dist/chunk-OA4HW7HW.js +262 -0
- package/dist/chunk-OA4HW7HW.js.map +7 -0
- package/dist/chunk-PJQSPAFZ.js +178 -0
- package/dist/chunk-PJQSPAFZ.js.map +7 -0
- package/dist/chunk-QHQKY35W.js +830 -0
- package/dist/chunk-QHQKY35W.js.map +7 -0
- package/dist/chunk-QKXHQ6DV.js +254 -0
- package/dist/chunk-QKXHQ6DV.js.map +7 -0
- package/dist/chunk-RTWNTT77.js +62 -0
- package/dist/chunk-RTWNTT77.js.map +7 -0
- package/dist/chunk-TBXRX6MK.js +576 -0
- package/dist/chunk-TBXRX6MK.js.map +7 -0
- package/dist/chunk-TCOPR3BK.js +487 -0
- package/dist/chunk-TCOPR3BK.js.map +7 -0
- package/dist/chunk-VKORP2LF.js +41 -0
- package/dist/chunk-VKORP2LF.js.map +7 -0
- package/dist/chunk-YYVDCP5Z.js +136 -0
- package/dist/chunk-YYVDCP5Z.js.map +7 -0
- package/dist/empty-chat.svg +12 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +17888 -17792
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +25 -15
- package/dist/ios-perm-0.png +0 -0
- package/dist/meta.cjs.json +5326 -5184
- package/dist/meta.esbuild.json +8960 -6320
- package/dist/pdf-share.png +0 -0
- package/dist/screen-share.png +0 -0
- package/dist/transaction_error.svg +12 -0
- package/package.json +7 -7
- package/src/Prebuilt/App.tsx +6 -2
- package/src/Prebuilt/components/Chat/Chat.tsx +12 -8
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
- package/src/Prebuilt/components/Notifications/Notifications.tsx +2 -0
- package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +0 -14
- package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +24 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +43 -31
- package/src/Prebuilt/layouts/HLSView.jsx +1 -0
- package/src/Prebuilt/layouts/PDFView.jsx +1 -0
- package/src/Prebuilt/layouts/SidePane.tsx +12 -6
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +35 -34
- package/dist/HLSView-LCFZPBH3.js.map +0 -7
- package/dist/chunk-CRGZUJSX.js +0 -34811
- package/dist/chunk-CRGZUJSX.js.map +0 -7
@@ -0,0 +1,1778 @@
|
|
1
|
+
import {
|
2
|
+
Header
|
3
|
+
} from "./chunk-OA4HW7HW.js";
|
4
|
+
import {
|
5
|
+
Grid
|
6
|
+
} from "./chunk-MRVWNFXC.js";
|
7
|
+
import {
|
8
|
+
InsetTile
|
9
|
+
} from "./chunk-YYVDCP5Z.js";
|
10
|
+
import {
|
11
|
+
ChatToggle,
|
12
|
+
LeaveRoom
|
13
|
+
} from "./chunk-TCOPR3BK.js";
|
14
|
+
import {
|
15
|
+
WaitingView
|
16
|
+
} from "./chunk-ABCV7TX5.js";
|
17
|
+
import {
|
18
|
+
Pagination,
|
19
|
+
VideoTileContext,
|
20
|
+
usePagesWithTiles,
|
21
|
+
useTileLayout
|
22
|
+
} from "./chunk-PJQSPAFZ.js";
|
23
|
+
import {
|
24
|
+
ParticipantCount
|
25
|
+
} from "./chunk-QHQKY35W.js";
|
26
|
+
import {
|
27
|
+
ActivatedPIP,
|
28
|
+
MoreSettings,
|
29
|
+
useUnreadPollQuizPresent
|
30
|
+
} from "./chunk-2J5WS52X.js";
|
31
|
+
import "./chunk-QKXHQ6DV.js";
|
32
|
+
import {
|
33
|
+
EmojiReaction
|
34
|
+
} from "./chunk-LO4BXA4G.js";
|
35
|
+
import {
|
36
|
+
RaiseHand
|
37
|
+
} from "./chunk-VKORP2LF.js";
|
38
|
+
import {
|
39
|
+
useMyMetadata
|
40
|
+
} from "./chunk-RTWNTT77.js";
|
41
|
+
import "./chunk-2LWOQMYY.js";
|
42
|
+
import {
|
43
|
+
AudioVideoToggle,
|
44
|
+
Button,
|
45
|
+
Dialog,
|
46
|
+
DialogCol,
|
47
|
+
DialogInputFile,
|
48
|
+
DialogRow,
|
49
|
+
Footer,
|
50
|
+
FullPageProgress_default,
|
51
|
+
PictureInPicture,
|
52
|
+
PreviewControls,
|
53
|
+
PreviewTile,
|
54
|
+
Sheet,
|
55
|
+
SidePane_default,
|
56
|
+
VBToggle,
|
57
|
+
useHMSPrebuiltContext,
|
58
|
+
useIsSidepaneTypeOpen,
|
59
|
+
usePollViewToggle,
|
60
|
+
useSidepaneToggle
|
61
|
+
} from "./chunk-26D5FDBW.js";
|
62
|
+
import {
|
63
|
+
Text
|
64
|
+
} from "./chunk-JKWX7W4K.js";
|
65
|
+
import {
|
66
|
+
Dropdown,
|
67
|
+
ToastManager,
|
68
|
+
useLandscapeHLSStream,
|
69
|
+
useMobileHLSStream,
|
70
|
+
useWaitingRoomInfo
|
71
|
+
} from "./chunk-BQOT4DK7.js";
|
72
|
+
import {
|
73
|
+
Box,
|
74
|
+
Flex
|
75
|
+
} from "./chunk-7QZJMUHM.js";
|
76
|
+
import {
|
77
|
+
IconButton,
|
78
|
+
IconButton_default,
|
79
|
+
Tooltip,
|
80
|
+
isScreenshareSupported,
|
81
|
+
useAuthToken,
|
82
|
+
useIsCaptionEnabled,
|
83
|
+
usePDFConfig,
|
84
|
+
usePinnedTrack,
|
85
|
+
useRoomLayoutConferencingScreen,
|
86
|
+
useRoomLayoutPreviewScreen,
|
87
|
+
useSetAppDataByKey,
|
88
|
+
useSetIsCaptionEnabled,
|
89
|
+
useShowPolls,
|
90
|
+
useUISettings,
|
91
|
+
useUrlToEmbed
|
92
|
+
} from "./chunk-ENHSO6YN.js";
|
93
|
+
import {
|
94
|
+
APP_DATA,
|
95
|
+
ROLE_CHANGE_DECLINED,
|
96
|
+
SIDE_PANE_OPTIONS,
|
97
|
+
UI_SETTINGS,
|
98
|
+
__async,
|
99
|
+
__spreadProps,
|
100
|
+
__spreadValues,
|
101
|
+
config,
|
102
|
+
init_define_process_env,
|
103
|
+
isAndroid,
|
104
|
+
isIOS,
|
105
|
+
isIPadOS,
|
106
|
+
styled
|
107
|
+
} from "./chunk-TBXRX6MK.js";
|
108
|
+
|
109
|
+
// src/Prebuilt/components/ConferenceScreen.tsx
|
110
|
+
init_define_process_env();
|
111
|
+
import React19, { useEffect as useEffect10, useRef as useRef2, useState as useState8 } from "react";
|
112
|
+
import { v4 as uuid } from "uuid";
|
113
|
+
import {
|
114
|
+
HMSRoomState,
|
115
|
+
selectAppData,
|
116
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom2,
|
117
|
+
selectRoomState,
|
118
|
+
useAwayNotifications as useAwayNotifications2,
|
119
|
+
useHMSActions as useHMSActions4,
|
120
|
+
useHMSStore as useHMSStore10
|
121
|
+
} from "@100mslive/react-sdk";
|
122
|
+
|
123
|
+
// src/Prebuilt/components/Footer/Footer.tsx
|
124
|
+
init_define_process_env();
|
125
|
+
import React11, { useEffect as useEffect2 } from "react";
|
126
|
+
import { useMedia } from "react-use";
|
127
|
+
import { Chat_ChatState } from "@100mslive/types-prebuilt/elements/chat";
|
128
|
+
|
129
|
+
// src/Prebuilt/components/CaptionIcon.tsx
|
130
|
+
init_define_process_env();
|
131
|
+
import React from "react";
|
132
|
+
import { selectIsTranscriptionEnabled, useHMSStore } from "@100mslive/react-sdk";
|
133
|
+
import { ClosedCaptionIcon, OpenCaptionIcon } from "@100mslive/react-icons";
|
134
|
+
var CaptionIcon = () => {
|
135
|
+
const isCaptionPresent = useHMSStore(selectIsTranscriptionEnabled);
|
136
|
+
const [isCaption, setIsCaption] = useSetIsCaptionEnabled();
|
137
|
+
const onClick = () => {
|
138
|
+
setIsCaption(!isCaption);
|
139
|
+
};
|
140
|
+
if (!isCaptionPresent) {
|
141
|
+
return null;
|
142
|
+
}
|
143
|
+
return /* @__PURE__ */ React.createElement(Tooltip, { title: isCaption ? "Hide closed captions" : "Show closed captions" }, /* @__PURE__ */ React.createElement(IconButton_default, { "data-testid": "caption_btn", onClick }, isCaption ? /* @__PURE__ */ React.createElement(ClosedCaptionIcon, { width: "20", height: "20px" }) : /* @__PURE__ */ React.createElement(OpenCaptionIcon, { width: "20", height: "20px" })));
|
144
|
+
};
|
145
|
+
|
146
|
+
// src/Prebuilt/components/ScreenShareToggle.jsx
|
147
|
+
init_define_process_env();
|
148
|
+
import React8, { Fragment as Fragment2 } from "react";
|
149
|
+
import { selectIsAllowedToPublish, useAwayNotifications, useHMSStore as useHMSStore2, useScreenShare as useScreenShare2 } from "@100mslive/react-sdk";
|
150
|
+
import { ShareScreenIcon } from "@100mslive/react-icons";
|
151
|
+
|
152
|
+
// src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
|
153
|
+
init_define_process_env();
|
154
|
+
import React7, { Fragment, useState as useState2 } from "react";
|
155
|
+
import { useScreenShare } from "@100mslive/react-sdk";
|
156
|
+
import { StarIcon, VerticalMenuIcon } from "@100mslive/react-icons";
|
157
|
+
|
158
|
+
// src/Prebuilt/images/pdf-share.png
|
159
|
+
var pdf_share_default = "./pdf-share.png";
|
160
|
+
|
161
|
+
// src/Prebuilt/images/screen-share.png
|
162
|
+
var screen_share_default = "./screen-share.png";
|
163
|
+
|
164
|
+
// src/Prebuilt/components/ShareMenuIcon.jsx
|
165
|
+
init_define_process_env();
|
166
|
+
var ScreenShareButton = styled(IconButton_default, {
|
167
|
+
h: "$14",
|
168
|
+
px: "$8",
|
169
|
+
r: "$1",
|
170
|
+
borderTopRightRadius: 0,
|
171
|
+
borderBottomRightRadius: 0,
|
172
|
+
"@md": {
|
173
|
+
px: "$4",
|
174
|
+
mx: 0
|
175
|
+
}
|
176
|
+
});
|
177
|
+
var ShareMenuIcon = styled(ScreenShareButton, {
|
178
|
+
borderTopLeftRadius: 0,
|
179
|
+
borderBottomLeftRadius: 0,
|
180
|
+
borderTopRightRadius: "$1",
|
181
|
+
borderBottomRightRadius: "$1",
|
182
|
+
borderLeftWidth: 0,
|
183
|
+
w: "$4",
|
184
|
+
"@md": {
|
185
|
+
w: "unset",
|
186
|
+
px: "$2"
|
187
|
+
}
|
188
|
+
});
|
189
|
+
|
190
|
+
// src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
|
191
|
+
init_define_process_env();
|
192
|
+
import React6, { useState } from "react";
|
193
|
+
|
194
|
+
// src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx
|
195
|
+
init_define_process_env();
|
196
|
+
import React2 from "react";
|
197
|
+
var PDFHeader = () => {
|
198
|
+
return /* @__PURE__ */ React2.createElement(
|
199
|
+
DialogCol,
|
200
|
+
{
|
201
|
+
align: "start",
|
202
|
+
css: {
|
203
|
+
mt: 0,
|
204
|
+
mb: "$6"
|
205
|
+
}
|
206
|
+
},
|
207
|
+
/* @__PURE__ */ React2.createElement(Dialog.Title, { asChild: true }, /* @__PURE__ */ React2.createElement(Text, { as: "h6", variant: "h6" }, "Share PDF")),
|
208
|
+
/* @__PURE__ */ React2.createElement(Dialog.Description, { asChild: true }, /* @__PURE__ */ React2.createElement(
|
209
|
+
Text,
|
210
|
+
{
|
211
|
+
variant: "sm",
|
212
|
+
css: {
|
213
|
+
c: "$on_surface_medium"
|
214
|
+
}
|
215
|
+
},
|
216
|
+
"Choose PDF you want to annotate and share"
|
217
|
+
))
|
218
|
+
);
|
219
|
+
};
|
220
|
+
|
221
|
+
// src/Prebuilt/components/pdfAnnotator/submitPdf.jsx
|
222
|
+
init_define_process_env();
|
223
|
+
import React3 from "react";
|
224
|
+
var SubmitPDF = ({ pdfFile, onOpenChange }) => {
|
225
|
+
const [, setPDFConfig] = useSetAppDataByKey(APP_DATA.pdfConfig);
|
226
|
+
return /* @__PURE__ */ React3.createElement(
|
227
|
+
Flex,
|
228
|
+
{
|
229
|
+
direction: "row",
|
230
|
+
css: {
|
231
|
+
mb: "0",
|
232
|
+
mt: "auto",
|
233
|
+
gap: "$8"
|
234
|
+
}
|
235
|
+
},
|
236
|
+
/* @__PURE__ */ React3.createElement(
|
237
|
+
Button,
|
238
|
+
{
|
239
|
+
variant: "standard",
|
240
|
+
outlined: true,
|
241
|
+
type: "submit",
|
242
|
+
onClick: () => {
|
243
|
+
onOpenChange(false);
|
244
|
+
},
|
245
|
+
css: { w: "50%" }
|
246
|
+
},
|
247
|
+
"Cancel"
|
248
|
+
),
|
249
|
+
/* @__PURE__ */ React3.createElement(
|
250
|
+
Button,
|
251
|
+
{
|
252
|
+
variant: "primary",
|
253
|
+
type: "submit",
|
254
|
+
onClick: () => {
|
255
|
+
if (pdfFile) {
|
256
|
+
setPDFConfig(pdfFile);
|
257
|
+
onOpenChange(false);
|
258
|
+
}
|
259
|
+
},
|
260
|
+
disabled: !pdfFile,
|
261
|
+
"data-testid": "share_pdf_btn",
|
262
|
+
css: {
|
263
|
+
w: "50%"
|
264
|
+
}
|
265
|
+
},
|
266
|
+
"Start Sharing"
|
267
|
+
)
|
268
|
+
);
|
269
|
+
};
|
270
|
+
|
271
|
+
// src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx
|
272
|
+
init_define_process_env();
|
273
|
+
import React5 from "react";
|
274
|
+
import { TrashIcon } from "@100mslive/react-icons";
|
275
|
+
|
276
|
+
// src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx
|
277
|
+
init_define_process_env();
|
278
|
+
import React4 from "react";
|
279
|
+
import { InfoIcon } from "@100mslive/react-icons";
|
280
|
+
var PDFInfo = () => {
|
281
|
+
return /* @__PURE__ */ React4.createElement(
|
282
|
+
DialogRow,
|
283
|
+
{
|
284
|
+
css: {
|
285
|
+
px: "$8",
|
286
|
+
py: "$3",
|
287
|
+
bg: "$surface_default",
|
288
|
+
r: "$1",
|
289
|
+
outline: "none",
|
290
|
+
border: "1px solid $border_bright",
|
291
|
+
minHeight: "$11"
|
292
|
+
}
|
293
|
+
},
|
294
|
+
/* @__PURE__ */ React4.createElement(
|
295
|
+
InfoIcon,
|
296
|
+
{
|
297
|
+
width: "64px",
|
298
|
+
height: "64px",
|
299
|
+
style: {
|
300
|
+
paddingRight: "16px"
|
301
|
+
}
|
302
|
+
}
|
303
|
+
),
|
304
|
+
/* @__PURE__ */ React4.createElement(Text, { variant: "caption" }, "On the next screen, ensure you select \u201CThis Tab\u201D and click on share. Only the PDF viewer will be seen by other participants")
|
305
|
+
);
|
306
|
+
};
|
307
|
+
|
308
|
+
// src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx
|
309
|
+
var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
310
|
+
const [fileName, ext] = pdfFile.name.split(".");
|
311
|
+
return /* @__PURE__ */ React5.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React5.createElement(Dialog.Portal, null, /* @__PURE__ */ React5.createElement(Dialog.Overlay, null), /* @__PURE__ */ React5.createElement(
|
312
|
+
Dialog.Content,
|
313
|
+
{
|
314
|
+
css: {
|
315
|
+
w: "min(420px,80%)",
|
316
|
+
overflow: "auto",
|
317
|
+
p: "$10",
|
318
|
+
bg: "$surface_dim"
|
319
|
+
}
|
320
|
+
},
|
321
|
+
/* @__PURE__ */ React5.createElement(Flex, { direction: "column" }, /* @__PURE__ */ React5.createElement(PDFHeader, null), /* @__PURE__ */ React5.createElement(
|
322
|
+
DialogRow,
|
323
|
+
{
|
324
|
+
css: {
|
325
|
+
fontFamily: "$sans",
|
326
|
+
bg: "$surface_bright",
|
327
|
+
r: "$1",
|
328
|
+
outline: "none",
|
329
|
+
border: "1px solid $border_bright",
|
330
|
+
p: "$4 $6",
|
331
|
+
minHeight: "$11",
|
332
|
+
c: "$on_primary_high",
|
333
|
+
fs: "$md",
|
334
|
+
w: "100%",
|
335
|
+
"&:focus": {
|
336
|
+
boxShadow: "0 0 0 1px $colors$primary_default",
|
337
|
+
border: "1px solid transparent"
|
338
|
+
},
|
339
|
+
mb: 0,
|
340
|
+
mt: "$6"
|
341
|
+
}
|
342
|
+
},
|
343
|
+
/* @__PURE__ */ React5.createElement(Flex, { direction: "row", css: { flexGrow: "1", maxWidth: "88%" } }, /* @__PURE__ */ React5.createElement(
|
344
|
+
Text,
|
345
|
+
{
|
346
|
+
css: {
|
347
|
+
textOverflow: "ellipsis",
|
348
|
+
overflow: "hidden",
|
349
|
+
whiteSpace: "nowrap"
|
350
|
+
}
|
351
|
+
},
|
352
|
+
fileName
|
353
|
+
), /* @__PURE__ */ React5.createElement(Text, { css: { whiteSpace: "nowrap" } }, ".", ext)),
|
354
|
+
/* @__PURE__ */ React5.createElement(
|
355
|
+
TrashIcon,
|
356
|
+
{
|
357
|
+
onClick: () => setPDFFile(null),
|
358
|
+
style: {
|
359
|
+
cursor: "pointer"
|
360
|
+
}
|
361
|
+
}
|
362
|
+
)
|
363
|
+
), /* @__PURE__ */ React5.createElement(PDFInfo, null), /* @__PURE__ */ React5.createElement(SubmitPDF, { pdfFile, onOpenChange }))
|
364
|
+
)));
|
365
|
+
};
|
366
|
+
|
367
|
+
// src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
|
368
|
+
function PDFFileOptions({ onOpenChange }) {
|
369
|
+
const [pdfFile, setPDFFile] = useState(null);
|
370
|
+
return !pdfFile ? /* @__PURE__ */ React6.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React6.createElement(Dialog.Portal, null, /* @__PURE__ */ React6.createElement(Dialog.Overlay, null), /* @__PURE__ */ React6.createElement(
|
371
|
+
Dialog.Content,
|
372
|
+
{
|
373
|
+
css: {
|
374
|
+
w: "min(420px,80%)",
|
375
|
+
overflow: "auto",
|
376
|
+
p: "$10",
|
377
|
+
bg: "$surface_dim"
|
378
|
+
}
|
379
|
+
},
|
380
|
+
/* @__PURE__ */ React6.createElement(Flex, { direction: "column" }, /* @__PURE__ */ React6.createElement(PDFHeader, null), /* @__PURE__ */ React6.createElement(
|
381
|
+
DialogInputFile,
|
382
|
+
{
|
383
|
+
onChange: (target) => {
|
384
|
+
setPDFFile(target.files[0]);
|
385
|
+
},
|
386
|
+
placeholder: "Click to upload",
|
387
|
+
type: "file",
|
388
|
+
accept: ".pdf"
|
389
|
+
}
|
390
|
+
), /* @__PURE__ */ React6.createElement(SubmitPDF, { pdfFile, onOpenChange }))
|
391
|
+
))) : /* @__PURE__ */ React6.createElement(UploadedFile, { pdfFile, setPDFFile, onOpenChange });
|
392
|
+
}
|
393
|
+
|
394
|
+
// src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
|
395
|
+
var MODALS = {
|
396
|
+
SHARE: "share",
|
397
|
+
SCREEN_SHARE: "screenShare",
|
398
|
+
PDF_SHARE: "pdfShare"
|
399
|
+
};
|
400
|
+
function ShareScreenOptions() {
|
401
|
+
const [openModals, setOpenModals] = useState2(/* @__PURE__ */ new Set());
|
402
|
+
const { amIScreenSharing } = useScreenShare();
|
403
|
+
const updateState = (modalName, value) => {
|
404
|
+
setOpenModals((modals) => {
|
405
|
+
const copy = new Set(modals);
|
406
|
+
if (value) {
|
407
|
+
copy.add(modalName);
|
408
|
+
} else {
|
409
|
+
copy.delete(modalName);
|
410
|
+
}
|
411
|
+
return copy;
|
412
|
+
});
|
413
|
+
};
|
414
|
+
const { toggleScreenShare } = useScreenShare();
|
415
|
+
return /* @__PURE__ */ React7.createElement(Fragment, null, /* @__PURE__ */ React7.createElement(
|
416
|
+
Dropdown.Root,
|
417
|
+
{
|
418
|
+
open: openModals.has(MODALS.SHARE),
|
419
|
+
onOpenChange: (value) => updateState(MODALS.SHARE, value),
|
420
|
+
modal: false
|
421
|
+
},
|
422
|
+
/* @__PURE__ */ React7.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "sharing_btn", disabled: amIScreenSharing }, /* @__PURE__ */ React7.createElement(ShareMenuIcon, { disabled: amIScreenSharing }, /* @__PURE__ */ React7.createElement(Tooltip, { title: "Share" }, /* @__PURE__ */ React7.createElement(Box, null, /* @__PURE__ */ React7.createElement(VerticalMenuIcon, null))))),
|
423
|
+
/* @__PURE__ */ React7.createElement(
|
424
|
+
Dropdown.Content,
|
425
|
+
{
|
426
|
+
sideOffset: 5,
|
427
|
+
css: {
|
428
|
+
w: "$96",
|
429
|
+
maxHeight: "$96",
|
430
|
+
p: 0,
|
431
|
+
bg: "$surface_dim"
|
432
|
+
}
|
433
|
+
},
|
434
|
+
/* @__PURE__ */ React7.createElement(
|
435
|
+
Dropdown.Item,
|
436
|
+
{
|
437
|
+
css: {
|
438
|
+
flexDirection: "column",
|
439
|
+
alignItems: "flex-start",
|
440
|
+
px: "$10",
|
441
|
+
pt: "$10",
|
442
|
+
pb: "$6",
|
443
|
+
"&:hover": {
|
444
|
+
bg: "transparent",
|
445
|
+
cursor: "default"
|
446
|
+
}
|
447
|
+
}
|
448
|
+
},
|
449
|
+
/* @__PURE__ */ React7.createElement(Text, { variant: "h6" }, "Start Sharing"),
|
450
|
+
/* @__PURE__ */ React7.createElement(Text, { variant: "sm" }, "Choose what you want to share")
|
451
|
+
),
|
452
|
+
/* @__PURE__ */ React7.createElement(
|
453
|
+
Dropdown.Item,
|
454
|
+
{
|
455
|
+
css: {
|
456
|
+
flexDirection: "row",
|
457
|
+
alignItems: "flex-start",
|
458
|
+
gap: "$8",
|
459
|
+
px: "$10",
|
460
|
+
pt: "$6",
|
461
|
+
pb: "$10",
|
462
|
+
"&:hover": {
|
463
|
+
bg: "transparent",
|
464
|
+
cursor: "default"
|
465
|
+
}
|
466
|
+
}
|
467
|
+
},
|
468
|
+
/* @__PURE__ */ React7.createElement(
|
469
|
+
Flex,
|
470
|
+
{
|
471
|
+
direction: "column",
|
472
|
+
align: "center",
|
473
|
+
css: {
|
474
|
+
gap: "$6"
|
475
|
+
}
|
476
|
+
},
|
477
|
+
/* @__PURE__ */ React7.createElement(
|
478
|
+
IconButton,
|
479
|
+
{
|
480
|
+
as: "div",
|
481
|
+
onClick: toggleScreenShare,
|
482
|
+
css: {
|
483
|
+
p: "$6",
|
484
|
+
display: "flex",
|
485
|
+
justifyContent: "center",
|
486
|
+
border: "1px solid $border_bright",
|
487
|
+
r: "$2",
|
488
|
+
bg: "$surface_brighter",
|
489
|
+
pb: "0"
|
490
|
+
}
|
491
|
+
},
|
492
|
+
/* @__PURE__ */ React7.createElement(
|
493
|
+
"img",
|
494
|
+
{
|
495
|
+
src: screen_share_default,
|
496
|
+
alt: "screen-share",
|
497
|
+
width: "100%",
|
498
|
+
height: "100%",
|
499
|
+
style: {
|
500
|
+
borderTopLeftRadius: "0.5rem",
|
501
|
+
// TODO: create image component to solve for style hardcoding
|
502
|
+
borderTopRightRadius: "0.5rem"
|
503
|
+
}
|
504
|
+
}
|
505
|
+
)
|
506
|
+
),
|
507
|
+
/* @__PURE__ */ React7.createElement(Flex, { direction: "column", align: "center" }, /* @__PURE__ */ React7.createElement(Text, { variant: "body2" }, "Share Screen"), /* @__PURE__ */ React7.createElement(
|
508
|
+
Text,
|
509
|
+
{
|
510
|
+
variant: "caption",
|
511
|
+
css: {
|
512
|
+
c: "$on_surface_low",
|
513
|
+
textAlign: "center"
|
514
|
+
}
|
515
|
+
},
|
516
|
+
"Share your tab, window or your entire screen"
|
517
|
+
))
|
518
|
+
),
|
519
|
+
/* @__PURE__ */ React7.createElement(
|
520
|
+
Flex,
|
521
|
+
{
|
522
|
+
direction: "column",
|
523
|
+
align: "center",
|
524
|
+
css: {
|
525
|
+
gap: "$6"
|
526
|
+
}
|
527
|
+
},
|
528
|
+
/* @__PURE__ */ React7.createElement(
|
529
|
+
IconButton,
|
530
|
+
{
|
531
|
+
onClick: () => {
|
532
|
+
updateState(MODALS.PDF_SHARE, true);
|
533
|
+
},
|
534
|
+
disabled: amIScreenSharing,
|
535
|
+
css: {
|
536
|
+
p: "$6",
|
537
|
+
display: "flex",
|
538
|
+
justifyContent: "center",
|
539
|
+
border: "$border_bright 1px solid",
|
540
|
+
r: "$2",
|
541
|
+
bg: "$surface_bright",
|
542
|
+
pb: "0"
|
543
|
+
}
|
544
|
+
},
|
545
|
+
/* @__PURE__ */ React7.createElement(
|
546
|
+
"img",
|
547
|
+
{
|
548
|
+
src: pdf_share_default,
|
549
|
+
alt: "pdf-share",
|
550
|
+
width: "100%",
|
551
|
+
height: "100%",
|
552
|
+
style: {
|
553
|
+
borderTopLeftRadius: "0.5rem",
|
554
|
+
// TODO: create image component to solve for style hardcoding
|
555
|
+
borderTopRightRadius: "0.5rem"
|
556
|
+
}
|
557
|
+
}
|
558
|
+
),
|
559
|
+
/* @__PURE__ */ React7.createElement(
|
560
|
+
Flex,
|
561
|
+
{
|
562
|
+
direction: "row",
|
563
|
+
align: "center",
|
564
|
+
css: {
|
565
|
+
position: "absolute",
|
566
|
+
top: "35%",
|
567
|
+
left: "54%",
|
568
|
+
padding: "$2 $4",
|
569
|
+
r: "$2",
|
570
|
+
bg: "$primary_bright",
|
571
|
+
zIndex: "2",
|
572
|
+
gap: "$2"
|
573
|
+
}
|
574
|
+
},
|
575
|
+
/* @__PURE__ */ React7.createElement(StarIcon, { height: 14, width: 14 }),
|
576
|
+
/* @__PURE__ */ React7.createElement(
|
577
|
+
Text,
|
578
|
+
{
|
579
|
+
variant: "xs",
|
580
|
+
css: {
|
581
|
+
fontWeight: "$semiBold",
|
582
|
+
c: "$on_primary_high",
|
583
|
+
pr: "$4"
|
584
|
+
}
|
585
|
+
},
|
586
|
+
"New"
|
587
|
+
)
|
588
|
+
)
|
589
|
+
),
|
590
|
+
/* @__PURE__ */ React7.createElement(Flex, { direction: "column", align: "center" }, /* @__PURE__ */ React7.createElement(Text, { variant: "body2" }, "Share PDF"), /* @__PURE__ */ React7.createElement(
|
591
|
+
Text,
|
592
|
+
{
|
593
|
+
variant: "caption",
|
594
|
+
css: {
|
595
|
+
c: "$on_surface_low",
|
596
|
+
textAlign: "center"
|
597
|
+
}
|
598
|
+
},
|
599
|
+
"Annotate, draw shapes, and more over PDFs"
|
600
|
+
))
|
601
|
+
)
|
602
|
+
)
|
603
|
+
)
|
604
|
+
), openModals.has(MODALS.PDF_SHARE) && /* @__PURE__ */ React7.createElement(PDFFileOptions, { onOpenChange: (value) => updateState(MODALS.PDF_SHARE, value) }));
|
605
|
+
}
|
606
|
+
|
607
|
+
// src/Prebuilt/components/ScreenShareToggle.jsx
|
608
|
+
var ScreenshareToggle = ({ css = {} }) => {
|
609
|
+
const isAllowedToPublish = useHMSStore2(selectIsAllowedToPublish);
|
610
|
+
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
611
|
+
const {
|
612
|
+
amIScreenSharing,
|
613
|
+
screenShareVideoTrackId: video,
|
614
|
+
toggleScreenShare
|
615
|
+
} = useScreenShare2((error) => {
|
616
|
+
ToastManager.addToast({
|
617
|
+
title: error.message,
|
618
|
+
variant: "error",
|
619
|
+
duration: 2e3
|
620
|
+
});
|
621
|
+
});
|
622
|
+
const { requestPermission } = useAwayNotifications();
|
623
|
+
const isVideoScreenshare = amIScreenSharing && !!video;
|
624
|
+
if (!isAllowedToPublish.screen || !isScreenshareSupported()) {
|
625
|
+
return null;
|
626
|
+
}
|
627
|
+
return /* @__PURE__ */ React8.createElement(Fragment2, null, /* @__PURE__ */ React8.createElement(Flex, { direction: "row" }, /* @__PURE__ */ React8.createElement(
|
628
|
+
ScreenShareButton,
|
629
|
+
{
|
630
|
+
variant: "standard",
|
631
|
+
key: "ShareScreen",
|
632
|
+
active: !isVideoScreenshare,
|
633
|
+
css,
|
634
|
+
disabled: isAudioOnly,
|
635
|
+
onClick: () => __async(void 0, null, function* () {
|
636
|
+
yield toggleScreenShare();
|
637
|
+
yield requestPermission();
|
638
|
+
})
|
639
|
+
},
|
640
|
+
/* @__PURE__ */ React8.createElement(Tooltip, { title: `${!isVideoScreenshare ? "Start" : "Stop"} screen sharing` }, /* @__PURE__ */ React8.createElement(Box, null, /* @__PURE__ */ React8.createElement(ShareScreenIcon, null)))
|
641
|
+
), /* @__PURE__ */ React8.createElement(ShareScreenOptions, null)));
|
642
|
+
};
|
643
|
+
|
644
|
+
// src/Prebuilt/components/Footer/PollsToggle.tsx
|
645
|
+
init_define_process_env();
|
646
|
+
import React9, { useEffect } from "react";
|
647
|
+
import { QuizActiveIcon, QuizIcon } from "@100mslive/react-icons";
|
648
|
+
var PollsToggle = () => {
|
649
|
+
const isPollsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.POLLS);
|
650
|
+
const togglePollView = usePollViewToggle();
|
651
|
+
const { unreadPollQuiz, setUnreadPollQuiz } = useUnreadPollQuizPresent();
|
652
|
+
useEffect(() => {
|
653
|
+
if (unreadPollQuiz && isPollsOpen) {
|
654
|
+
setUnreadPollQuiz(false);
|
655
|
+
}
|
656
|
+
}, [isPollsOpen, unreadPollQuiz, setUnreadPollQuiz]);
|
657
|
+
return /* @__PURE__ */ React9.createElement(Tooltip, { key: "polls", title: `${isPollsOpen ? "Close" : "Open"} polls and quizzes` }, /* @__PURE__ */ React9.createElement(
|
658
|
+
IconButton_default,
|
659
|
+
{
|
660
|
+
onClick: () => {
|
661
|
+
togglePollView();
|
662
|
+
setUnreadPollQuiz(false);
|
663
|
+
},
|
664
|
+
css: { bg: isPollsOpen ? "$surface_brighter" : "" },
|
665
|
+
"data-testid": "polls_btn"
|
666
|
+
},
|
667
|
+
unreadPollQuiz ? /* @__PURE__ */ React9.createElement(QuizActiveIcon, null) : /* @__PURE__ */ React9.createElement(QuizIcon, null)
|
668
|
+
));
|
669
|
+
};
|
670
|
+
|
671
|
+
// src/Prebuilt/components/Footer/WhiteboardToggle.tsx
|
672
|
+
init_define_process_env();
|
673
|
+
import React10 from "react";
|
674
|
+
import { selectPeerScreenSharing, useHMSStore as useHMSStore3, useWhiteboard } from "@100mslive/react-sdk";
|
675
|
+
import { PencilDrawIcon } from "@100mslive/react-icons";
|
676
|
+
var WhiteboardToggle = () => {
|
677
|
+
const { toggle, open, isOwner } = useWhiteboard();
|
678
|
+
const peerSharing = useHMSStore3(selectPeerScreenSharing);
|
679
|
+
const disabled = !!peerSharing || open && !isOwner;
|
680
|
+
if (!toggle) {
|
681
|
+
return null;
|
682
|
+
}
|
683
|
+
return /* @__PURE__ */ React10.createElement(
|
684
|
+
Tooltip,
|
685
|
+
{
|
686
|
+
key: "whiteboard",
|
687
|
+
title: peerSharing ? "Cannot open whiteboard when viewing a shared screen" : `${open ? "Close" : "Open"} Whiteboard`
|
688
|
+
},
|
689
|
+
/* @__PURE__ */ React10.createElement(
|
690
|
+
IconButton_default,
|
691
|
+
{
|
692
|
+
onClick: () => __async(void 0, null, function* () {
|
693
|
+
if (disabled) {
|
694
|
+
return;
|
695
|
+
}
|
696
|
+
try {
|
697
|
+
yield toggle();
|
698
|
+
} catch (error) {
|
699
|
+
ToastManager.addToast({ title: error.message, variant: "error" });
|
700
|
+
}
|
701
|
+
}),
|
702
|
+
active: !open,
|
703
|
+
disabled,
|
704
|
+
"data-testid": "whiteboard_btn"
|
705
|
+
},
|
706
|
+
/* @__PURE__ */ React10.createElement(PencilDrawIcon, null)
|
707
|
+
)
|
708
|
+
);
|
709
|
+
};
|
710
|
+
|
711
|
+
// src/Prebuilt/components/Footer/Footer.tsx
|
712
|
+
var Footer2 = ({
|
713
|
+
screenType,
|
714
|
+
elements
|
715
|
+
}) => {
|
716
|
+
var _a, _b;
|
717
|
+
const isMobile = useMedia(config.media.md);
|
718
|
+
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay);
|
719
|
+
const openByDefault = ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.initial_state) === Chat_ChatState.CHAT_STATE_OPEN;
|
720
|
+
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
721
|
+
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
722
|
+
const { showPolls } = useShowPolls();
|
723
|
+
useEffect2(() => {
|
724
|
+
if (!isChatOpen && openByDefault) {
|
725
|
+
toggleChat();
|
726
|
+
}
|
727
|
+
}, [toggleChat, openByDefault]);
|
728
|
+
return /* @__PURE__ */ React11.createElement(
|
729
|
+
Footer.Root,
|
730
|
+
{
|
731
|
+
css: {
|
732
|
+
flexWrap: "nowrap",
|
733
|
+
"@md": {
|
734
|
+
justifyContent: "center",
|
735
|
+
gap: "$10",
|
736
|
+
position: "relative",
|
737
|
+
// To prevent it from showing over the sidepane if chat type is not overlay
|
738
|
+
zIndex: isOverlayChat && isChatOpen ? 20 : 1
|
739
|
+
}
|
740
|
+
}
|
741
|
+
},
|
742
|
+
/* @__PURE__ */ React11.createElement(
|
743
|
+
Footer.Left,
|
744
|
+
{
|
745
|
+
css: {
|
746
|
+
"@md": {
|
747
|
+
w: "unset",
|
748
|
+
p: "0",
|
749
|
+
gap: "$10"
|
750
|
+
}
|
751
|
+
}
|
752
|
+
},
|
753
|
+
isMobile ? /* @__PURE__ */ React11.createElement(LeaveRoom, { screenType }) : null,
|
754
|
+
/* @__PURE__ */ React11.createElement(AudioVideoToggle, null),
|
755
|
+
!isMobile && elements.virtual_background ? /* @__PURE__ */ React11.createElement(VBToggle, null) : null
|
756
|
+
),
|
757
|
+
/* @__PURE__ */ React11.createElement(
|
758
|
+
Footer.Center,
|
759
|
+
{
|
760
|
+
css: {
|
761
|
+
"@md": {
|
762
|
+
w: "unset",
|
763
|
+
gap: "$10"
|
764
|
+
}
|
765
|
+
}
|
766
|
+
},
|
767
|
+
isMobile ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(ScreenshareToggle, null), /* @__PURE__ */ React11.createElement(RaiseHand, null), (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React11.createElement(ChatToggle, null), /* @__PURE__ */ React11.createElement(MoreSettings, { elements, screenType })) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(ScreenshareToggle, null), /* @__PURE__ */ React11.createElement(RaiseHand, null), screenType !== "hls_live_streaming" && /* @__PURE__ */ React11.createElement(CaptionIcon, null), (elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React11.createElement(EmojiReaction, null), /* @__PURE__ */ React11.createElement(LeaveRoom, { screenType }))
|
768
|
+
),
|
769
|
+
/* @__PURE__ */ React11.createElement(Footer.Right, null, /* @__PURE__ */ React11.createElement(WhiteboardToggle, null), showPolls && /* @__PURE__ */ React11.createElement(PollsToggle, null), !isMobile && (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React11.createElement(ChatToggle, null), (elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React11.createElement(ParticipantCount, null), /* @__PURE__ */ React11.createElement(MoreSettings, { elements, screenType }))
|
770
|
+
);
|
771
|
+
};
|
772
|
+
|
773
|
+
// src/Prebuilt/components/Notifications/HLSFailureModal.tsx
|
774
|
+
init_define_process_env();
|
775
|
+
import React12, { useCallback, useState as useState3 } from "react";
|
776
|
+
import { selectHLSState, useHMSActions, useHMSStore as useHMSStore4, useRecordingStreaming } from "@100mslive/react-sdk";
|
777
|
+
function HLSFailureModal() {
|
778
|
+
const hlsError = useHMSStore4(selectHLSState).error || false;
|
779
|
+
const [openModal, setOpenModal] = useState3(!!hlsError);
|
780
|
+
const hmsActions = useHMSActions();
|
781
|
+
const { isRTMPRunning } = useRecordingStreaming();
|
782
|
+
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
783
|
+
const startHLS = useCallback(() => __async(this, null, function* () {
|
784
|
+
try {
|
785
|
+
if (isHLSStarted || isRTMPRunning) {
|
786
|
+
return;
|
787
|
+
}
|
788
|
+
setHLSStarted(true);
|
789
|
+
yield hmsActions.startHLSStreaming({});
|
790
|
+
} catch (error) {
|
791
|
+
console.error(error);
|
792
|
+
setHLSStarted(false);
|
793
|
+
}
|
794
|
+
}), [hmsActions, isHLSStarted, setHLSStarted, isRTMPRunning]);
|
795
|
+
return hlsError ? /* @__PURE__ */ React12.createElement(
|
796
|
+
Dialog.Root,
|
797
|
+
{
|
798
|
+
open: openModal,
|
799
|
+
onOpenChange: (value) => {
|
800
|
+
if (!value) {
|
801
|
+
setOpenModal(false);
|
802
|
+
}
|
803
|
+
}
|
804
|
+
},
|
805
|
+
/* @__PURE__ */ React12.createElement(Dialog.Portal, null, /* @__PURE__ */ React12.createElement(Dialog.Overlay, null), /* @__PURE__ */ React12.createElement(Dialog.Content, { css: { w: "min(360px, 90%)" } }, /* @__PURE__ */ React12.createElement(
|
806
|
+
Dialog.Title,
|
807
|
+
{
|
808
|
+
css: {
|
809
|
+
display: "flex",
|
810
|
+
alignItems: "center",
|
811
|
+
justifyContent: "space-between",
|
812
|
+
borderBottom: "1px solid $border_default",
|
813
|
+
mt: "$4"
|
814
|
+
}
|
815
|
+
},
|
816
|
+
/* @__PURE__ */ React12.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, "Failed to Go Live")
|
817
|
+
), /* @__PURE__ */ React12.createElement(Text, { variant: "sm", css: { mb: "$10", color: "$on_surface_medium" } }, "Something went wrong and your live broadcast failed. Please try again."), /* @__PURE__ */ React12.createElement(Flex, { align: "center", justify: "between", css: { w: "100%", gap: "$8" } }, /* @__PURE__ */ React12.createElement(Button, { outlined: true, variant: "standard", css: { w: "100%" }, onClick: () => setOpenModal(false) }, "Dismiss"), /* @__PURE__ */ React12.createElement(Button, { css: { w: "100%" }, onClick: startHLS }, "Go Live"))))
|
818
|
+
) : null;
|
819
|
+
}
|
820
|
+
|
821
|
+
// src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
|
822
|
+
init_define_process_env();
|
823
|
+
import React14, { useEffect as useEffect3 } from "react";
|
824
|
+
import {
|
825
|
+
selectIsInPreview,
|
826
|
+
selectLocalPeerName,
|
827
|
+
selectLocalPeerRoleName,
|
828
|
+
selectRoleChangeRequest,
|
829
|
+
useCustomEvent,
|
830
|
+
useHMSActions as useHMSActions2,
|
831
|
+
useHMSStore as useHMSStore5
|
832
|
+
} from "@100mslive/react-sdk";
|
833
|
+
|
834
|
+
// src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx
|
835
|
+
init_define_process_env();
|
836
|
+
import React13 from "react";
|
837
|
+
import { useMedia as useMedia2 } from "react-use";
|
838
|
+
var RequestPrompt = ({
|
839
|
+
open = true,
|
840
|
+
onOpenChange,
|
841
|
+
title,
|
842
|
+
body,
|
843
|
+
actionText = "Accept",
|
844
|
+
onAction,
|
845
|
+
disableActions = false
|
846
|
+
}) => {
|
847
|
+
const isMobile = useMedia2(config.media.md);
|
848
|
+
if (isMobile) {
|
849
|
+
return /* @__PURE__ */ React13.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React13.createElement(Sheet.Content, { css: { py: "$8" } }, /* @__PURE__ */ React13.createElement(Text, { css: { fontWeight: "$semiBold", c: "$on_surface_high", "@md": { px: "$8" } } }, title), body, /* @__PURE__ */ React13.createElement(RequestActions, { actionText, onAction, disabled: disableActions })));
|
850
|
+
}
|
851
|
+
return /* @__PURE__ */ React13.createElement(Dialog.Root, { open, modal: false, onOpenChange }, /* @__PURE__ */ React13.createElement(Dialog.Portal, null, /* @__PURE__ */ React13.createElement(Dialog.Content, { css: { p: "$10" }, onInteractOutside: (e) => e.preventDefault() }, /* @__PURE__ */ React13.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md", justifyContent: "center" } }, /* @__PURE__ */ React13.createElement(Text, { variant: "h6" }, title)), /* @__PURE__ */ React13.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React13.createElement(RequestActions, { actionText, onAction, disabled: disableActions }))));
|
852
|
+
};
|
853
|
+
var RequestActions = ({
|
854
|
+
onAction,
|
855
|
+
actionText,
|
856
|
+
disabled = false
|
857
|
+
}) => /* @__PURE__ */ React13.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md", "@md": { mt: "$8", px: "$8" } } }, /* @__PURE__ */ React13.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React13.createElement(Dialog.Close, { css: { width: "100%", height: "100%" }, asChild: true }, /* @__PURE__ */ React13.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%", p: "$4 $8" }, disabled }, "Decline"))), /* @__PURE__ */ React13.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React13.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction, disabled }, actionText)));
|
858
|
+
|
859
|
+
// src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
|
860
|
+
var RoleChangeRequestModal = () => {
|
861
|
+
const hmsActions = useHMSActions2();
|
862
|
+
const { updateMetaData } = useMyMetadata();
|
863
|
+
const isPreview = useHMSStore5(selectIsInPreview);
|
864
|
+
const currentRole = useHMSStore5(selectLocalPeerRoleName);
|
865
|
+
const roleChangeRequest = useHMSStore5(selectRoleChangeRequest);
|
866
|
+
const name = useHMSStore5(selectLocalPeerName);
|
867
|
+
const { sendEvent } = useCustomEvent({ type: ROLE_CHANGE_DECLINED });
|
868
|
+
const { elements = {} } = useRoomLayoutPreviewScreen();
|
869
|
+
const { virtual_background } = elements || {};
|
870
|
+
useEffect3(() => {
|
871
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
872
|
+
return;
|
873
|
+
}
|
874
|
+
(() => __async(void 0, null, function* () {
|
875
|
+
yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
876
|
+
}))();
|
877
|
+
}, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
|
878
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
879
|
+
return null;
|
880
|
+
}
|
881
|
+
const body = /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
|
882
|
+
Text,
|
883
|
+
{
|
884
|
+
variant: "xs",
|
885
|
+
css: {
|
886
|
+
c: "$on_surface_medium",
|
887
|
+
textAlign: "center",
|
888
|
+
"@md": { textAlign: "left", borderBottom: "1px solid $border_bright", pb: "$4", px: "$8" }
|
889
|
+
}
|
890
|
+
},
|
891
|
+
"Setup your audio and video before joining"
|
892
|
+
), /* @__PURE__ */ React14.createElement(
|
893
|
+
Flex,
|
894
|
+
{
|
895
|
+
align: "center",
|
896
|
+
justify: "center",
|
897
|
+
css: {
|
898
|
+
"@sm": { width: "100%" },
|
899
|
+
flexDirection: "column",
|
900
|
+
mt: "$6",
|
901
|
+
"@md": { px: "$8" }
|
902
|
+
}
|
903
|
+
},
|
904
|
+
/* @__PURE__ */ React14.createElement(PreviewTile, { name: name || "" }),
|
905
|
+
/* @__PURE__ */ React14.createElement(PreviewControls, { hideSettings: true, vbEnabled: !!virtual_background })
|
906
|
+
));
|
907
|
+
return /* @__PURE__ */ React14.createElement(
|
908
|
+
RequestPrompt,
|
909
|
+
{
|
910
|
+
title: "You're invited to join the stage",
|
911
|
+
onOpenChange: (value) => __async(void 0, null, function* () {
|
912
|
+
var _a;
|
913
|
+
if (!value) {
|
914
|
+
hmsActions.rejectChangeRole(roleChangeRequest);
|
915
|
+
sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
|
916
|
+
yield hmsActions.cancelMidCallPreview();
|
917
|
+
yield hmsActions.lowerLocalPeerHand();
|
918
|
+
}
|
919
|
+
}),
|
920
|
+
body,
|
921
|
+
onAction: () => __async(void 0, null, function* () {
|
922
|
+
yield hmsActions.acceptChangeRole(roleChangeRequest);
|
923
|
+
yield updateMetaData({ prevRole: currentRole });
|
924
|
+
yield hmsActions.lowerLocalPeerHand();
|
925
|
+
}),
|
926
|
+
actionText: "Accept",
|
927
|
+
disableActions: !isPreview
|
928
|
+
}
|
929
|
+
);
|
930
|
+
};
|
931
|
+
|
932
|
+
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
933
|
+
init_define_process_env();
|
934
|
+
import React18, { Suspense as Suspense2, useEffect as useEffect8, useState as useState7 } from "react";
|
935
|
+
import { useMedia as useMedia5 } from "react-use";
|
936
|
+
import { match } from "ts-pattern";
|
937
|
+
import {
|
938
|
+
selectIsConnectedToRoom,
|
939
|
+
selectIsLocalScreenShared,
|
940
|
+
selectLocalPeerRoleName as selectLocalPeerRoleName3,
|
941
|
+
useHMSActions as useHMSActions3,
|
942
|
+
useHMSStore as useHMSStore9
|
943
|
+
} from "@100mslive/react-sdk";
|
944
|
+
import { PeopleAddIcon as PeopleAddIcon2, ShareScreenIcon as ShareScreenIcon2 } from "@100mslive/react-icons";
|
945
|
+
|
946
|
+
// src/Prebuilt/components/VideoLayouts/GridLayout.tsx
|
947
|
+
init_define_process_env();
|
948
|
+
import React16, { Suspense, useEffect as useEffect5, useMemo, useState as useState5 } from "react";
|
949
|
+
import {
|
950
|
+
selectLocalPeerID,
|
951
|
+
selectLocalPeerRoleName as selectLocalPeerRoleName2,
|
952
|
+
selectPeers,
|
953
|
+
selectPeerScreenSharing as selectPeerScreenSharing2,
|
954
|
+
selectWhiteboard,
|
955
|
+
useHMSStore as useHMSStore6,
|
956
|
+
useHMSVanillaStore
|
957
|
+
} from "@100mslive/react-sdk";
|
958
|
+
|
959
|
+
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
960
|
+
init_define_process_env();
|
961
|
+
import React15, { useEffect as useEffect4, useState as useState4 } from "react";
|
962
|
+
import { useMedia as useMedia3 } from "react-use";
|
963
|
+
import { PeopleAddIcon } from "@100mslive/react-icons";
|
964
|
+
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }) {
|
965
|
+
var _a;
|
966
|
+
const isMobile = useMedia3(config.media.md);
|
967
|
+
let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
|
968
|
+
maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
|
969
|
+
const pageList = usePagesWithTiles({
|
970
|
+
peers,
|
971
|
+
maxTileCount
|
972
|
+
});
|
973
|
+
const { ref, pagesWithTiles } = useTileLayout({
|
974
|
+
pageList,
|
975
|
+
maxTileCount,
|
976
|
+
edgeToEdge
|
977
|
+
});
|
978
|
+
const [page, setPage] = useState4(0);
|
979
|
+
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
980
|
+
useEffect4(() => {
|
981
|
+
if (pageSize > 0) {
|
982
|
+
onPageSize == null ? void 0 : onPageSize(pageSize);
|
983
|
+
}
|
984
|
+
}, [pageSize, onPageSize]);
|
985
|
+
return /* @__PURE__ */ React15.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React15.createElement(Grid, { tiles: pagesWithTiles[page], ref, edgeToEdge }), !edgeToEdge && /* @__PURE__ */ React15.createElement(
|
986
|
+
Pagination,
|
987
|
+
{
|
988
|
+
page,
|
989
|
+
onPageChange: (page2) => {
|
990
|
+
setPage(page2);
|
991
|
+
onPageChange == null ? void 0 : onPageChange(page2);
|
992
|
+
},
|
993
|
+
numPages: pagesWithTiles.length
|
994
|
+
}
|
995
|
+
), pageList.length === 0 ? /* @__PURE__ */ React15.createElement(
|
996
|
+
WaitingView,
|
997
|
+
{
|
998
|
+
title: "You're the only one here",
|
999
|
+
subtitle: "Sit back and relax till others join",
|
1000
|
+
icon: /* @__PURE__ */ React15.createElement(PeopleAddIcon, { width: "56px", height: "56px", style: { color: "white" } })
|
1001
|
+
}
|
1002
|
+
) : null, isInsetEnabled && /* @__PURE__ */ React15.createElement(InsetTile, null));
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
// src/Prebuilt/common/PeersSorter.ts
|
1006
|
+
init_define_process_env();
|
1007
|
+
import { selectDominantSpeaker } from "@100mslive/react-sdk";
|
1008
|
+
var PeersSorter = class {
|
1009
|
+
constructor(store) {
|
1010
|
+
this.storeUnsubscribe = void 0;
|
1011
|
+
this.setPeersAndTilesPerPage = ({ peers, tilesPerPage }) => {
|
1012
|
+
this.speaker = void 0;
|
1013
|
+
this.tilesPerPage = tilesPerPage;
|
1014
|
+
const peerIds = new Set(peers.map((peer) => peer.id));
|
1015
|
+
this.peers.forEach((_, key) => {
|
1016
|
+
if (!peerIds.has(key)) {
|
1017
|
+
this.peers.delete(key);
|
1018
|
+
}
|
1019
|
+
});
|
1020
|
+
this.lruPeers = new Set([...this.lruPeers].filter((peerId) => peerIds.has(peerId)));
|
1021
|
+
peers.forEach((peer) => {
|
1022
|
+
this.peers.set(peer.id, peer);
|
1023
|
+
if (this.lruPeers.size < tilesPerPage) {
|
1024
|
+
this.lruPeers.add(peer.id);
|
1025
|
+
}
|
1026
|
+
});
|
1027
|
+
if (!this.storeUnsubscribe) {
|
1028
|
+
this.storeUnsubscribe = this.store.subscribe(this.onDominantSpeakerChange, selectDominantSpeaker);
|
1029
|
+
}
|
1030
|
+
this.moveSpeakerToFront(this.speaker);
|
1031
|
+
};
|
1032
|
+
this.onUpdate = (cb) => {
|
1033
|
+
this.listeners.add(cb);
|
1034
|
+
};
|
1035
|
+
this.stop = () => {
|
1036
|
+
var _a;
|
1037
|
+
this.updateListeners();
|
1038
|
+
this.listeners.clear();
|
1039
|
+
(_a = this.storeUnsubscribe) == null ? void 0 : _a.call(this);
|
1040
|
+
this.storeUnsubscribe = void 0;
|
1041
|
+
this.speaker = void 0;
|
1042
|
+
};
|
1043
|
+
this.moveSpeakerToFront = (speaker) => {
|
1044
|
+
if (!speaker) {
|
1045
|
+
this.maintainLruSize(this.tilesPerPage);
|
1046
|
+
this.updateListeners();
|
1047
|
+
return;
|
1048
|
+
}
|
1049
|
+
if (this.lruPeers.has(speaker.id) && this.lruPeers.size <= this.tilesPerPage) {
|
1050
|
+
this.updateListeners();
|
1051
|
+
return;
|
1052
|
+
}
|
1053
|
+
this.lruPeers.delete(speaker.id);
|
1054
|
+
this.maintainLruSize(this.tilesPerPage - 1);
|
1055
|
+
this.lruPeers = /* @__PURE__ */ new Set([speaker.id, ...this.lruPeers]);
|
1056
|
+
this.updateListeners();
|
1057
|
+
};
|
1058
|
+
this.onDominantSpeakerChange = (speaker) => {
|
1059
|
+
var _a;
|
1060
|
+
if (!speaker || speaker.id === ((_a = this.speaker) == null ? void 0 : _a.id)) {
|
1061
|
+
return;
|
1062
|
+
}
|
1063
|
+
if (!this.peers.has(speaker.id)) {
|
1064
|
+
return;
|
1065
|
+
}
|
1066
|
+
this.speaker = speaker;
|
1067
|
+
this.moveSpeakerToFront(speaker);
|
1068
|
+
};
|
1069
|
+
this.updateListeners = () => {
|
1070
|
+
const orderedPeers = [];
|
1071
|
+
this.lruPeers.forEach((key) => {
|
1072
|
+
const peer = this.peers.get(key);
|
1073
|
+
if (peer) {
|
1074
|
+
orderedPeers.push(peer);
|
1075
|
+
}
|
1076
|
+
});
|
1077
|
+
this.peers.forEach((peer) => {
|
1078
|
+
if (!this.lruPeers.has(peer.id) && peer) {
|
1079
|
+
orderedPeers.push(peer);
|
1080
|
+
}
|
1081
|
+
});
|
1082
|
+
this.listeners.forEach((listener) => listener == null ? void 0 : listener(orderedPeers));
|
1083
|
+
};
|
1084
|
+
this.maintainLruSize = (size) => {
|
1085
|
+
const lruPeerArray = Array.from(this.lruPeers);
|
1086
|
+
while (lruPeerArray.length > size && lruPeerArray.length) {
|
1087
|
+
lruPeerArray.pop();
|
1088
|
+
}
|
1089
|
+
this.lruPeers = new Set(lruPeerArray);
|
1090
|
+
};
|
1091
|
+
this.store = store;
|
1092
|
+
this.peers = /* @__PURE__ */ new Map();
|
1093
|
+
this.lruPeers = /* @__PURE__ */ new Set();
|
1094
|
+
this.speaker = void 0;
|
1095
|
+
this.listeners = /* @__PURE__ */ new Set();
|
1096
|
+
}
|
1097
|
+
};
|
1098
|
+
var PeersSorter_default = PeersSorter;
|
1099
|
+
|
1100
|
+
// src/Prebuilt/components/VideoLayouts/GridLayout.tsx
|
1101
|
+
var RoleProminence = React16.lazy(
|
1102
|
+
() => import("./RoleProminence-PB32DLIB.js").then((module) => ({ default: module.RoleProminence }))
|
1103
|
+
);
|
1104
|
+
var ScreenshareLayout = React16.lazy(
|
1105
|
+
() => import("./ScreenshareLayout-XVENPVK3.js").then((module) => ({ default: module.ScreenshareLayout }))
|
1106
|
+
);
|
1107
|
+
var WhiteboardLayout = React16.lazy(
|
1108
|
+
() => import("./WhiteboardLayout-FZC7SOSG.js").then((module) => ({ default: module.WhiteboardLayout }))
|
1109
|
+
);
|
1110
|
+
var GridLayout = ({
|
1111
|
+
enable_local_tile_inset: isInsetEnabled = false,
|
1112
|
+
prominent_roles: prominentRoles = [],
|
1113
|
+
enable_spotlighting_peer = false,
|
1114
|
+
hide_participant_name_on_tile = false,
|
1115
|
+
rounded_video_tile = true,
|
1116
|
+
hide_audio_mute_on_tile = false,
|
1117
|
+
video_object_fit = "contain",
|
1118
|
+
edge_to_edge = false,
|
1119
|
+
hide_metadata_on_tile = false
|
1120
|
+
}) => {
|
1121
|
+
const peerSharing = useHMSStore6(selectPeerScreenSharing2);
|
1122
|
+
const whiteboard = useHMSStore6(selectWhiteboard);
|
1123
|
+
const pinnedTrack = usePinnedTrack();
|
1124
|
+
const peers = useHMSStore6(selectPeers);
|
1125
|
+
const localPeerRole = useHMSStore6(selectLocalPeerRoleName2);
|
1126
|
+
const localPeerID = useHMSStore6(selectLocalPeerID);
|
1127
|
+
const [activeScreensharePeerId] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
1128
|
+
const isRoleProminence = prominentRoles.length && peers.some(
|
1129
|
+
(peer) => peer.roleName && prominentRoles.includes(peer.roleName) && (peer.videoTrack || peer.audioTrack)
|
1130
|
+
) || pinnedTrack;
|
1131
|
+
const updatedPeers = useMemo(() => {
|
1132
|
+
if (activeScreensharePeerId || (whiteboard == null ? void 0 : whiteboard.open)) {
|
1133
|
+
return peers.filter((peer) => peer.id !== activeScreensharePeerId || peer.customerUserId !== (whiteboard == null ? void 0 : whiteboard.owner));
|
1134
|
+
}
|
1135
|
+
if (isInsetEnabled) {
|
1136
|
+
const isLocalPeerPinned = localPeerID === (pinnedTrack == null ? void 0 : pinnedTrack.peerId);
|
1137
|
+
if (localPeerRole && prominentRoles.includes(localPeerRole) || isLocalPeerPinned) {
|
1138
|
+
return peers;
|
1139
|
+
} else {
|
1140
|
+
return peers.filter((peer) => !peer.isLocal);
|
1141
|
+
}
|
1142
|
+
}
|
1143
|
+
return peers;
|
1144
|
+
}, [
|
1145
|
+
isInsetEnabled,
|
1146
|
+
whiteboard,
|
1147
|
+
activeScreensharePeerId,
|
1148
|
+
localPeerRole,
|
1149
|
+
localPeerID,
|
1150
|
+
prominentRoles,
|
1151
|
+
peers,
|
1152
|
+
pinnedTrack
|
1153
|
+
]);
|
1154
|
+
const vanillaStore = useHMSVanillaStore();
|
1155
|
+
const [sortedPeers, setSortedPeers] = useState5(updatedPeers);
|
1156
|
+
const peersSorter = useMemo(() => new PeersSorter_default(vanillaStore), [vanillaStore]);
|
1157
|
+
const [pageSize, setPageSize] = useState5(0);
|
1158
|
+
const [mainPage, setMainPage] = useState5(0);
|
1159
|
+
const tileLayout = {
|
1160
|
+
enableSpotlightingPeer: enable_spotlighting_peer,
|
1161
|
+
hideParticipantNameOnTile: hide_participant_name_on_tile,
|
1162
|
+
roundedVideoTile: rounded_video_tile,
|
1163
|
+
hideAudioMuteOnTile: hide_audio_mute_on_tile,
|
1164
|
+
hideMetadataOnTile: hide_metadata_on_tile,
|
1165
|
+
objectFit: video_object_fit
|
1166
|
+
};
|
1167
|
+
useEffect5(() => {
|
1168
|
+
if (mainPage !== 0) {
|
1169
|
+
return;
|
1170
|
+
}
|
1171
|
+
peersSorter.setPeersAndTilesPerPage({
|
1172
|
+
peers: updatedPeers,
|
1173
|
+
tilesPerPage: pageSize
|
1174
|
+
});
|
1175
|
+
peersSorter.onUpdate(setSortedPeers);
|
1176
|
+
}, [mainPage, peersSorter, updatedPeers, pageSize]);
|
1177
|
+
if (peerSharing) {
|
1178
|
+
return /* @__PURE__ */ React16.createElement(Suspense, { fallback: /* @__PURE__ */ React16.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
|
1179
|
+
ScreenshareLayout,
|
1180
|
+
{
|
1181
|
+
peers: sortedPeers,
|
1182
|
+
onPageSize: setPageSize,
|
1183
|
+
onPageChange: setMainPage,
|
1184
|
+
edgeToEdge: edge_to_edge
|
1185
|
+
}
|
1186
|
+
)));
|
1187
|
+
} else if (whiteboard == null ? void 0 : whiteboard.open) {
|
1188
|
+
return /* @__PURE__ */ React16.createElement(Suspense, { fallback: /* @__PURE__ */ React16.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
|
1189
|
+
WhiteboardLayout,
|
1190
|
+
{
|
1191
|
+
peers: sortedPeers,
|
1192
|
+
onPageSize: setPageSize,
|
1193
|
+
onPageChange: setMainPage,
|
1194
|
+
edgeToEdge: edge_to_edge
|
1195
|
+
}
|
1196
|
+
)));
|
1197
|
+
} else if (isRoleProminence) {
|
1198
|
+
return /* @__PURE__ */ React16.createElement(Suspense, { fallback: /* @__PURE__ */ React16.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
|
1199
|
+
RoleProminence,
|
1200
|
+
{
|
1201
|
+
peers: sortedPeers,
|
1202
|
+
onPageSize: setPageSize,
|
1203
|
+
onPageChange: setMainPage,
|
1204
|
+
prominentRoles,
|
1205
|
+
isInsetEnabled,
|
1206
|
+
edgeToEdge: edge_to_edge
|
1207
|
+
}
|
1208
|
+
)));
|
1209
|
+
}
|
1210
|
+
return /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
|
1211
|
+
EqualProminence,
|
1212
|
+
{
|
1213
|
+
peers: sortedPeers,
|
1214
|
+
onPageSize: setPageSize,
|
1215
|
+
onPageChange: setMainPage,
|
1216
|
+
isInsetEnabled,
|
1217
|
+
edgeToEdge: edge_to_edge
|
1218
|
+
}
|
1219
|
+
));
|
1220
|
+
};
|
1221
|
+
|
1222
|
+
// src/Prebuilt/plugins/CaptionsViewer.tsx
|
1223
|
+
init_define_process_env();
|
1224
|
+
import React17, { useEffect as useEffect6, useRef, useState as useState6 } from "react";
|
1225
|
+
import Draggable from "react-draggable";
|
1226
|
+
import { useMedia as useMedia4 } from "react-use";
|
1227
|
+
import {
|
1228
|
+
selectIsTranscriptionEnabled as selectIsTranscriptionEnabled2,
|
1229
|
+
selectPeerNameByID,
|
1230
|
+
useHMSStore as useHMSStore7,
|
1231
|
+
useTranscript
|
1232
|
+
} from "@100mslive/react-sdk";
|
1233
|
+
var SimpleQueue = class {
|
1234
|
+
constructor(capacity = 3, MAX_STORAGE_TIME = 5e3) {
|
1235
|
+
this.capacity = capacity;
|
1236
|
+
this.MAX_STORAGE_TIME = MAX_STORAGE_TIME;
|
1237
|
+
this.storage = [];
|
1238
|
+
}
|
1239
|
+
enqueue(data) {
|
1240
|
+
var _a;
|
1241
|
+
if (!data.transcript.trim()) {
|
1242
|
+
return;
|
1243
|
+
}
|
1244
|
+
if (this.size() === this.capacity && this.storage[this.size() - 1].final) {
|
1245
|
+
this.dequeue(this.storage[this.size() - 1]);
|
1246
|
+
}
|
1247
|
+
if (this.size() === 0) {
|
1248
|
+
this.storage.push(data);
|
1249
|
+
this.addTimeout(this.storage[this.size() - 1], data.final);
|
1250
|
+
return;
|
1251
|
+
}
|
1252
|
+
if (this.size() > 0 && ((_a = this.storage[this.size() - 1]) == null ? void 0 : _a.final) === true) {
|
1253
|
+
this.storage.push(data);
|
1254
|
+
this.addTimeout(this.storage[this.size() - 1], data.final);
|
1255
|
+
return;
|
1256
|
+
}
|
1257
|
+
this.storage[this.size() - 1].transcript = data.transcript;
|
1258
|
+
this.storage[this.size() - 1].final = data.final;
|
1259
|
+
this.storage[this.size() - 1].end = data.end;
|
1260
|
+
this.addTimeout(this.storage[this.size() - 1], data.final);
|
1261
|
+
}
|
1262
|
+
addTimeout(item, isFinal) {
|
1263
|
+
if (!isFinal) {
|
1264
|
+
return;
|
1265
|
+
}
|
1266
|
+
item.timeout = setTimeout(() => {
|
1267
|
+
this.dequeue(item);
|
1268
|
+
}, this.MAX_STORAGE_TIME);
|
1269
|
+
}
|
1270
|
+
dequeue(item) {
|
1271
|
+
const index = this.storage.indexOf(item);
|
1272
|
+
if (index === -1) {
|
1273
|
+
return void 0;
|
1274
|
+
}
|
1275
|
+
const removedItem = this.storage.splice(index, 1);
|
1276
|
+
if (removedItem.length <= 0) {
|
1277
|
+
return void 0;
|
1278
|
+
}
|
1279
|
+
this.clearTimeout(removedItem[0]);
|
1280
|
+
return item;
|
1281
|
+
}
|
1282
|
+
clearTimeout(item) {
|
1283
|
+
if (!item.timeout) {
|
1284
|
+
return;
|
1285
|
+
}
|
1286
|
+
clearTimeout(item.timeout);
|
1287
|
+
}
|
1288
|
+
peek() {
|
1289
|
+
if (this.size() <= 0) {
|
1290
|
+
return void 0;
|
1291
|
+
}
|
1292
|
+
return this.storage[0];
|
1293
|
+
}
|
1294
|
+
getTranscription() {
|
1295
|
+
let script = "";
|
1296
|
+
this.storage.forEach((value) => script += value.transcript + " ");
|
1297
|
+
return script;
|
1298
|
+
}
|
1299
|
+
reset() {
|
1300
|
+
this.storage.length = 0;
|
1301
|
+
}
|
1302
|
+
size() {
|
1303
|
+
return this.storage.length;
|
1304
|
+
}
|
1305
|
+
};
|
1306
|
+
var Queue = class {
|
1307
|
+
constructor(capacity = 3) {
|
1308
|
+
this.capacity = capacity;
|
1309
|
+
this.storage = {};
|
1310
|
+
}
|
1311
|
+
enqueue(data) {
|
1312
|
+
if (this.size() === this.capacity) {
|
1313
|
+
this.dequeue();
|
1314
|
+
}
|
1315
|
+
if (!this.storage[data.peer_id]) {
|
1316
|
+
this.storage[data.peer_id] = {
|
1317
|
+
peer_id: data.peer_id,
|
1318
|
+
transcript: data.transcript,
|
1319
|
+
final: data.final,
|
1320
|
+
transcriptQueue: new SimpleQueue(),
|
1321
|
+
start: data.start,
|
1322
|
+
end: data.end
|
1323
|
+
};
|
1324
|
+
this.storage[data.peer_id].transcriptQueue.enqueue(data);
|
1325
|
+
return;
|
1326
|
+
}
|
1327
|
+
this.storage[data.peer_id].transcriptQueue.enqueue(data);
|
1328
|
+
}
|
1329
|
+
dequeue() {
|
1330
|
+
const key = Object.keys(this.storage).shift() || "";
|
1331
|
+
const captionData = this.storage[key];
|
1332
|
+
captionData.transcriptQueue.reset();
|
1333
|
+
delete this.storage[key];
|
1334
|
+
return captionData;
|
1335
|
+
}
|
1336
|
+
peek() {
|
1337
|
+
if (this.size() <= 0)
|
1338
|
+
return void 0;
|
1339
|
+
const key = Object.keys(this.storage).shift() || "";
|
1340
|
+
return this.storage[key];
|
1341
|
+
}
|
1342
|
+
findPeerData() {
|
1343
|
+
const keys = Object.keys(this.storage);
|
1344
|
+
const data = keys.map((key) => {
|
1345
|
+
const data2 = this.storage[key];
|
1346
|
+
const word = data2.transcriptQueue.getTranscription();
|
1347
|
+
return { [key]: word };
|
1348
|
+
});
|
1349
|
+
return data;
|
1350
|
+
}
|
1351
|
+
size() {
|
1352
|
+
return Object.keys(this.storage).length;
|
1353
|
+
}
|
1354
|
+
};
|
1355
|
+
var CaptionMaintainerQueue = class {
|
1356
|
+
constructor() {
|
1357
|
+
this.captionData = new Queue();
|
1358
|
+
}
|
1359
|
+
push(data = []) {
|
1360
|
+
data.forEach((value) => {
|
1361
|
+
this.captionData.enqueue(value);
|
1362
|
+
});
|
1363
|
+
}
|
1364
|
+
};
|
1365
|
+
var TranscriptView = ({ peer_id, data }) => {
|
1366
|
+
const peerName = useHMSStore7(selectPeerNameByID(peer_id)) || "Participant";
|
1367
|
+
data = data.trim();
|
1368
|
+
if (!data)
|
1369
|
+
return null;
|
1370
|
+
return /* @__PURE__ */ React17.createElement(
|
1371
|
+
Text,
|
1372
|
+
{
|
1373
|
+
variant: "body2",
|
1374
|
+
css: {
|
1375
|
+
fontWeight: "$normal"
|
1376
|
+
}
|
1377
|
+
},
|
1378
|
+
/* @__PURE__ */ React17.createElement("b", null, peerName, ": "),
|
1379
|
+
data
|
1380
|
+
);
|
1381
|
+
};
|
1382
|
+
var CaptionsViewer = ({
|
1383
|
+
defaultPosition,
|
1384
|
+
setDefaultPosition
|
1385
|
+
}) => {
|
1386
|
+
var _a;
|
1387
|
+
const { elements, screenType } = useRoomLayoutConferencingScreen();
|
1388
|
+
const isMobile = useMedia4(config.media.md);
|
1389
|
+
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
1390
|
+
const showCaptionAtTop = ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isChatOpen && isMobile;
|
1391
|
+
const [captionQueue] = useState6(new CaptionMaintainerQueue());
|
1392
|
+
const [currentData, setCurrentData] = useState6([]);
|
1393
|
+
const isCaptionEnabled = useIsCaptionEnabled();
|
1394
|
+
const isTranscriptionEnabled = useHMSStore7(selectIsTranscriptionEnabled2);
|
1395
|
+
const nodeRef = useRef(null);
|
1396
|
+
useEffect6(() => {
|
1397
|
+
const timeInterval = setInterval(() => {
|
1398
|
+
var _a2;
|
1399
|
+
if (!captionQueue) {
|
1400
|
+
return;
|
1401
|
+
}
|
1402
|
+
const data = (_a2 = captionQueue.captionData) == null ? void 0 : _a2.findPeerData();
|
1403
|
+
setCurrentData(data);
|
1404
|
+
}, 1e3);
|
1405
|
+
return () => clearInterval(timeInterval);
|
1406
|
+
}, [captionQueue]);
|
1407
|
+
useTranscript({
|
1408
|
+
onTranscript: (data) => {
|
1409
|
+
captionQueue && captionQueue.push(data);
|
1410
|
+
}
|
1411
|
+
});
|
1412
|
+
const dataToShow = currentData.filter((data) => {
|
1413
|
+
const key = Object.keys(data)[0];
|
1414
|
+
if (data[key]) {
|
1415
|
+
return true;
|
1416
|
+
}
|
1417
|
+
return false;
|
1418
|
+
});
|
1419
|
+
if (dataToShow.length <= 0 || screenType === "hls_live_streaming" || !isCaptionEnabled || !isTranscriptionEnabled) {
|
1420
|
+
return null;
|
1421
|
+
}
|
1422
|
+
return /* @__PURE__ */ React17.createElement(
|
1423
|
+
Draggable,
|
1424
|
+
{
|
1425
|
+
bounds: "parent",
|
1426
|
+
nodeRef,
|
1427
|
+
defaultPosition,
|
1428
|
+
onStop: (_, data) => {
|
1429
|
+
setDefaultPosition({ x: data.lastX, y: data.lastY });
|
1430
|
+
}
|
1431
|
+
},
|
1432
|
+
/* @__PURE__ */ React17.createElement(
|
1433
|
+
Box,
|
1434
|
+
{
|
1435
|
+
ref: nodeRef,
|
1436
|
+
css: {
|
1437
|
+
position: "absolute",
|
1438
|
+
w: isMobile ? "100%" : "40%",
|
1439
|
+
bottom: showCaptionAtTop ? "" : "0",
|
1440
|
+
top: showCaptionAtTop ? "0" : "",
|
1441
|
+
left: isMobile ? 0 : "50%",
|
1442
|
+
transform: isMobile ? "" : "translateX(-50%)",
|
1443
|
+
background: "#000000A3",
|
1444
|
+
overflow: "clip",
|
1445
|
+
zIndex: 10,
|
1446
|
+
height: "fit-content",
|
1447
|
+
r: "$1",
|
1448
|
+
p: "$6",
|
1449
|
+
transition: "bottom 0.3s ease-in-out",
|
1450
|
+
"&:empty": { display: "none" }
|
1451
|
+
}
|
1452
|
+
},
|
1453
|
+
/* @__PURE__ */ React17.createElement(Flex, { direction: "column" }, dataToShow.map((data, index) => {
|
1454
|
+
const key = Object.keys(data)[0];
|
1455
|
+
return /* @__PURE__ */ React17.createElement(TranscriptView, { key: index, peer_id: key, data: data[key] });
|
1456
|
+
}))
|
1457
|
+
)
|
1458
|
+
);
|
1459
|
+
};
|
1460
|
+
|
1461
|
+
// src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx
|
1462
|
+
init_define_process_env();
|
1463
|
+
import { useEffect as useEffect7 } from "react";
|
1464
|
+
import { selectPeerScreenSharing as selectPeerScreenSharing3, useHMSStore as useHMSStore8, useWhiteboard as useWhiteboard2 } from "@100mslive/react-sdk";
|
1465
|
+
var useCloseScreenshareWhiteboard = () => {
|
1466
|
+
const peerSharing = useHMSStore8(selectPeerScreenSharing3);
|
1467
|
+
const { isOwner: isWhiteboardOwner, toggle: toggleWhiteboard } = useWhiteboard2();
|
1468
|
+
useEffect7(() => {
|
1469
|
+
if (isWhiteboardOwner && peerSharing) {
|
1470
|
+
toggleWhiteboard == null ? void 0 : toggleWhiteboard();
|
1471
|
+
}
|
1472
|
+
}, [isWhiteboardOwner, toggleWhiteboard, peerSharing]);
|
1473
|
+
};
|
1474
|
+
|
1475
|
+
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
1476
|
+
var HLSView = React18.lazy(() => import("./HLSView-EYGGK6BH.js"));
|
1477
|
+
var EmbedView = React18.lazy(() => import("./EmbedView-N2E4DZQA.js").then((module) => ({ default: module.EmbedView })));
|
1478
|
+
var PDFView = React18.lazy(() => import("./PDFView-JOIJDP65.js").then((module) => ({ default: module.PDFView })));
|
1479
|
+
var WaitingView2 = React18.lazy(() => import("./WaitingView-77PRTIBV.js").then((module) => ({ default: module.WaitingView })));
|
1480
|
+
var VideoStreamingSection = ({
|
1481
|
+
screenType,
|
1482
|
+
elements,
|
1483
|
+
hideControls = false
|
1484
|
+
}) => {
|
1485
|
+
var _a;
|
1486
|
+
const localPeerRoleName = useHMSStore9(selectLocalPeerRoleName3);
|
1487
|
+
const isConnected = useHMSStore9(selectIsConnectedToRoom);
|
1488
|
+
const isSharingScreen = useHMSStore9(selectIsLocalScreenShared);
|
1489
|
+
const hmsActions = useHMSActions3();
|
1490
|
+
const urlToIframe = useUrlToEmbed();
|
1491
|
+
const pdfAnnotatorActive = usePDFConfig();
|
1492
|
+
const isMobileHLSStream = useMobileHLSStream();
|
1493
|
+
const isLandscapeHLSStream = useLandscapeHLSStream();
|
1494
|
+
const isMobile = useMedia5(config.media.md);
|
1495
|
+
const [captionPosition, setCaptionPosition] = useState7({ x: isMobile ? 0 : -200, y: 0 });
|
1496
|
+
useCloseScreenshareWhiteboard();
|
1497
|
+
const { isNotAllowedToPublish, isScreenOnlyPublishParams, hasSubscribedRolePublishing } = useWaitingRoomInfo();
|
1498
|
+
useEffect8(() => {
|
1499
|
+
if (!isConnected) {
|
1500
|
+
return;
|
1501
|
+
}
|
1502
|
+
hmsActions.sessionStore.observe([
|
1503
|
+
"pinnedMessages" /* PINNED_MESSAGES */,
|
1504
|
+
"spotlight" /* SPOTLIGHT */,
|
1505
|
+
"chatState" /* CHAT_STATE */,
|
1506
|
+
"chatMessageBlacklist" /* CHAT_MESSAGE_BLACKLIST */,
|
1507
|
+
"chatPeerBlacklist" /* CHAT_PEER_BLACKLIST */
|
1508
|
+
]);
|
1509
|
+
}, [isConnected, hmsActions]);
|
1510
|
+
if (!localPeerRoleName) {
|
1511
|
+
return null;
|
1512
|
+
}
|
1513
|
+
return /* @__PURE__ */ React18.createElement(
|
1514
|
+
Flex,
|
1515
|
+
{
|
1516
|
+
css: {
|
1517
|
+
size: "100%",
|
1518
|
+
position: "relative",
|
1519
|
+
gap: isMobileHLSStream || isLandscapeHLSStream ? "0" : "$4"
|
1520
|
+
},
|
1521
|
+
direction: match({ isLandscapeHLSStream, isMobileHLSStream }).with({ isLandscapeHLSStream: true }, () => "row").with({ isMobileHLSStream: true }, () => "column").otherwise(() => "row")
|
1522
|
+
},
|
1523
|
+
/* @__PURE__ */ React18.createElement(Suspense2, { fallback: /* @__PURE__ */ React18.createElement(FullPageProgress_default, null) }, match({
|
1524
|
+
screenType,
|
1525
|
+
isNotAllowedToPublish,
|
1526
|
+
isScreenOnlyPublishParams,
|
1527
|
+
hasSubscribedRolePublishing,
|
1528
|
+
isSharingScreen,
|
1529
|
+
pdfAnnotatorActive,
|
1530
|
+
urlToIframe
|
1531
|
+
}).with(
|
1532
|
+
{
|
1533
|
+
screenType: "hls_live_streaming"
|
1534
|
+
},
|
1535
|
+
() => /* @__PURE__ */ React18.createElement(HLSView, null)
|
1536
|
+
).when(
|
1537
|
+
({ isNotAllowedToPublish: isNotAllowedToPublish2, hasSubscribedRolePublishing: hasSubscribedRolePublishing2 }) => isNotAllowedToPublish2 && !hasSubscribedRolePublishing2,
|
1538
|
+
() => /* @__PURE__ */ React18.createElement(
|
1539
|
+
WaitingView2,
|
1540
|
+
{
|
1541
|
+
title: "Waiting for Host to join",
|
1542
|
+
subtitle: "Sit back and relax",
|
1543
|
+
icon: /* @__PURE__ */ React18.createElement(PeopleAddIcon2, { width: "56px", height: "56px", style: { color: "white" } })
|
1544
|
+
}
|
1545
|
+
)
|
1546
|
+
).when(
|
1547
|
+
({ isScreenOnlyPublishParams: isScreenOnlyPublishParams2, isSharingScreen: isSharingScreen2, hasSubscribedRolePublishing: hasSubscribedRolePublishing2 }) => isScreenOnlyPublishParams2 && !isSharingScreen2 && !hasSubscribedRolePublishing2,
|
1548
|
+
() => /* @__PURE__ */ React18.createElement(
|
1549
|
+
WaitingView2,
|
1550
|
+
{
|
1551
|
+
title: "Ready to present",
|
1552
|
+
subtitle: "Select the Screenshare button to start presenting",
|
1553
|
+
icon: /* @__PURE__ */ React18.createElement(ShareScreenIcon2, { width: "56px", height: "56px", style: { color: "white" } })
|
1554
|
+
}
|
1555
|
+
)
|
1556
|
+
).when(
|
1557
|
+
({ pdfAnnotatorActive: pdfAnnotatorActive2 }) => !!pdfAnnotatorActive2,
|
1558
|
+
() => /* @__PURE__ */ React18.createElement(PDFView, null)
|
1559
|
+
).when(
|
1560
|
+
({ urlToIframe: urlToIframe2 }) => !!urlToIframe2,
|
1561
|
+
() => /* @__PURE__ */ React18.createElement(EmbedView, null)
|
1562
|
+
).otherwise(() => {
|
1563
|
+
var _a2;
|
1564
|
+
return /* @__PURE__ */ React18.createElement(GridLayout, __spreadValues({}, (_a2 = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a2.grid));
|
1565
|
+
}), /* @__PURE__ */ React18.createElement(CaptionsViewer, { setDefaultPosition: setCaptionPosition, defaultPosition: captionPosition })),
|
1566
|
+
/* @__PURE__ */ React18.createElement(
|
1567
|
+
Box,
|
1568
|
+
{
|
1569
|
+
css: {
|
1570
|
+
flex: match({ isLandscapeHLSStream, isMobileHLSStream }).with({ isLandscapeHLSStream: true }, () => "1 1 0").with({ isMobileHLSStream: true }, () => "2 1 0").otherwise(() => void 0),
|
1571
|
+
position: "relative",
|
1572
|
+
height: !isMobileHLSStream ? "100%" : void 0,
|
1573
|
+
maxHeight: "100%",
|
1574
|
+
"&:empty": { display: "none" },
|
1575
|
+
overflowY: "clip"
|
1576
|
+
}
|
1577
|
+
},
|
1578
|
+
/* @__PURE__ */ React18.createElement(Suspense2, { fallback: /* @__PURE__ */ React18.createElement(React18.Fragment, null) }, /* @__PURE__ */ React18.createElement(
|
1579
|
+
SidePane_default,
|
1580
|
+
{
|
1581
|
+
screenType,
|
1582
|
+
tileProps: (_a = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a.grid,
|
1583
|
+
hideControls
|
1584
|
+
}
|
1585
|
+
))
|
1586
|
+
)
|
1587
|
+
);
|
1588
|
+
};
|
1589
|
+
|
1590
|
+
// src/Prebuilt/components/PreviousRoleInMetadata.tsx
|
1591
|
+
init_define_process_env();
|
1592
|
+
import { useEffect as useEffect9 } from "react";
|
1593
|
+
import { selectLocalPeerRoleName as selectLocalPeerRoleName4, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
1594
|
+
var PreviousRoleInMetadata = () => {
|
1595
|
+
const vanillaStore = useHMSVanillaStore2();
|
1596
|
+
const { updateMetaData } = useMyMetadata();
|
1597
|
+
useEffect9(() => {
|
1598
|
+
let previousRole = vanillaStore.getState(selectLocalPeerRoleName4);
|
1599
|
+
const unsubscribe = vanillaStore.subscribe((currentRole) => {
|
1600
|
+
if (previousRole !== currentRole && currentRole) {
|
1601
|
+
updateMetaData({ prevRole: previousRole });
|
1602
|
+
previousRole = currentRole;
|
1603
|
+
}
|
1604
|
+
}, selectLocalPeerRoleName4);
|
1605
|
+
return unsubscribe;
|
1606
|
+
}, [vanillaStore]);
|
1607
|
+
return null;
|
1608
|
+
};
|
1609
|
+
|
1610
|
+
// src/Prebuilt/components/ConferenceScreen.tsx
|
1611
|
+
var ConferenceScreen = () => {
|
1612
|
+
var _a, _b, _c, _d, _e, _f;
|
1613
|
+
const { userName, endpoints, onJoin: onJoinFunc } = useHMSPrebuiltContext();
|
1614
|
+
const screenProps = useRoomLayoutConferencingScreen();
|
1615
|
+
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
1616
|
+
const roomState = useHMSStore10(selectRoomState);
|
1617
|
+
const isConnectedToRoom = useHMSStore10(selectIsConnectedToRoom2);
|
1618
|
+
const hmsActions = useHMSActions4();
|
1619
|
+
const [hideControls, setHideControls] = useState8(false);
|
1620
|
+
const dropdownList = useHMSStore10(selectAppData(APP_DATA.dropdownList));
|
1621
|
+
const authTokenInAppData = useAuthToken();
|
1622
|
+
const headerRef = useRef2(null);
|
1623
|
+
const footerRef = useRef2(null);
|
1624
|
+
const isMobileDevice = isAndroid || isIOS || isIPadOS;
|
1625
|
+
const dropdownListRef = useRef2();
|
1626
|
+
const [isHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
1627
|
+
const { requestPermission } = useAwayNotifications2();
|
1628
|
+
const showChat = !!((_a = screenProps.elements) == null ? void 0 : _a.chat);
|
1629
|
+
const autoRoomJoined = useRef2(isPreviewScreenEnabled);
|
1630
|
+
const isMobileHLSStream = useMobileHLSStream();
|
1631
|
+
const isLandscapeHLSStream = useLandscapeHLSStream();
|
1632
|
+
const isMwebHLSStream = isMobileHLSStream || isLandscapeHLSStream;
|
1633
|
+
const toggleControls = () => {
|
1634
|
+
var _a2;
|
1635
|
+
if (((_a2 = dropdownListRef.current) == null ? void 0 : _a2.length) === 0 && isMobileDevice && !isMwebHLSStream) {
|
1636
|
+
setHideControls((value) => !value);
|
1637
|
+
}
|
1638
|
+
};
|
1639
|
+
useEffect10(() => {
|
1640
|
+
let timeout;
|
1641
|
+
dropdownListRef.current = dropdownList || [];
|
1642
|
+
if (dropdownListRef.current && dropdownListRef.current.length === 0) {
|
1643
|
+
clearTimeout(timeout);
|
1644
|
+
timeout = setTimeout(() => {
|
1645
|
+
if (dropdownListRef.current && dropdownListRef.current.length === 0) {
|
1646
|
+
setHideControls(isMobileDevice);
|
1647
|
+
}
|
1648
|
+
}, 5e3);
|
1649
|
+
}
|
1650
|
+
return () => {
|
1651
|
+
clearTimeout(timeout);
|
1652
|
+
};
|
1653
|
+
}, [dropdownList, hideControls, isMobileDevice]);
|
1654
|
+
useEffect10(() => {
|
1655
|
+
if (authTokenInAppData && !isConnectedToRoom && !isPreviewScreenEnabled && roomState !== HMSRoomState.Connecting && !autoRoomJoined.current) {
|
1656
|
+
hmsActions.join({
|
1657
|
+
userName: userName || uuid(),
|
1658
|
+
authToken: authTokenInAppData,
|
1659
|
+
initEndpoint: endpoints == null ? void 0 : endpoints.init,
|
1660
|
+
settings: {
|
1661
|
+
isAudioMuted: !isPreviewScreenEnabled,
|
1662
|
+
isVideoMuted: !isPreviewScreenEnabled,
|
1663
|
+
speakerAutoSelectionBlacklist: ["Yeti Stereo Microphone"]
|
1664
|
+
}
|
1665
|
+
}).then(() => requestPermission()).catch(console.error);
|
1666
|
+
autoRoomJoined.current = true;
|
1667
|
+
}
|
1668
|
+
}, [
|
1669
|
+
authTokenInAppData,
|
1670
|
+
endpoints == null ? void 0 : endpoints.init,
|
1671
|
+
hmsActions,
|
1672
|
+
isConnectedToRoom,
|
1673
|
+
isPreviewScreenEnabled,
|
1674
|
+
roomState,
|
1675
|
+
userName,
|
1676
|
+
requestPermission
|
1677
|
+
]);
|
1678
|
+
useEffect10(() => {
|
1679
|
+
onJoinFunc == null ? void 0 : onJoinFunc();
|
1680
|
+
return () => {
|
1681
|
+
PictureInPicture.stop().catch((error) => console.error("stopping pip", error.message));
|
1682
|
+
};
|
1683
|
+
}, [onJoinFunc]);
|
1684
|
+
if (!isConnectedToRoom && ![HMSRoomState.Reconnecting, HMSRoomState.Disconnected].includes(roomState)) {
|
1685
|
+
return /* @__PURE__ */ React19.createElement(FullPageProgress_default, { text: roomState === HMSRoomState.Connecting ? "Joining..." : "" });
|
1686
|
+
}
|
1687
|
+
const hideControlsForStreaming = isMwebHLSStream ? true : hideControls;
|
1688
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, isHLSStarted ? /* @__PURE__ */ React19.createElement(Box, { css: { position: "fixed", zIndex: 100, w: "100%", h: "100%", left: 0, top: 0 } }, /* @__PURE__ */ React19.createElement(FullPageProgress_default, { text: "Starting live stream...", css: { opacity: 0.8, bg: "$background_dim" } })) : null, /* @__PURE__ */ React19.createElement(Flex, { css: { size: "100%", overflow: "hidden" }, direction: "column" }, !(screenProps.hideSections.includes("header") || isMwebHLSStream) && /* @__PURE__ */ React19.createElement(
|
1689
|
+
Box,
|
1690
|
+
{
|
1691
|
+
ref: headerRef,
|
1692
|
+
css: {
|
1693
|
+
h: "$18",
|
1694
|
+
transition: "margin 0.3s ease-in-out",
|
1695
|
+
marginTop: hideControlsForStreaming ? `-${(_b = headerRef.current) == null ? void 0 : _b.clientHeight}px` : "none",
|
1696
|
+
"@md": {
|
1697
|
+
h: "$17"
|
1698
|
+
}
|
1699
|
+
},
|
1700
|
+
"data-testid": "header"
|
1701
|
+
},
|
1702
|
+
/* @__PURE__ */ React19.createElement(Header, null)
|
1703
|
+
), /* @__PURE__ */ React19.createElement(
|
1704
|
+
Box,
|
1705
|
+
{
|
1706
|
+
css: {
|
1707
|
+
w: "100%",
|
1708
|
+
flex: "1 1 0",
|
1709
|
+
minHeight: 0,
|
1710
|
+
// @ts-ignore
|
1711
|
+
px: ((_e = (_d = (_c = screenProps == null ? void 0 : screenProps.elements) == null ? void 0 : _c.video_tile_layout) == null ? void 0 : _d.grid) == null ? void 0 : _e.edge_to_edge) ? 0 : "$10",
|
1712
|
+
// TODO: padding to be controlled by section/element
|
1713
|
+
paddingBottom: "env(safe-area-inset-bottom)",
|
1714
|
+
"@lg": {
|
1715
|
+
px: 0
|
1716
|
+
}
|
1717
|
+
},
|
1718
|
+
id: "conferencing",
|
1719
|
+
"data-testid": "conferencing",
|
1720
|
+
onClick: toggleControls
|
1721
|
+
},
|
1722
|
+
screenProps.elements ? /* @__PURE__ */ React19.createElement(
|
1723
|
+
VideoStreamingSection,
|
1724
|
+
{
|
1725
|
+
screenType: screenProps.screenType,
|
1726
|
+
elements: screenProps.elements,
|
1727
|
+
hideControls: hideControlsForStreaming
|
1728
|
+
}
|
1729
|
+
) : null
|
1730
|
+
), !screenProps.hideSections.includes("footer") && screenProps.elements && !isMwebHLSStream && /* @__PURE__ */ React19.createElement(
|
1731
|
+
Box,
|
1732
|
+
{
|
1733
|
+
ref: footerRef,
|
1734
|
+
css: {
|
1735
|
+
flexShrink: 0,
|
1736
|
+
maxHeight: "$24",
|
1737
|
+
transition: "margin 0.3s ease-in-out",
|
1738
|
+
bg: "$background_dim",
|
1739
|
+
marginBottom: hideControlsForStreaming ? `-${(_f = footerRef.current) == null ? void 0 : _f.clientHeight}px` : void 0,
|
1740
|
+
"@md": {
|
1741
|
+
maxHeight: "unset",
|
1742
|
+
bg: screenProps.screenType === "hls_live_streaming" ? "transparent" : "$background_dim"
|
1743
|
+
}
|
1744
|
+
},
|
1745
|
+
"data-testid": "footer"
|
1746
|
+
},
|
1747
|
+
/* @__PURE__ */ React19.createElement(Footer2, { elements: screenProps.elements, screenType: screenProps.screenType })
|
1748
|
+
), isMwebHLSStream && !showChat && /* @__PURE__ */ React19.createElement(
|
1749
|
+
Flex,
|
1750
|
+
{
|
1751
|
+
css: {
|
1752
|
+
alignItems: "center",
|
1753
|
+
pr: "$4",
|
1754
|
+
pb: "$4",
|
1755
|
+
position: "relative"
|
1756
|
+
},
|
1757
|
+
justify: "end",
|
1758
|
+
gap: "2"
|
1759
|
+
},
|
1760
|
+
/* @__PURE__ */ React19.createElement(RaiseHand, null),
|
1761
|
+
/* @__PURE__ */ React19.createElement(MoreSettings, { elements: screenProps.elements, screenType: screenProps.screenType }),
|
1762
|
+
/* @__PURE__ */ React19.createElement(
|
1763
|
+
Box,
|
1764
|
+
{
|
1765
|
+
css: {
|
1766
|
+
position: "absolute",
|
1767
|
+
bottom: "100%",
|
1768
|
+
mb: "$4"
|
1769
|
+
}
|
1770
|
+
},
|
1771
|
+
/* @__PURE__ */ React19.createElement(EmojiReaction, null)
|
1772
|
+
)
|
1773
|
+
), /* @__PURE__ */ React19.createElement(RoleChangeRequestModal, null), /* @__PURE__ */ React19.createElement(HLSFailureModal, null), /* @__PURE__ */ React19.createElement(ActivatedPIP, null), /* @__PURE__ */ React19.createElement(PreviousRoleInMetadata, null)));
|
1774
|
+
};
|
1775
|
+
export {
|
1776
|
+
ConferenceScreen
|
1777
|
+
};
|
1778
|
+
//# sourceMappingURL=ConferenceScreen-CSVWECB5.js.map
|