@100mslive/roomkit-react 0.1.6-alpha.0 → 0.1.6-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
textEllipsis,
|
|
36
36
|
theme,
|
|
37
37
|
toastAnimation
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-POE7H4IE.js";
|
|
39
39
|
|
|
40
40
|
// src/Button/Button.tsx
|
|
41
41
|
import React2 from "react";
|
|
@@ -741,6 +741,7 @@ var Container = styled("div", {
|
|
|
741
741
|
width: "100%",
|
|
742
742
|
height: "100%",
|
|
743
743
|
position: "relative",
|
|
744
|
+
overflow: "hidden",
|
|
744
745
|
borderRadius: "$2",
|
|
745
746
|
display: "flex",
|
|
746
747
|
justifyContent: "center",
|
|
@@ -1989,14 +1990,14 @@ var Collapsible = {
|
|
|
1989
1990
|
};
|
|
1990
1991
|
|
|
1991
1992
|
// src/Prebuilt/App.tsx
|
|
1992
|
-
import React61, { Suspense as Suspense2, useEffect as
|
|
1993
|
-
import { BrowserRouter, MemoryRouter, Navigate, Route, Routes, useParams as
|
|
1993
|
+
import React61, { Suspense as Suspense2, useEffect as useEffect28, useRef as useRef10 } from "react";
|
|
1994
|
+
import { BrowserRouter, MemoryRouter, Navigate, Route, Routes, useParams as useParams5 } from "react-router-dom";
|
|
1994
1995
|
import {
|
|
1995
1996
|
HMSReactiveStore,
|
|
1996
1997
|
HMSRoomProvider,
|
|
1997
|
-
selectIsConnectedToRoom as
|
|
1998
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom7,
|
|
1998
1999
|
useHMSActions as useHMSActions20,
|
|
1999
|
-
useHMSStore as
|
|
2000
|
+
useHMSStore as useHMSStore31
|
|
2000
2001
|
} from "@100mslive/react-sdk";
|
|
2001
2002
|
|
|
2002
2003
|
// src/Prebuilt/components/AppData/AppData.jsx
|
|
@@ -2004,6 +2005,7 @@ import React15, { useEffect as useEffect3 } from "react";
|
|
|
2004
2005
|
import {
|
|
2005
2006
|
HMSRoomState,
|
|
2006
2007
|
selectAvailableRoleNames,
|
|
2008
|
+
selectFullAppData,
|
|
2007
2009
|
selectHLSState,
|
|
2008
2010
|
selectIsConnectedToRoom,
|
|
2009
2011
|
selectLocalPeerRoleName,
|
|
@@ -2112,7 +2114,6 @@ var APP_DATA = {
|
|
|
2112
2114
|
appConfig: "appConfig",
|
|
2113
2115
|
sidePane: "sidePane",
|
|
2114
2116
|
hlsStats: "hlsStats",
|
|
2115
|
-
hlsViewerRole: "hlsViewerRole",
|
|
2116
2117
|
waitingViewerRole: "waitingViewerRole",
|
|
2117
2118
|
subscribedNotifications: "subscribedNotifications",
|
|
2118
2119
|
logo: "logo",
|
|
@@ -2127,11 +2128,11 @@ var APP_DATA = {
|
|
|
2127
2128
|
authToken: "authToken",
|
|
2128
2129
|
pdfConfig: "pdfConfig",
|
|
2129
2130
|
minimiseInset: "minimiseInset",
|
|
2130
|
-
activeScreensharePeerId: "activeScreensharePeerId"
|
|
2131
|
+
activeScreensharePeerId: "activeScreensharePeerId",
|
|
2132
|
+
disableNotificiations: "disableNotificiations"
|
|
2131
2133
|
};
|
|
2132
2134
|
var UI_SETTINGS = {
|
|
2133
2135
|
isAudioOnly: "isAudioOnly",
|
|
2134
|
-
isHeadless: "isHeadless",
|
|
2135
2136
|
maxTileCount: "maxTileCount",
|
|
2136
2137
|
uiViewMode: "uiViewMode",
|
|
2137
2138
|
showStatsOnTiles: "showStatsOnTiles",
|
|
@@ -2224,10 +2225,6 @@ var useSetUiSettings = (uiSettingKey) => {
|
|
|
2224
2225
|
});
|
|
2225
2226
|
return [value, setValue];
|
|
2226
2227
|
};
|
|
2227
|
-
var useIsHeadless = () => {
|
|
2228
|
-
const isHeadless = useUISettings(UI_SETTINGS.isHeadless);
|
|
2229
|
-
return isHeadless;
|
|
2230
|
-
};
|
|
2231
2228
|
var useWaitingViewerRole = () => {
|
|
2232
2229
|
return useHMSStore3(selectAppData2(APP_DATA.waitingViewerRole));
|
|
2233
2230
|
};
|
|
@@ -2257,6 +2254,10 @@ var useSubscribedNotifications = (notificationKey) => {
|
|
|
2257
2254
|
const notificationPreference = useHMSStore3(selectAppDataByPath(APP_DATA.subscribedNotifications, notificationKey));
|
|
2258
2255
|
return notificationPreference;
|
|
2259
2256
|
};
|
|
2257
|
+
var useIsNotificationDisabled = () => {
|
|
2258
|
+
const notificationPreference = useHMSStore3(selectAppDataByPath(APP_DATA.disableNotificiations));
|
|
2259
|
+
return notificationPreference;
|
|
2260
|
+
};
|
|
2260
2261
|
var useSetSubscribedNotifications = (notificationKey) => {
|
|
2261
2262
|
const value = useSubscribedNotifications(notificationKey);
|
|
2262
2263
|
const setValue = useSetAppData({
|
|
@@ -2325,7 +2326,6 @@ var getAppDetails = (appDetails) => {
|
|
|
2325
2326
|
var initialAppData = {
|
|
2326
2327
|
[APP_DATA.uiSettings]: {
|
|
2327
2328
|
[UI_SETTINGS.isAudioOnly]: false,
|
|
2328
|
-
[UI_SETTINGS.isHeadless]: false,
|
|
2329
2329
|
[UI_SETTINGS.maxTileCount]: 9,
|
|
2330
2330
|
[UI_SETTINGS.showStatsOnTiles]: false,
|
|
2331
2331
|
[UI_SETTINGS.enableAmbientMusic]: false,
|
|
@@ -2353,7 +2353,8 @@ var initialAppData = {
|
|
|
2353
2353
|
[APP_DATA.dropdownList]: [],
|
|
2354
2354
|
[APP_DATA.authToken]: "",
|
|
2355
2355
|
[APP_DATA.minimiseInset]: false,
|
|
2356
|
-
[APP_DATA.activeScreensharePeerId]: ""
|
|
2356
|
+
[APP_DATA.activeScreensharePeerId]: "",
|
|
2357
|
+
[APP_DATA.disableNotificiations]: false
|
|
2357
2358
|
};
|
|
2358
2359
|
var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
2359
2360
|
const hmsActions = useHMSActions3();
|
|
@@ -2364,13 +2365,14 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
|
2364
2365
|
const roleNames = useHMSStore4(selectAvailableRoleNames);
|
|
2365
2366
|
const rolesMap = useHMSStore4(selectRolesMap);
|
|
2366
2367
|
const localPeerRole = useHMSStore4(selectLocalPeerRoleName);
|
|
2368
|
+
const appData = useHMSStore4(selectFullAppData);
|
|
2367
2369
|
useEffect3(() => {
|
|
2368
2370
|
if (!isConnected && sidePane && sidePane !== SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
|
2369
2371
|
resetSidePane();
|
|
2370
2372
|
}
|
|
2371
2373
|
}, [isConnected, sidePane, resetSidePane]);
|
|
2372
2374
|
useEffect3(() => {
|
|
2373
|
-
hmsActions.initAppData(initialAppData);
|
|
2375
|
+
hmsActions.initAppData(__spreadValues(__spreadValues({}, initialAppData), appData));
|
|
2374
2376
|
hmsActions.setFrameworkInfo({
|
|
2375
2377
|
type: "react-web",
|
|
2376
2378
|
isPrebuilt: true,
|
|
@@ -2385,12 +2387,12 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
|
2385
2387
|
hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings, true);
|
|
2386
2388
|
}, [preferences, hmsActions]);
|
|
2387
2389
|
useEffect3(() => {
|
|
2388
|
-
const
|
|
2390
|
+
const appData2 = {
|
|
2389
2391
|
[APP_DATA.tokenEndpoint]: tokenEndpoint,
|
|
2390
2392
|
[APP_DATA.appConfig]: getAppDetails(appDetails)
|
|
2391
2393
|
};
|
|
2392
|
-
for (const key in
|
|
2393
|
-
hmsActions.setAppData([key],
|
|
2394
|
+
for (const key in appData2) {
|
|
2395
|
+
hmsActions.setAppData([key], appData2[key]);
|
|
2394
2396
|
}
|
|
2395
2397
|
}, [appDetails, tokenEndpoint, hmsActions]);
|
|
2396
2398
|
useEffect3(() => {
|
|
@@ -2452,62 +2454,9 @@ var ResetStreamingStart = () => {
|
|
|
2452
2454
|
return null;
|
|
2453
2455
|
};
|
|
2454
2456
|
|
|
2455
|
-
// src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx
|
|
2456
|
-
import { useEffect as useEffect5 } from "react";
|
|
2457
|
-
import { useHMSActions as useHMSActions4 } from "@100mslive/react-sdk";
|
|
2458
|
-
|
|
2459
|
-
// src/Prebuilt/services/FeatureFlags.jsx
|
|
2460
|
-
import { useEffect as useEffect4 } from "react";
|
|
2461
|
-
import { selectRoomID, useHMSStore as useHMSStore5 } from "@100mslive/react-sdk";
|
|
2462
|
-
var FeatureFlags = class {
|
|
2463
|
-
static init(roomId) {
|
|
2464
|
-
if (!window.HMS) {
|
|
2465
|
-
window.HMS = {};
|
|
2466
|
-
}
|
|
2467
|
-
window.HMS.OPTIMISE_HLS_LATENCY = false;
|
|
2468
|
-
window.HMS.ALWAYS_REQUEST_PERMISSIONS = false;
|
|
2469
|
-
window.HMS.SHOW_NS = define_process_env_default.REACT_APP_ENV !== "prod";
|
|
2470
|
-
this.enableTranscription = define_process_env_default.REACT_APP_TRANSCRIPTION_ROOM_ID === roomId;
|
|
2471
|
-
}
|
|
2472
|
-
static showNS() {
|
|
2473
|
-
return window.HMS.SHOW_NS;
|
|
2474
|
-
}
|
|
2475
|
-
static optimiseHLSLatency() {
|
|
2476
|
-
return window.HMS.OPTIMISE_HLS_LATENCY;
|
|
2477
|
-
}
|
|
2478
|
-
static alwaysRequestPermissions() {
|
|
2479
|
-
return window.HMS.ALWAYS_REQUEST_PERMISSIONS;
|
|
2480
|
-
}
|
|
2481
|
-
};
|
|
2482
|
-
__publicField(FeatureFlags, "enableTranscription", define_process_env_default.REACT_APP_ENABLE_TRANSCRIPTION === "true");
|
|
2483
|
-
__publicField(FeatureFlags, "enableStatsForNerds", define_process_env_default.REACT_APP_ENABLE_STATS_FOR_NERDS === "true");
|
|
2484
|
-
__publicField(FeatureFlags, "enableWhiteboard", define_process_env_default.REACT_APP_ENABLE_WHITEBOARD && define_process_env_default.REACT_APP_PUSHER_APP_KEY && define_process_env_default.REACT_APP_PUSHER_AUTHENDPOINT);
|
|
2485
|
-
__publicField(FeatureFlags, "enableBeamSpeakersLogging", define_process_env_default.REACT_APP_ENABLE_BEAM_SPEAKERS_LOGGING === "true");
|
|
2486
|
-
function FeatureFlagsInit() {
|
|
2487
|
-
const roomId = useHMSStore5(selectRoomID);
|
|
2488
|
-
useEffect4(() => {
|
|
2489
|
-
if (roomId) {
|
|
2490
|
-
FeatureFlags.init(roomId);
|
|
2491
|
-
}
|
|
2492
|
-
}, [roomId]);
|
|
2493
|
-
return null;
|
|
2494
|
-
}
|
|
2495
|
-
|
|
2496
|
-
// src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx
|
|
2497
|
-
function BeamSpeakerLabelsLogging() {
|
|
2498
|
-
const hmsActions = useHMSActions4();
|
|
2499
|
-
const isHeadless = useIsHeadless();
|
|
2500
|
-
useEffect5(() => {
|
|
2501
|
-
if (FeatureFlags.enableBeamSpeakersLogging && isHeadless) {
|
|
2502
|
-
hmsActions.enableBeamSpeakerLabelsLogging();
|
|
2503
|
-
}
|
|
2504
|
-
}, [hmsActions, isHeadless]);
|
|
2505
|
-
return null;
|
|
2506
|
-
}
|
|
2507
|
-
|
|
2508
2457
|
// src/Prebuilt/components/AuthToken.jsx
|
|
2509
|
-
import React18, { useEffect as
|
|
2510
|
-
import { useHMSActions as
|
|
2458
|
+
import React18, { useEffect as useEffect4, useState as useState4 } from "react";
|
|
2459
|
+
import { useHMSActions as useHMSActions4 } from "@100mslive/react-sdk";
|
|
2511
2460
|
|
|
2512
2461
|
// src/Prebuilt/AppContext.tsx
|
|
2513
2462
|
import React16, { useContext } from "react";
|
|
@@ -2684,13 +2633,13 @@ var DialogInputFile = (_a7) => {
|
|
|
2684
2633
|
|
|
2685
2634
|
// src/Prebuilt/components/AuthToken.jsx
|
|
2686
2635
|
var AuthToken = React18.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken }) => {
|
|
2687
|
-
const hmsActions =
|
|
2636
|
+
const hmsActions = useHMSActions4();
|
|
2688
2637
|
const tokenEndpoint = useTokenEndpoint();
|
|
2689
2638
|
const { roomCode, userId } = useHMSPrebuiltContext();
|
|
2690
2639
|
const [error, setError] = useState4({ title: "", body: "" });
|
|
2691
2640
|
let authToken = defaultAuthToken;
|
|
2692
2641
|
const [, setAuthTokenInAppData] = useSetAppDataByKey(APP_DATA.authToken);
|
|
2693
|
-
|
|
2642
|
+
useEffect4(() => {
|
|
2694
2643
|
if (authToken) {
|
|
2695
2644
|
setAuthTokenInAppData(authToken);
|
|
2696
2645
|
return;
|
|
@@ -2830,17 +2779,55 @@ var ErrorBoundary = class extends Component {
|
|
|
2830
2779
|
|
|
2831
2780
|
// src/Prebuilt/components/FullPageProgress.jsx
|
|
2832
2781
|
import React20 from "react";
|
|
2833
|
-
var FullPageProgress = ({ loaderColor = "$primary_default",
|
|
2782
|
+
var FullPageProgress = ({ loaderColor = "$primary_default", text = "", css: css2 = {} }) => /* @__PURE__ */ React20.createElement(Flex, { direction: "column", justify: "center", align: "center", css: __spreadValues({ size: "100%", color: loaderColor }, css2) }, /* @__PURE__ */ React20.createElement(Loading, { color: "currentColor", size: 100 }), text ? /* @__PURE__ */ React20.createElement(Text, { css: { mt: "$10", color: "$on_surface_high" } }, text) : null);
|
|
2834
2783
|
var FullPageProgress_default = FullPageProgress;
|
|
2835
2784
|
|
|
2836
2785
|
// src/Prebuilt/components/init/Init.jsx
|
|
2837
|
-
import React21, { useEffect as
|
|
2786
|
+
import React21, { useEffect as useEffect6 } from "react";
|
|
2787
|
+
|
|
2788
|
+
// src/Prebuilt/services/FeatureFlags.jsx
|
|
2789
|
+
import { useEffect as useEffect5 } from "react";
|
|
2790
|
+
import { selectRoomID, useHMSStore as useHMSStore5 } from "@100mslive/react-sdk";
|
|
2791
|
+
var FeatureFlags = class {
|
|
2792
|
+
static init(roomId) {
|
|
2793
|
+
if (!window.HMS) {
|
|
2794
|
+
window.HMS = {};
|
|
2795
|
+
}
|
|
2796
|
+
window.HMS.OPTIMISE_HLS_LATENCY = false;
|
|
2797
|
+
window.HMS.ALWAYS_REQUEST_PERMISSIONS = false;
|
|
2798
|
+
window.HMS.SHOW_NS = define_process_env_default.REACT_APP_ENV !== "prod";
|
|
2799
|
+
this.enableTranscription = define_process_env_default.REACT_APP_TRANSCRIPTION_ROOM_ID === roomId;
|
|
2800
|
+
}
|
|
2801
|
+
static showNS() {
|
|
2802
|
+
return window.HMS.SHOW_NS;
|
|
2803
|
+
}
|
|
2804
|
+
static optimiseHLSLatency() {
|
|
2805
|
+
return window.HMS.OPTIMISE_HLS_LATENCY;
|
|
2806
|
+
}
|
|
2807
|
+
static alwaysRequestPermissions() {
|
|
2808
|
+
return window.HMS.ALWAYS_REQUEST_PERMISSIONS;
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
__publicField(FeatureFlags, "enableTranscription", define_process_env_default.REACT_APP_ENABLE_TRANSCRIPTION === "true");
|
|
2812
|
+
__publicField(FeatureFlags, "enableStatsForNerds", define_process_env_default.REACT_APP_ENABLE_STATS_FOR_NERDS === "true");
|
|
2813
|
+
__publicField(FeatureFlags, "enableWhiteboard", define_process_env_default.REACT_APP_ENABLE_WHITEBOARD && define_process_env_default.REACT_APP_PUSHER_APP_KEY && define_process_env_default.REACT_APP_PUSHER_AUTHENDPOINT);
|
|
2814
|
+
function FeatureFlagsInit() {
|
|
2815
|
+
const roomId = useHMSStore5(selectRoomID);
|
|
2816
|
+
useEffect5(() => {
|
|
2817
|
+
if (roomId) {
|
|
2818
|
+
FeatureFlags.init(roomId);
|
|
2819
|
+
}
|
|
2820
|
+
}, [roomId]);
|
|
2821
|
+
return null;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
// src/Prebuilt/components/init/Init.jsx
|
|
2838
2825
|
var Init = () => {
|
|
2839
2826
|
const { toggleTheme } = useTheme();
|
|
2840
|
-
|
|
2827
|
+
useEffect6(() => {
|
|
2841
2828
|
window.toggleUiTheme = toggleTheme;
|
|
2842
2829
|
}, [toggleTheme]);
|
|
2843
|
-
|
|
2830
|
+
useEffect6(() => {
|
|
2844
2831
|
function resetHeight() {
|
|
2845
2832
|
var _a7;
|
|
2846
2833
|
document.body.style.height = `${((_a7 = window.visualViewport) == null ? void 0 : _a7.height) || window.innerHeight}px`;
|
|
@@ -2855,12 +2842,12 @@ var Init = () => {
|
|
|
2855
2842
|
};
|
|
2856
2843
|
|
|
2857
2844
|
// src/Prebuilt/components/Input/KeyboardInputManager.js
|
|
2858
|
-
import { useEffect as
|
|
2845
|
+
import { useEffect as useEffect7 } from "react";
|
|
2859
2846
|
import {
|
|
2860
2847
|
selectAppData as selectAppData3,
|
|
2861
2848
|
selectIsLocalAudioEnabled,
|
|
2862
2849
|
selectIsLocalVideoEnabled,
|
|
2863
|
-
useHMSActions as
|
|
2850
|
+
useHMSActions as useHMSActions5,
|
|
2864
2851
|
useHMSVanillaStore as useHMSVanillaStore3
|
|
2865
2852
|
} from "@100mslive/react-sdk";
|
|
2866
2853
|
var isEvenListenersAttached = false;
|
|
@@ -2949,8 +2936,8 @@ _bind = new WeakMap();
|
|
|
2949
2936
|
_unbind = new WeakMap();
|
|
2950
2937
|
var KeyboardHandler = () => {
|
|
2951
2938
|
const store = useHMSVanillaStore3();
|
|
2952
|
-
const actions =
|
|
2953
|
-
|
|
2939
|
+
const actions = useHMSActions5();
|
|
2940
|
+
useEffect7(() => {
|
|
2954
2941
|
const keyboardManager = new KeyboardInputManager(store, actions);
|
|
2955
2942
|
keyboardManager.bindAllShortcuts();
|
|
2956
2943
|
return keyboardManager.unbindAllShortcuts;
|
|
@@ -2959,12 +2946,13 @@ var KeyboardHandler = () => {
|
|
|
2959
2946
|
};
|
|
2960
2947
|
|
|
2961
2948
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
|
2962
|
-
import React30, { useEffect as
|
|
2963
|
-
import { useNavigate } from "react-router-dom";
|
|
2949
|
+
import React30, { useCallback as useCallback8, useEffect as useEffect16 } from "react";
|
|
2950
|
+
import { useNavigate as useNavigate2, useParams as useParams2 } from "react-router-dom";
|
|
2964
2951
|
import {
|
|
2965
2952
|
HMSNotificationTypes as HMSNotificationTypes7,
|
|
2966
2953
|
HMSRoomState as HMSRoomState3,
|
|
2967
2954
|
selectRoomState as selectRoomState3,
|
|
2955
|
+
useCustomEvent,
|
|
2968
2956
|
useHMSNotifications as useHMSNotifications7,
|
|
2969
2957
|
useHMSStore as useHMSStore8
|
|
2970
2958
|
} from "@100mslive/react-sdk";
|
|
@@ -2974,7 +2962,7 @@ import React22 from "react";
|
|
|
2974
2962
|
import merge from "lodash.merge";
|
|
2975
2963
|
|
|
2976
2964
|
// src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts
|
|
2977
|
-
import { useCallback as useCallback5, useEffect as
|
|
2965
|
+
import { useCallback as useCallback5, useEffect as useEffect8, useRef as useRef4, useState as useState5 } from "react";
|
|
2978
2966
|
|
|
2979
2967
|
// src/Prebuilt/provider/roomLayoutProvider/constants/index.ts
|
|
2980
2968
|
import { JoinForm_JoinBtnType } from "@100mslive/types-prebuilt/elements/join_form";
|
|
@@ -3055,7 +3043,7 @@ var useFetchRoomLayout = ({
|
|
|
3055
3043
|
setLayout(layout2);
|
|
3056
3044
|
}
|
|
3057
3045
|
}, []);
|
|
3058
|
-
|
|
3046
|
+
useEffect8(() => {
|
|
3059
3047
|
(() => __async(void 0, null, function* () {
|
|
3060
3048
|
var _a7, _b7;
|
|
3061
3049
|
if (isFetchInProgress.current || !authToken) {
|
|
@@ -3113,7 +3101,7 @@ var useUpdateRoomLayout = () => {
|
|
|
3113
3101
|
|
|
3114
3102
|
// src/Prebuilt/components/Toast/ToastConfig.jsx
|
|
3115
3103
|
import React23, { useCallback as useCallback6 } from "react";
|
|
3116
|
-
import { selectPeerByID, useHMSActions as
|
|
3104
|
+
import { selectPeerByID, useHMSActions as useHMSActions6, useHMSStore as useHMSStore6 } from "@100mslive/react-sdk";
|
|
3117
3105
|
import {
|
|
3118
3106
|
ChatUnreadIcon,
|
|
3119
3107
|
ConnectivityIcon,
|
|
@@ -3132,7 +3120,7 @@ var ChatAction = React23.forwardRef((_, ref) => {
|
|
|
3132
3120
|
});
|
|
3133
3121
|
var HandRaiseAction = React23.forwardRef(({ id = "", isSingleHandRaise = true }, ref) => {
|
|
3134
3122
|
var _a7, _b7, _c;
|
|
3135
|
-
const hmsActions =
|
|
3123
|
+
const hmsActions = useHMSActions6();
|
|
3136
3124
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
|
3137
3125
|
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
|
3138
3126
|
const peer = useHMSStore6(selectPeerByID(id));
|
|
@@ -3206,7 +3194,7 @@ var ToastConfig = {
|
|
|
3206
3194
|
};
|
|
3207
3195
|
}
|
|
3208
3196
|
},
|
|
3209
|
-
|
|
3197
|
+
RAISE_HAND: {
|
|
3210
3198
|
single: (notification) => {
|
|
3211
3199
|
var _a7, _b7;
|
|
3212
3200
|
return {
|
|
@@ -3217,8 +3205,12 @@ var ToastConfig = {
|
|
|
3217
3205
|
},
|
|
3218
3206
|
multiple: (notifications) => {
|
|
3219
3207
|
var _a7;
|
|
3208
|
+
const count = new Set(notifications.map((notification) => {
|
|
3209
|
+
var _a8;
|
|
3210
|
+
return (_a8 = notification.data) == null ? void 0 : _a8.id;
|
|
3211
|
+
})).size;
|
|
3220
3212
|
return {
|
|
3221
|
-
title: `${(_a7 = notifications[notifications.length - 1].data) == null ? void 0 : _a7.name}
|
|
3213
|
+
title: `${(_a7 = notifications[notifications.length - 1].data) == null ? void 0 : _a7.name} ${count > 1 ? `${count} and others` : ""} raised hand`,
|
|
3222
3214
|
icon: /* @__PURE__ */ React23.createElement(HandIcon, null),
|
|
3223
3215
|
action: /* @__PURE__ */ React23.createElement(HandRaiseAction, { isSingleHandRaise: false })
|
|
3224
3216
|
};
|
|
@@ -3392,11 +3384,11 @@ function AutoplayBlockedModal() {
|
|
|
3392
3384
|
}
|
|
3393
3385
|
|
|
3394
3386
|
// src/Prebuilt/components/Notifications/InitErrorModal.jsx
|
|
3395
|
-
import React25, { useEffect as
|
|
3387
|
+
import React25, { useEffect as useEffect9, useState as useState6 } from "react";
|
|
3396
3388
|
var InitErrorModal = ({ notification }) => {
|
|
3397
3389
|
const [showModal, setShowModal] = useState6(false);
|
|
3398
3390
|
const [info, setInfo] = useState6({ title: "Init Error", description: "" });
|
|
3399
|
-
|
|
3391
|
+
useEffect9(() => {
|
|
3400
3392
|
const data = notification == null ? void 0 : notification.data;
|
|
3401
3393
|
if (!data || data.action !== "INIT") {
|
|
3402
3394
|
return;
|
|
@@ -3420,7 +3412,7 @@ var InitErrorModal = ({ notification }) => {
|
|
|
3420
3412
|
};
|
|
3421
3413
|
|
|
3422
3414
|
// src/Prebuilt/components/Notifications/PeerNotifications.jsx
|
|
3423
|
-
import { useEffect as
|
|
3415
|
+
import { useEffect as useEffect10 } from "react";
|
|
3424
3416
|
import {
|
|
3425
3417
|
HMSNotificationTypes,
|
|
3426
3418
|
HMSRoomState as HMSRoomState2,
|
|
@@ -3432,7 +3424,7 @@ import {
|
|
|
3432
3424
|
// src/Prebuilt/common/utils.js
|
|
3433
3425
|
var getMetadata = (metadataString) => {
|
|
3434
3426
|
try {
|
|
3435
|
-
return metadataString
|
|
3427
|
+
return !metadataString ? {} : JSON.parse(metadataString);
|
|
3436
3428
|
} catch (error) {
|
|
3437
3429
|
return {};
|
|
3438
3430
|
}
|
|
@@ -3466,7 +3458,7 @@ var PeerNotifications = () => {
|
|
|
3466
3458
|
const isPeerJoinSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_JOINED);
|
|
3467
3459
|
const isPeerLeftSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_LEFT);
|
|
3468
3460
|
const roomState = useHMSStore7(selectRoomState2);
|
|
3469
|
-
|
|
3461
|
+
useEffect10(() => {
|
|
3470
3462
|
var _a7, _b7;
|
|
3471
3463
|
if (roomState !== HMSRoomState2.Connected) {
|
|
3472
3464
|
return;
|
|
@@ -3500,7 +3492,7 @@ var PeerNotifications = () => {
|
|
|
3500
3492
|
};
|
|
3501
3493
|
|
|
3502
3494
|
// src/Prebuilt/components/Notifications/PermissionErrorModal.jsx
|
|
3503
|
-
import React26, { useEffect as
|
|
3495
|
+
import React26, { useEffect as useEffect11, useState as useState7 } from "react";
|
|
3504
3496
|
import { useMedia } from "react-use";
|
|
3505
3497
|
import { HMSNotificationTypes as HMSNotificationTypes2, useHMSNotifications as useHMSNotifications2 } from "@100mslive/react-sdk";
|
|
3506
3498
|
|
|
@@ -3516,7 +3508,7 @@ function PermissionErrorModal() {
|
|
|
3516
3508
|
const [deviceType, setDeviceType] = useState7("");
|
|
3517
3509
|
const [isSystemError, setIsSystemError] = useState7(false);
|
|
3518
3510
|
const isMobile = useMedia(config.media.md);
|
|
3519
|
-
|
|
3511
|
+
useEffect11(() => {
|
|
3520
3512
|
var _a7, _b7, _c, _d, _e;
|
|
3521
3513
|
if (!notification || ((_a7 = notification.data) == null ? void 0 : _a7.code) !== 3001 && ((_b7 = notification.data) == null ? void 0 : _b7.code) !== 3011 || ((_c = notification.data) == null ? void 0 : _c.code) === 3001 && ((_d = notification.data) == null ? void 0 : _d.message.includes("screen"))) {
|
|
3522
3514
|
return;
|
|
@@ -3558,7 +3550,7 @@ function PermissionErrorModal() {
|
|
|
3558
3550
|
}
|
|
3559
3551
|
|
|
3560
3552
|
// src/Prebuilt/components/Notifications/ReconnectNotifications.jsx
|
|
3561
|
-
import React27, { useEffect as
|
|
3553
|
+
import React27, { useEffect as useEffect12, useState as useState8 } from "react";
|
|
3562
3554
|
import { HMSNotificationTypes as HMSNotificationTypes3, useHMSNotifications as useHMSNotifications3 } from "@100mslive/react-sdk";
|
|
3563
3555
|
var notificationTypes2 = [
|
|
3564
3556
|
HMSNotificationTypes3.RECONNECTED,
|
|
@@ -3566,11 +3558,10 @@ var notificationTypes2 = [
|
|
|
3566
3558
|
HMSNotificationTypes3.ERROR
|
|
3567
3559
|
];
|
|
3568
3560
|
var notificationId = null;
|
|
3569
|
-
var isQA = define_process_env_default.REACT_APP_ENV === "qa";
|
|
3570
3561
|
var ReconnectNotifications = () => {
|
|
3571
3562
|
const notification = useHMSNotifications3(notificationTypes2);
|
|
3572
3563
|
const [open, setOpen] = useState8(false);
|
|
3573
|
-
|
|
3564
|
+
useEffect12(() => {
|
|
3574
3565
|
var _a7;
|
|
3575
3566
|
if ((notification == null ? void 0 : notification.type) === HMSNotificationTypes3.ERROR && ((_a7 = notification == null ? void 0 : notification.data) == null ? void 0 : _a7.isTerminal)) {
|
|
3576
3567
|
setOpen(false);
|
|
@@ -3578,18 +3569,13 @@ var ReconnectNotifications = () => {
|
|
|
3578
3569
|
notificationId = ToastManager.replaceToast(notificationId, ToastConfig.RECONNECTED.single());
|
|
3579
3570
|
setOpen(false);
|
|
3580
3571
|
} else if ((notification == null ? void 0 : notification.type) === HMSNotificationTypes3.RECONNECTING) {
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
notificationId = ToastManager.replaceToast(
|
|
3586
|
-
notificationId,
|
|
3587
|
-
ToastConfig.RECONNECTING.single(notification.data.message)
|
|
3588
|
-
);
|
|
3589
|
-
}
|
|
3572
|
+
notificationId = ToastManager.replaceToast(
|
|
3573
|
+
notificationId,
|
|
3574
|
+
ToastConfig.RECONNECTING.single(notification.data.message)
|
|
3575
|
+
);
|
|
3590
3576
|
}
|
|
3591
3577
|
}, [notification]);
|
|
3592
|
-
if (!open
|
|
3578
|
+
if (!open)
|
|
3593
3579
|
return null;
|
|
3594
3580
|
return /* @__PURE__ */ React27.createElement(Dialog.Root, { open, modal: true }, /* @__PURE__ */ React27.createElement(Dialog.Portal, { container: document.getElementById("conferencing") }, /* @__PURE__ */ React27.createElement(Dialog.Overlay, null), /* @__PURE__ */ React27.createElement(
|
|
3595
3581
|
Dialog.Content,
|
|
@@ -3610,18 +3596,18 @@ var ReconnectNotifications = () => {
|
|
|
3610
3596
|
};
|
|
3611
3597
|
|
|
3612
3598
|
// src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx
|
|
3613
|
-
import React28, { useEffect as
|
|
3614
|
-
import { HMSNotificationTypes as HMSNotificationTypes4, useHMSActions as
|
|
3599
|
+
import React28, { useEffect as useEffect13, useState as useState9 } from "react";
|
|
3600
|
+
import { HMSNotificationTypes as HMSNotificationTypes4, useHMSActions as useHMSActions7, useHMSNotifications as useHMSNotifications4 } from "@100mslive/react-sdk";
|
|
3615
3601
|
import { MicOnIcon } from "@100mslive/react-icons";
|
|
3616
3602
|
var TrackBulkUnmuteModal = () => {
|
|
3617
|
-
const hmsActions =
|
|
3603
|
+
const hmsActions = useHMSActions7();
|
|
3618
3604
|
const [muteNotification, setMuteNotification] = useState9(null);
|
|
3619
3605
|
const notification = useHMSNotifications4([
|
|
3620
3606
|
HMSNotificationTypes4.CHANGE_MULTI_TRACK_STATE_REQUEST,
|
|
3621
3607
|
HMSNotificationTypes4.ROOM_ENDED,
|
|
3622
3608
|
HMSNotificationTypes4.REMOVED_FROM_ROOM
|
|
3623
3609
|
]);
|
|
3624
|
-
|
|
3610
|
+
useEffect13(() => {
|
|
3625
3611
|
switch (notification == null ? void 0 : notification.type) {
|
|
3626
3612
|
case HMSNotificationTypes4.REMOVED_FROM_ROOM:
|
|
3627
3613
|
case HMSNotificationTypes4.ROOM_ENDED:
|
|
@@ -3658,7 +3644,7 @@ var TrackBulkUnmuteModal = () => {
|
|
|
3658
3644
|
};
|
|
3659
3645
|
|
|
3660
3646
|
// src/Prebuilt/components/Notifications/TrackNotifications.jsx
|
|
3661
|
-
import { useEffect as
|
|
3647
|
+
import { useEffect as useEffect14 } from "react";
|
|
3662
3648
|
import { HMSNotificationTypes as HMSNotificationTypes5, useHMSNotifications as useHMSNotifications5 } from "@100mslive/react-sdk";
|
|
3663
3649
|
var notificationTypes3 = [
|
|
3664
3650
|
HMSNotificationTypes5.TRACK_ADDED,
|
|
@@ -3668,7 +3654,7 @@ var notificationTypes3 = [
|
|
|
3668
3654
|
];
|
|
3669
3655
|
var TrackNotifications = () => {
|
|
3670
3656
|
const notification = useHMSNotifications5(notificationTypes3);
|
|
3671
|
-
|
|
3657
|
+
useEffect14(() => {
|
|
3672
3658
|
if (notification) {
|
|
3673
3659
|
console.debug(`[${notification.type}]`, notification);
|
|
3674
3660
|
}
|
|
@@ -3677,18 +3663,18 @@ var TrackNotifications = () => {
|
|
|
3677
3663
|
};
|
|
3678
3664
|
|
|
3679
3665
|
// src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx
|
|
3680
|
-
import React29, { useEffect as
|
|
3681
|
-
import { HMSNotificationTypes as HMSNotificationTypes6, useHMSActions as
|
|
3666
|
+
import React29, { useEffect as useEffect15, useState as useState10 } from "react";
|
|
3667
|
+
import { HMSNotificationTypes as HMSNotificationTypes6, useHMSActions as useHMSActions8, useHMSNotifications as useHMSNotifications6 } from "@100mslive/react-sdk";
|
|
3682
3668
|
import { MicOnIcon as MicOnIcon2 } from "@100mslive/react-icons";
|
|
3683
3669
|
var TrackUnmuteModal = () => {
|
|
3684
|
-
const hmsActions =
|
|
3670
|
+
const hmsActions = useHMSActions8();
|
|
3685
3671
|
const notification = useHMSNotifications6([
|
|
3686
3672
|
HMSNotificationTypes6.CHANGE_TRACK_STATE_REQUEST,
|
|
3687
3673
|
HMSNotificationTypes6.ROOM_ENDED,
|
|
3688
3674
|
HMSNotificationTypes6.REMOVED_FROM_ROOM
|
|
3689
3675
|
]);
|
|
3690
3676
|
const [muteNotification, setMuteNotification] = useState10(null);
|
|
3691
|
-
|
|
3677
|
+
useEffect15(() => {
|
|
3692
3678
|
switch (notification == null ? void 0 : notification.type) {
|
|
3693
3679
|
case HMSNotificationTypes6.REMOVED_FROM_ROOM:
|
|
3694
3680
|
case HMSNotificationTypes6.ROOM_ENDED:
|
|
@@ -3722,17 +3708,496 @@ var TrackUnmuteModal = () => {
|
|
|
3722
3708
|
);
|
|
3723
3709
|
};
|
|
3724
3710
|
|
|
3711
|
+
// src/Prebuilt/components/hooks/useRedirectToLeave.tsx
|
|
3712
|
+
import { useCallback as useCallback7 } from "react";
|
|
3713
|
+
import { useNavigate, useParams } from "react-router-dom";
|
|
3714
|
+
|
|
3715
|
+
// src/Prebuilt/components/PIP/PIPManager.js
|
|
3716
|
+
import * as workerTimers from "worker-timers";
|
|
3717
|
+
|
|
3718
|
+
// src/Prebuilt/components/PIP/pipUtils.js
|
|
3719
|
+
var CANVAS_FILL_COLOR;
|
|
3720
|
+
var CANVAS_STROKE_COLOR;
|
|
3721
|
+
function setPIPCanvasColors() {
|
|
3722
|
+
if (!CANVAS_FILL_COLOR) {
|
|
3723
|
+
CANVAS_FILL_COLOR = window.getComputedStyle(document.documentElement).getPropertyValue("--hms-ui-colors-surface_bright");
|
|
3724
|
+
}
|
|
3725
|
+
if (!CANVAS_STROKE_COLOR) {
|
|
3726
|
+
CANVAS_STROKE_COLOR = window.getComputedStyle(document.documentElement).getPropertyValue("--hms-ui-colors-border_bright");
|
|
3727
|
+
}
|
|
3728
|
+
}
|
|
3729
|
+
function resetPIPCanvasColors() {
|
|
3730
|
+
CANVAS_FILL_COLOR = "";
|
|
3731
|
+
CANVAS_STROKE_COLOR = "";
|
|
3732
|
+
}
|
|
3733
|
+
function drawVideoElementsOnCanvas(videoElements, canvas) {
|
|
3734
|
+
let videoTiles = videoElements.filter((videoElement) => videoElement.srcObject !== null);
|
|
3735
|
+
const ctx = canvas.getContext("2d");
|
|
3736
|
+
setPIPCanvasColors();
|
|
3737
|
+
ctx.fillStyle = CANVAS_FILL_COLOR;
|
|
3738
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
3739
|
+
if (videoTiles.length === 0) {
|
|
3740
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
3741
|
+
return;
|
|
3742
|
+
}
|
|
3743
|
+
fillGridTiles(videoTiles.slice(0, 4), ctx, canvas);
|
|
3744
|
+
}
|
|
3745
|
+
function dummyChangeInCanvas(canvas) {
|
|
3746
|
+
const ctx = canvas.getContext("2d");
|
|
3747
|
+
setPIPCanvasColors();
|
|
3748
|
+
ctx.fillStyle = CANVAS_FILL_COLOR;
|
|
3749
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
3750
|
+
}
|
|
3751
|
+
function fillGridTiles(videoElements, ctx, canvas) {
|
|
3752
|
+
const offset = 8;
|
|
3753
|
+
canvas.width = 480;
|
|
3754
|
+
canvas.height = 320;
|
|
3755
|
+
ctx.fillStyle = CANVAS_FILL_COLOR;
|
|
3756
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
3757
|
+
if (videoElements.length > 0) {
|
|
3758
|
+
ctx.strokeStyle = CANVAS_STROKE_COLOR;
|
|
3759
|
+
ctx.lineWidth = offset / 2;
|
|
3760
|
+
ctx.strokeRect(0, 0, canvas.width, canvas.height);
|
|
3761
|
+
}
|
|
3762
|
+
if (videoElements.length === 1) {
|
|
3763
|
+
const video = videoElements[0];
|
|
3764
|
+
const { width, height } = getRenderDimensions(video, canvas.width - offset, canvas.height - offset);
|
|
3765
|
+
const xOffset = (canvas.width - width) / 2;
|
|
3766
|
+
const yOffset = (canvas.height - height) / 2;
|
|
3767
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3768
|
+
}
|
|
3769
|
+
if (videoElements.length === 2) {
|
|
3770
|
+
videoElements.forEach((video, index) => {
|
|
3771
|
+
const { width, height } = getRenderDimensions(
|
|
3772
|
+
video,
|
|
3773
|
+
canvas.width / 2 - offset,
|
|
3774
|
+
// This will be the max available width for each tile
|
|
3775
|
+
canvas.height - offset
|
|
3776
|
+
);
|
|
3777
|
+
const xOffset = (canvas.width / 2 - width) / 2 + canvas.width / 2 * index;
|
|
3778
|
+
const yOffset = (canvas.height - height) / 2;
|
|
3779
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3780
|
+
});
|
|
3781
|
+
const path = new Path2D();
|
|
3782
|
+
path.moveTo(canvas.width / 2, 0);
|
|
3783
|
+
path.lineTo(canvas.width / 2, canvas.height);
|
|
3784
|
+
ctx.stroke(path);
|
|
3785
|
+
}
|
|
3786
|
+
if (videoElements.length === 3) {
|
|
3787
|
+
videoElements.forEach((video, index) => {
|
|
3788
|
+
const { width, height } = getRenderDimensions(video, canvas.width / 2 - offset, canvas.height / 2 - offset);
|
|
3789
|
+
const xOffset = index < 2 ? (canvas.width / 2 - width) / 2 + canvas.width / 2 * index : canvas.width / 2 - width / 2;
|
|
3790
|
+
const yOffset = (index < 2 ? 0 : canvas.height / 2) + (canvas.height / 2 - height) / 2;
|
|
3791
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3792
|
+
});
|
|
3793
|
+
const path = new Path2D();
|
|
3794
|
+
path.moveTo(canvas.width / 2, 0);
|
|
3795
|
+
path.lineTo(canvas.width / 2, canvas.height / 2);
|
|
3796
|
+
ctx.stroke(path);
|
|
3797
|
+
path.moveTo(0, canvas.height / 2);
|
|
3798
|
+
path.lineTo(canvas.width, canvas.height / 2);
|
|
3799
|
+
ctx.stroke(path);
|
|
3800
|
+
}
|
|
3801
|
+
if (videoElements.length === 4) {
|
|
3802
|
+
videoElements.forEach((video, index) => {
|
|
3803
|
+
const { width, height } = getRenderDimensions(video, canvas.width / 2 - offset, canvas.height / 2 - offset);
|
|
3804
|
+
const xOffset = (canvas.width / 2 - width) / 2 + canvas.width / 2 * (index % 2);
|
|
3805
|
+
const yOffset = (index < 2 ? 0 : canvas.height / 2) + (canvas.height / 2 - height) / 2;
|
|
3806
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3807
|
+
});
|
|
3808
|
+
const path = new Path2D();
|
|
3809
|
+
path.moveTo(canvas.width / 2, 0);
|
|
3810
|
+
path.lineTo(canvas.width / 2, canvas.height);
|
|
3811
|
+
ctx.stroke(path);
|
|
3812
|
+
path.moveTo(0, canvas.height / 2);
|
|
3813
|
+
path.lineTo(canvas.width, canvas.height / 2);
|
|
3814
|
+
ctx.stroke(path);
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
function getRenderDimensions(video, width, height) {
|
|
3818
|
+
let finalWidth = video.videoWidth / video.videoHeight * height;
|
|
3819
|
+
let finalHeight = height;
|
|
3820
|
+
if (finalWidth > width) {
|
|
3821
|
+
finalWidth = width;
|
|
3822
|
+
finalHeight = video.videoHeight / video.videoWidth * width;
|
|
3823
|
+
}
|
|
3824
|
+
return { width: finalWidth, height: finalHeight };
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
// src/Prebuilt/components/PIP/PIPManager.js
|
|
3828
|
+
var MAX_NUMBER_OF_TILES_IN_PIP = 4;
|
|
3829
|
+
var DEFAULT_FPS = 30;
|
|
3830
|
+
var DEFAULT_CANVAS_WIDTH = 480;
|
|
3831
|
+
var DEFAULT_CANVAS_HEIGHT = 320;
|
|
3832
|
+
var LEAVE_EVENT_NAME = "leavepictureinpicture";
|
|
3833
|
+
var PIPStates = {
|
|
3834
|
+
starting: "starting",
|
|
3835
|
+
started: "started",
|
|
3836
|
+
stopping: "stopping",
|
|
3837
|
+
stopped: "stopped"
|
|
3838
|
+
};
|
|
3839
|
+
var PipManager = class {
|
|
3840
|
+
constructor() {
|
|
3841
|
+
__publicField(this, "listeners", /* @__PURE__ */ new Set());
|
|
3842
|
+
__publicField(this, "stop", () => __async(this, null, function* () {
|
|
3843
|
+
var _a7;
|
|
3844
|
+
if (this.state === PIPStates.stopped) {
|
|
3845
|
+
return;
|
|
3846
|
+
}
|
|
3847
|
+
this.state = PIPStates.stopping;
|
|
3848
|
+
(_a7 = this.pipVideo) == null ? void 0 : _a7.removeEventListener(LEAVE_EVENT_NAME, this.stop);
|
|
3849
|
+
if (this.timeoutRef) {
|
|
3850
|
+
workerTimers.clearTimeout(this.timeoutRef);
|
|
3851
|
+
this.timeoutRef = null;
|
|
3852
|
+
}
|
|
3853
|
+
if (this.isOn()) {
|
|
3854
|
+
this.exitPIP();
|
|
3855
|
+
}
|
|
3856
|
+
yield this.detachOldAttachNewTracks(this.tracksToShow, []);
|
|
3857
|
+
this.onStateChange(false);
|
|
3858
|
+
this.callListeners(false);
|
|
3859
|
+
this.reset();
|
|
3860
|
+
this.state = PIPStates.stopped;
|
|
3861
|
+
}));
|
|
3862
|
+
// ------- Private function --------------
|
|
3863
|
+
/**
|
|
3864
|
+
* @private {boolean} on - whether pip is on/off
|
|
3865
|
+
*/
|
|
3866
|
+
__publicField(this, "callListeners", (on) => {
|
|
3867
|
+
this.listeners.forEach((listener) => listener == null ? void 0 : listener(on));
|
|
3868
|
+
});
|
|
3869
|
+
this.reset();
|
|
3870
|
+
}
|
|
3871
|
+
listenToStateChange(cb) {
|
|
3872
|
+
this.listeners.add(cb);
|
|
3873
|
+
}
|
|
3874
|
+
/**
|
|
3875
|
+
* @private
|
|
3876
|
+
*/
|
|
3877
|
+
reset() {
|
|
3878
|
+
console.debug("resetting PIP state");
|
|
3879
|
+
resetPIPCanvasColors();
|
|
3880
|
+
this.canvas = null;
|
|
3881
|
+
this.pipVideo = null;
|
|
3882
|
+
this.timeoutRef = null;
|
|
3883
|
+
this.hmsActions = null;
|
|
3884
|
+
this.videoElements = [];
|
|
3885
|
+
this.tracksToShow = [];
|
|
3886
|
+
this.onStateChange = () => {
|
|
3887
|
+
};
|
|
3888
|
+
this.state = PIPStates.stopped;
|
|
3889
|
+
}
|
|
3890
|
+
/**
|
|
3891
|
+
* check if PIP is supported in this browser env
|
|
3892
|
+
*/
|
|
3893
|
+
isSupported() {
|
|
3894
|
+
return !!document.pictureInPictureEnabled && !isIOS && !(isMacOS && isSafari);
|
|
3895
|
+
}
|
|
3896
|
+
/**
|
|
3897
|
+
* check if pip is currently turned on
|
|
3898
|
+
*/
|
|
3899
|
+
isOn() {
|
|
3900
|
+
return !!document.pictureInPictureElement;
|
|
3901
|
+
}
|
|
3902
|
+
/**
|
|
3903
|
+
* request browser to start pip and start the render loop updating the pip
|
|
3904
|
+
* video element with peer tracks.
|
|
3905
|
+
* @param hmsActions
|
|
3906
|
+
* @param onStateChangeFn {function(bool):void} callback called to notify change in pip state
|
|
3907
|
+
*/
|
|
3908
|
+
start(hmsActions, onStateChangeFn) {
|
|
3909
|
+
return __async(this, null, function* () {
|
|
3910
|
+
if (!this.isSupported()) {
|
|
3911
|
+
throw new Error("pip is not supported on this browser");
|
|
3912
|
+
}
|
|
3913
|
+
console.debug("starting PIP, current state", this.state);
|
|
3914
|
+
if (this.state === PIPStates.started) {
|
|
3915
|
+
yield this.stop();
|
|
3916
|
+
} else if (this.state === PIPStates.starting) {
|
|
3917
|
+
return;
|
|
3918
|
+
}
|
|
3919
|
+
this.state = PIPStates.starting;
|
|
3920
|
+
try {
|
|
3921
|
+
yield this.init(hmsActions, onStateChangeFn);
|
|
3922
|
+
this.pipVideo.addEventListener(LEAVE_EVENT_NAME, this.stop);
|
|
3923
|
+
this.renderLoop();
|
|
3924
|
+
if (!this.isOn()) {
|
|
3925
|
+
yield this.requestPIP();
|
|
3926
|
+
}
|
|
3927
|
+
console.debug("pip started");
|
|
3928
|
+
this.state = PIPStates.started;
|
|
3929
|
+
this.onStateChange(true);
|
|
3930
|
+
this.callListeners(true);
|
|
3931
|
+
} catch (err) {
|
|
3932
|
+
console.error("error in request pip", err);
|
|
3933
|
+
this.state = PIPStates.stopped;
|
|
3934
|
+
}
|
|
3935
|
+
});
|
|
3936
|
+
}
|
|
3937
|
+
/**
|
|
3938
|
+
* @param peers {Array} All Remote Peers present in call.
|
|
3939
|
+
* @param tracksMap {Object} map of track id to track
|
|
3940
|
+
* */
|
|
3941
|
+
updatePeersAndTracks(peers, tracksMap) {
|
|
3942
|
+
return __async(this, null, function* () {
|
|
3943
|
+
if (!this.canvas) {
|
|
3944
|
+
return;
|
|
3945
|
+
}
|
|
3946
|
+
const newTracksToShowUnordered = this.pickTracksToShow(peers, tracksMap);
|
|
3947
|
+
const currentTracksShowing = this.tracksToShow;
|
|
3948
|
+
this.tracksToShow = this.orderNewTracksToShow(newTracksToShowUnordered, currentTracksShowing);
|
|
3949
|
+
try {
|
|
3950
|
+
yield this.detachOldAttachNewTracks(currentTracksShowing, this.tracksToShow, tracksMap);
|
|
3951
|
+
} catch (error) {
|
|
3952
|
+
console.error("error in detaching/attaching tracks", error);
|
|
3953
|
+
}
|
|
3954
|
+
});
|
|
3955
|
+
}
|
|
3956
|
+
/**
|
|
3957
|
+
* @private
|
|
3958
|
+
*/
|
|
3959
|
+
init(hmsActions, onStateChangeFn) {
|
|
3960
|
+
return __async(this, null, function* () {
|
|
3961
|
+
yield this.initMediaElements();
|
|
3962
|
+
this.hmsActions = hmsActions;
|
|
3963
|
+
this.onStateChange = onStateChangeFn;
|
|
3964
|
+
});
|
|
3965
|
+
}
|
|
3966
|
+
initMediaElements() {
|
|
3967
|
+
return __async(this, null, function* () {
|
|
3968
|
+
if (!this.canvas) {
|
|
3969
|
+
const { canvas, pipVideo } = this.initializeCanvasAndVideoElement();
|
|
3970
|
+
this.canvas = canvas;
|
|
3971
|
+
this.pipVideo = pipVideo;
|
|
3972
|
+
this.videoElements = this.initializeVideoElements();
|
|
3973
|
+
const videoPlayPromise = this.pipVideo.play();
|
|
3974
|
+
dummyChangeInCanvas(this.canvas);
|
|
3975
|
+
yield videoPlayPromise;
|
|
3976
|
+
}
|
|
3977
|
+
});
|
|
3978
|
+
}
|
|
3979
|
+
initializeCanvasAndVideoElement() {
|
|
3980
|
+
const canvas = document.createElement("canvas");
|
|
3981
|
+
canvas.width = DEFAULT_CANVAS_WIDTH;
|
|
3982
|
+
canvas.height = DEFAULT_CANVAS_HEIGHT;
|
|
3983
|
+
const pipVideo = document.createElement("video");
|
|
3984
|
+
pipVideo.width = DEFAULT_CANVAS_WIDTH;
|
|
3985
|
+
pipVideo.height = DEFAULT_CANVAS_HEIGHT;
|
|
3986
|
+
pipVideo.muted = true;
|
|
3987
|
+
pipVideo.srcObject = canvas.captureStream();
|
|
3988
|
+
return { canvas, pipVideo };
|
|
3989
|
+
}
|
|
3990
|
+
initializeVideoElements() {
|
|
3991
|
+
let videoElements = [];
|
|
3992
|
+
for (let i = 0; i < MAX_NUMBER_OF_TILES_IN_PIP; i++) {
|
|
3993
|
+
const videoElement = document.createElement("video");
|
|
3994
|
+
videoElement.autoplay = true;
|
|
3995
|
+
videoElement.playsinline = true;
|
|
3996
|
+
videoElements.push(videoElement);
|
|
3997
|
+
}
|
|
3998
|
+
return videoElements;
|
|
3999
|
+
}
|
|
4000
|
+
/**
|
|
4001
|
+
* render loop is responsible for rendering the video elements on canvas/pip.
|
|
4002
|
+
* in each loop current video elements are stitched and painted on canvas
|
|
4003
|
+
*/
|
|
4004
|
+
renderLoop() {
|
|
4005
|
+
const delay = 1e3 / DEFAULT_FPS;
|
|
4006
|
+
this.timeoutRef = workerTimers.setTimeout(() => {
|
|
4007
|
+
if (this.state === PIPStates.stopping || this.state === PIPStates.stopped) {
|
|
4008
|
+
return;
|
|
4009
|
+
}
|
|
4010
|
+
if (this.state === PIPStates.started) {
|
|
4011
|
+
drawVideoElementsOnCanvas(this.videoElements, this.canvas);
|
|
4012
|
+
}
|
|
4013
|
+
this.renderLoop();
|
|
4014
|
+
}, delay);
|
|
4015
|
+
}
|
|
4016
|
+
requestPIP() {
|
|
4017
|
+
return __async(this, null, function* () {
|
|
4018
|
+
try {
|
|
4019
|
+
if (this.isOn()) {
|
|
4020
|
+
this.exitPIP();
|
|
4021
|
+
}
|
|
4022
|
+
yield this.pipVideo.requestPictureInPicture();
|
|
4023
|
+
} catch (error) {
|
|
4024
|
+
console.error("error in requestpip", error, "state", this.state);
|
|
4025
|
+
throw error;
|
|
4026
|
+
}
|
|
4027
|
+
});
|
|
4028
|
+
}
|
|
4029
|
+
exitPIP() {
|
|
4030
|
+
document.exitPictureInPicture();
|
|
4031
|
+
}
|
|
4032
|
+
/**
|
|
4033
|
+
* Logic - pick only enabled video tracks
|
|
4034
|
+
* @param peers {Array<any>}
|
|
4035
|
+
* @param tracksMap {Record<string, any>}
|
|
4036
|
+
*/
|
|
4037
|
+
pickTracksToShow(peers, tracksMap) {
|
|
4038
|
+
var _a7;
|
|
4039
|
+
const tracksToShow = [];
|
|
4040
|
+
for (const peer of peers) {
|
|
4041
|
+
if (tracksToShow.length === MAX_NUMBER_OF_TILES_IN_PIP) {
|
|
4042
|
+
break;
|
|
4043
|
+
} else if (peer.videoTrack && ((_a7 = tracksMap[peer.videoTrack]) == null ? void 0 : _a7.enabled)) {
|
|
4044
|
+
tracksToShow.push(peer.videoTrack);
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
return tracksToShow;
|
|
4048
|
+
}
|
|
4049
|
+
/**
|
|
4050
|
+
* there has to be a smart reordering of new tracks based on currently showing
|
|
4051
|
+
* ones to reduce unnecessary displacement. If someone was showing up both
|
|
4052
|
+
* earlier and now, it's a better UX to keep their position same instead
|
|
4053
|
+
* of letting it change.
|
|
4054
|
+
* The returned array is a shuffled version of newTracks with position of
|
|
4055
|
+
* tracks present in the old tracks intact.
|
|
4056
|
+
* eg. old = [1,5,9,3], new = [3,8,2,9], result = [8,2,9,3]
|
|
4057
|
+
* @param oldTracks {Array}
|
|
4058
|
+
* @param newTracks {Array}
|
|
4059
|
+
* @return {Array}
|
|
4060
|
+
*/
|
|
4061
|
+
orderNewTracksToShow(newTracks, oldTracks) {
|
|
4062
|
+
const betterNewTracks = [];
|
|
4063
|
+
const leftOvers = [];
|
|
4064
|
+
newTracks.forEach((track) => {
|
|
4065
|
+
const oldPosition = oldTracks.indexOf(track);
|
|
4066
|
+
if (oldPosition !== -1 && oldPosition < newTracks.length) {
|
|
4067
|
+
betterNewTracks[oldPosition] = track;
|
|
4068
|
+
} else {
|
|
4069
|
+
leftOvers.push(track);
|
|
4070
|
+
}
|
|
4071
|
+
});
|
|
4072
|
+
for (let i = 0; i < newTracks.length; i++) {
|
|
4073
|
+
if (!betterNewTracks[i]) {
|
|
4074
|
+
betterNewTracks[i] = leftOvers.shift();
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
return betterNewTracks;
|
|
4078
|
+
}
|
|
4079
|
+
/**
|
|
4080
|
+
* call detach for tracks which no longer need to be shown and attach for
|
|
4081
|
+
* new ones which are to be shown now.
|
|
4082
|
+
* Note: oldTracks and newTracks are not necessarily of same length
|
|
4083
|
+
* @param oldTracks {Array<String>}
|
|
4084
|
+
* @param newTracks {Array<String>}
|
|
4085
|
+
* @param tracksMap {Record<String, any>}
|
|
4086
|
+
*/
|
|
4087
|
+
// eslint-disable-next-line complexity
|
|
4088
|
+
detachOldAttachNewTracks(oldTracks, newTracks, tracksMap = null) {
|
|
4089
|
+
return __async(this, null, function* () {
|
|
4090
|
+
const numTracks = Math.max(oldTracks.length, newTracks.length);
|
|
4091
|
+
for (let i = 0; i < numTracks; i++) {
|
|
4092
|
+
if (oldTracks[i] === newTracks[i]) {
|
|
4093
|
+
continue;
|
|
4094
|
+
} else if (oldTracks[i]) {
|
|
4095
|
+
if (!tracksMap || tracksMap[oldTracks[i]]) {
|
|
4096
|
+
yield this.hmsActions.detachVideo(oldTracks[i], this.videoElements[i]);
|
|
4097
|
+
}
|
|
4098
|
+
if (this.videoElements[i]) {
|
|
4099
|
+
this.videoElements[i].srcObject = null;
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
if (newTracks[i]) {
|
|
4103
|
+
yield this.hmsActions.attachVideo(newTracks[i], this.videoElements[i]);
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
4106
|
+
});
|
|
4107
|
+
}
|
|
4108
|
+
};
|
|
4109
|
+
var PictureInPicture = new PipManager();
|
|
4110
|
+
|
|
4111
|
+
// src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts
|
|
4112
|
+
function useRoomLayoutScreen({
|
|
4113
|
+
screen
|
|
4114
|
+
}) {
|
|
4115
|
+
var _a7;
|
|
4116
|
+
const roomLayout = useRoomLayout();
|
|
4117
|
+
const screenProps = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7[screen];
|
|
4118
|
+
return screenProps;
|
|
4119
|
+
}
|
|
4120
|
+
function useRoomLayoutPreviewScreen() {
|
|
4121
|
+
var _a7;
|
|
4122
|
+
const screenProps = useRoomLayoutScreen({ screen: "preview" });
|
|
4123
|
+
const isPreviewScreenEnabled = !!screenProps;
|
|
4124
|
+
let elements;
|
|
4125
|
+
let screenType;
|
|
4126
|
+
if (isPreviewScreenEnabled) {
|
|
4127
|
+
screenType = Object.keys(screenProps)[0];
|
|
4128
|
+
elements = (_a7 = screenProps[screenType]) == null ? void 0 : _a7.elements;
|
|
4129
|
+
}
|
|
4130
|
+
return {
|
|
4131
|
+
isPreviewScreenEnabled,
|
|
4132
|
+
elements,
|
|
4133
|
+
screenType
|
|
4134
|
+
};
|
|
4135
|
+
}
|
|
4136
|
+
function useRoomLayoutConferencingScreen() {
|
|
4137
|
+
var _a7, _b7;
|
|
4138
|
+
const screenProps = useRoomLayoutScreen({ screen: "conferencing" }) || {};
|
|
4139
|
+
const screenType = Object.keys(screenProps)[0];
|
|
4140
|
+
const elements = (_a7 = screenProps[screenType]) == null ? void 0 : _a7.elements;
|
|
4141
|
+
const hideSections = ((_b7 = screenProps[screenType]) == null ? void 0 : _b7.hideSections) || [];
|
|
4142
|
+
return {
|
|
4143
|
+
hideSections,
|
|
4144
|
+
elements,
|
|
4145
|
+
screenType
|
|
4146
|
+
};
|
|
4147
|
+
}
|
|
4148
|
+
function useRoomLayoutLeaveScreen() {
|
|
4149
|
+
const screenProps = useRoomLayoutScreen({ screen: "leave" });
|
|
4150
|
+
const isLeaveScreenEnabled = !!screenProps;
|
|
4151
|
+
return {
|
|
4152
|
+
isLeaveScreenEnabled
|
|
4153
|
+
};
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
// src/Prebuilt/components/hooks/useRedirectToLeave.tsx
|
|
4157
|
+
var useRedirectToLeave = () => {
|
|
4158
|
+
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
|
4159
|
+
const { onLeave } = useHMSPrebuiltContext();
|
|
4160
|
+
const params = useParams();
|
|
4161
|
+
const navigate = useNavigate();
|
|
4162
|
+
const redirect = useCallback7(
|
|
4163
|
+
(timeout = 0) => {
|
|
4164
|
+
setTimeout(() => {
|
|
4165
|
+
const prefix = isLeaveScreenEnabled ? "/leave/" : "/";
|
|
4166
|
+
if (params.role) {
|
|
4167
|
+
navigate(prefix + params.roomId + "/" + params.role);
|
|
4168
|
+
} else {
|
|
4169
|
+
navigate(prefix + params.roomId);
|
|
4170
|
+
}
|
|
4171
|
+
PictureInPicture.stop().catch(() => console.error("stopping pip"));
|
|
4172
|
+
ToastManager.clearAllToast();
|
|
4173
|
+
onLeave == null ? void 0 : onLeave();
|
|
4174
|
+
}, timeout);
|
|
4175
|
+
},
|
|
4176
|
+
[isLeaveScreenEnabled, navigate, onLeave, params.role, params.roomId]
|
|
4177
|
+
);
|
|
4178
|
+
return { redirectToLeave: redirect };
|
|
4179
|
+
};
|
|
4180
|
+
|
|
3725
4181
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
|
3726
4182
|
function Notifications() {
|
|
3727
4183
|
const notification = useHMSNotifications7();
|
|
3728
|
-
const navigate =
|
|
4184
|
+
const navigate = useNavigate2();
|
|
4185
|
+
const params = useParams2();
|
|
3729
4186
|
const subscribedNotifications = useSubscribedNotifications() || {};
|
|
3730
|
-
const isHeadless = useIsHeadless();
|
|
3731
4187
|
const roomState = useHMSStore8(selectRoomState3);
|
|
3732
4188
|
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
|
3733
|
-
|
|
4189
|
+
const isNotificationDisabled = useIsNotificationDisabled();
|
|
4190
|
+
const { redirectToLeave } = useRedirectToLeave();
|
|
4191
|
+
const handleRoleChangeDenied = useCallback8((request) => {
|
|
4192
|
+
ToastManager.addToast({
|
|
4193
|
+
title: `${request.peerName} denied your request to join the ${request.role.name} role`,
|
|
4194
|
+
variant: "error"
|
|
4195
|
+
});
|
|
4196
|
+
}, []);
|
|
4197
|
+
useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
|
|
4198
|
+
useEffect16(() => {
|
|
3734
4199
|
var _a7, _b7, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
3735
|
-
if (!notification) {
|
|
4200
|
+
if (!notification || isNotificationDisabled) {
|
|
3736
4201
|
return;
|
|
3737
4202
|
}
|
|
3738
4203
|
switch (notification.type) {
|
|
@@ -3741,12 +4206,12 @@ function Notifications() {
|
|
|
3741
4206
|
return;
|
|
3742
4207
|
}
|
|
3743
4208
|
const metadata = getMetadata((_a7 = notification.data) == null ? void 0 : _a7.metadata);
|
|
3744
|
-
if (!(metadata == null ? void 0 : metadata.isHandRaised) || notification.data.isLocal
|
|
4209
|
+
if (!(metadata == null ? void 0 : metadata.isHandRaised) || notification.data.isLocal)
|
|
3745
4210
|
return;
|
|
3746
4211
|
console.debug("Metadata updated", notification.data);
|
|
3747
4212
|
if (!subscribedNotifications.METADATA_UPDATED)
|
|
3748
4213
|
return;
|
|
3749
|
-
ToastBatcher.showToast({ notification });
|
|
4214
|
+
ToastBatcher.showToast({ notification, type: "RAISE_HAND" });
|
|
3750
4215
|
break;
|
|
3751
4216
|
case HMSNotificationTypes7.NAME_UPDATED:
|
|
3752
4217
|
console.log(notification.data.id + " changed their name to " + notification.data.name);
|
|
@@ -3766,7 +4231,7 @@ function Notifications() {
|
|
|
3766
4231
|
{
|
|
3767
4232
|
onClick: () => {
|
|
3768
4233
|
ToastManager.removeToast(toastId);
|
|
3769
|
-
|
|
4234
|
+
navigate(`/${params.roomId}${params.role ? `/${params.role}` : ""}`);
|
|
3770
4235
|
}
|
|
3771
4236
|
},
|
|
3772
4237
|
"Rejoin"
|
|
@@ -3774,11 +4239,7 @@ function Notifications() {
|
|
|
3774
4239
|
close: false
|
|
3775
4240
|
});
|
|
3776
4241
|
}
|
|
3777
|
-
|
|
3778
|
-
const previewLocation = window.location.pathname.replace("meeting", "leave");
|
|
3779
|
-
ToastManager.clearAllToast();
|
|
3780
|
-
navigate(previewLocation);
|
|
3781
|
-
}, 2e3);
|
|
4242
|
+
redirectToLeave(1e3);
|
|
3782
4243
|
return;
|
|
3783
4244
|
}
|
|
3784
4245
|
if (((_g = notification.data) == null ? void 0 : _g.code) === 3008 || ((_h = notification.data) == null ? void 0 : _h.code) === 3001 || ((_i = notification.data) == null ? void 0 : _i.code) === 3011) {
|
|
@@ -3816,11 +4277,7 @@ function Notifications() {
|
|
|
3816
4277
|
title: `${notification.message}.
|
|
3817
4278
|
${notification.data.reason && `Reason: ${notification.data.reason}`}`
|
|
3818
4279
|
});
|
|
3819
|
-
|
|
3820
|
-
const leaveLocation = window.location.pathname.replace("meeting", "leave");
|
|
3821
|
-
navigate(leaveLocation);
|
|
3822
|
-
ToastManager.clearAllToast();
|
|
3823
|
-
}, 2e3);
|
|
4280
|
+
redirectToLeave(1e3);
|
|
3824
4281
|
break;
|
|
3825
4282
|
case HMSNotificationTypes7.DEVICE_CHANGE_UPDATE:
|
|
3826
4283
|
ToastManager.addToast({
|
|
@@ -3831,12 +4288,15 @@ function Notifications() {
|
|
|
3831
4288
|
break;
|
|
3832
4289
|
}
|
|
3833
4290
|
}, [notification, subscribedNotifications.ERROR, subscribedNotifications.METADATA_UPDATED]);
|
|
3834
|
-
|
|
4291
|
+
if (isNotificationDisabled) {
|
|
4292
|
+
return null;
|
|
4293
|
+
}
|
|
4294
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(TrackUnmuteModal, null), /* @__PURE__ */ React30.createElement(TrackBulkUnmuteModal, null), /* @__PURE__ */ React30.createElement(TrackNotifications, null), /* @__PURE__ */ React30.createElement(PeerNotifications, null), /* @__PURE__ */ React30.createElement(ReconnectNotifications, null), /* @__PURE__ */ React30.createElement(AutoplayBlockedModal, null), /* @__PURE__ */ React30.createElement(PermissionErrorModal, null), /* @__PURE__ */ React30.createElement(InitErrorModal, { notification }));
|
|
3835
4295
|
}
|
|
3836
4296
|
|
|
3837
4297
|
// src/Prebuilt/components/PostLeave.jsx
|
|
3838
4298
|
import React37 from "react";
|
|
3839
|
-
import { useNavigate as
|
|
4299
|
+
import { useNavigate as useNavigate3, useParams as useParams3 } from "react-router-dom";
|
|
3840
4300
|
import { ExitIcon } from "@100mslive/react-icons";
|
|
3841
4301
|
|
|
3842
4302
|
// src/Prebuilt/components/Header/Header.tsx
|
|
@@ -3894,8 +4354,8 @@ var Logo = () => {
|
|
|
3894
4354
|
) : null;
|
|
3895
4355
|
};
|
|
3896
4356
|
|
|
3897
|
-
// src/Prebuilt/components/Header/StreamActions.
|
|
3898
|
-
import React34, { useCallback as
|
|
4357
|
+
// src/Prebuilt/components/Header/StreamActions.tsx
|
|
4358
|
+
import React34, { useCallback as useCallback13, useEffect as useEffect18, useRef as useRef5, useState as useState14 } from "react";
|
|
3899
4359
|
import { useMedia as useMedia3 } from "react-use";
|
|
3900
4360
|
import {
|
|
3901
4361
|
HMSRoomState as HMSRoomState4,
|
|
@@ -3903,7 +4363,7 @@ import {
|
|
|
3903
4363
|
selectIsConnectedToRoom as selectIsConnectedToRoom3,
|
|
3904
4364
|
selectPermissions,
|
|
3905
4365
|
selectRoomState as selectRoomState4,
|
|
3906
|
-
useHMSActions as
|
|
4366
|
+
useHMSActions as useHMSActions12,
|
|
3907
4367
|
useHMSStore as useHMSStore15,
|
|
3908
4368
|
useRecordingStreaming as useRecordingStreaming2
|
|
3909
4369
|
} from "@100mslive/react-sdk";
|
|
@@ -4020,27 +4480,35 @@ import {
|
|
|
4020
4480
|
} from "@100mslive/react-icons";
|
|
4021
4481
|
|
|
4022
4482
|
// src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js
|
|
4023
|
-
import { useCallback as
|
|
4483
|
+
import { useCallback as useCallback10, useEffect as useEffect17, useMemo as useMemo2 } from "react";
|
|
4024
4484
|
import { selectLocalPeerID as selectLocalPeerID2, selectPeerByCondition, useHMSStore as useHMSStore11 } from "@100mslive/react-sdk";
|
|
4025
4485
|
|
|
4026
4486
|
// src/Prebuilt/components/hooks/useMetadata.jsx
|
|
4027
|
-
import { useCallback as
|
|
4028
|
-
import {
|
|
4487
|
+
import { useCallback as useCallback9, useState as useState12 } from "react";
|
|
4488
|
+
import {
|
|
4489
|
+
selectLocalPeerID,
|
|
4490
|
+
selectPeerMetadata,
|
|
4491
|
+
useHMSActions as useHMSActions9,
|
|
4492
|
+
useHMSStore as useHMSStore10,
|
|
4493
|
+
useHMSVanillaStore as useHMSVanillaStore4
|
|
4494
|
+
} from "@100mslive/react-sdk";
|
|
4029
4495
|
var useMyMetadata = () => {
|
|
4030
|
-
const hmsActions =
|
|
4496
|
+
const hmsActions = useHMSActions9();
|
|
4031
4497
|
const localPeerId = useHMSStore10(selectLocalPeerID);
|
|
4498
|
+
const vanillaStore = useHMSVanillaStore4();
|
|
4032
4499
|
const metaData = useHMSStore10(selectPeerMetadata(localPeerId));
|
|
4033
4500
|
const [isHandRaised, setHandRaised] = useState12((metaData == null ? void 0 : metaData.isHandRaised) || false);
|
|
4034
4501
|
const [isBRBOn, setBRBOn] = useState12((metaData == null ? void 0 : metaData.isBRBOn) || false);
|
|
4035
4502
|
const update = (updatedFields) => __async(void 0, null, function* () {
|
|
4036
4503
|
try {
|
|
4037
|
-
|
|
4504
|
+
const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));
|
|
4505
|
+
yield hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));
|
|
4038
4506
|
return true;
|
|
4039
4507
|
} catch (error) {
|
|
4040
|
-
console.error("failed to update metadata ",
|
|
4508
|
+
console.error("failed to update metadata ", updatedFields);
|
|
4041
4509
|
}
|
|
4042
4510
|
});
|
|
4043
|
-
const toggleHandRaise =
|
|
4511
|
+
const toggleHandRaise = useCallback9(() => __async(void 0, null, function* () {
|
|
4044
4512
|
const brbUpdate = !isHandRaised ? false : isBRBOn;
|
|
4045
4513
|
const success = yield update({
|
|
4046
4514
|
isHandRaised: !isHandRaised,
|
|
@@ -4051,7 +4519,7 @@ var useMyMetadata = () => {
|
|
|
4051
4519
|
setHandRaised(!isHandRaised);
|
|
4052
4520
|
}
|
|
4053
4521
|
}), [isHandRaised, isBRBOn]);
|
|
4054
|
-
const toggleBRB =
|
|
4522
|
+
const toggleBRB = useCallback9(() => __async(void 0, null, function* () {
|
|
4055
4523
|
const handRaiseUpdate = !isBRBOn ? false : isHandRaised;
|
|
4056
4524
|
const success = yield update({
|
|
4057
4525
|
isHandRaised: handRaiseUpdate,
|
|
@@ -4087,7 +4555,7 @@ var useWhiteboardMetadata = () => {
|
|
|
4087
4555
|
const { updateMetaData } = useMyMetadata();
|
|
4088
4556
|
const whiteboardOwner = useHMSStore11(selectPeerByCondition(isWhiteboardOwner));
|
|
4089
4557
|
const amIWhiteboardOwner = useMemo2(() => localPeerID === (whiteboardOwner == null ? void 0 : whiteboardOwner.id), [localPeerID, whiteboardOwner]);
|
|
4090
|
-
const toggleWhiteboard =
|
|
4558
|
+
const toggleWhiteboard = useCallback10(() => __async(void 0, null, function* () {
|
|
4091
4559
|
if (!define_process_env_default.REACT_APP_PUSHER_APP_KEY) {
|
|
4092
4560
|
console.error("Cannot start whiteboard - Pusher Key unavailable");
|
|
4093
4561
|
}
|
|
@@ -4101,7 +4569,7 @@ var useWhiteboardMetadata = () => {
|
|
|
4101
4569
|
console.error("failed to toggle whiteboard to ", !whiteboardOwner, error);
|
|
4102
4570
|
}
|
|
4103
4571
|
}), [whiteboardOwner, updateMetaData, amIWhiteboardOwner]);
|
|
4104
|
-
|
|
4572
|
+
useEffect17(() => {
|
|
4105
4573
|
window.toggleWhiteboard = toggleWhiteboard;
|
|
4106
4574
|
}, [toggleWhiteboard]);
|
|
4107
4575
|
return {
|
|
@@ -4115,29 +4583,29 @@ var useWhiteboardMetadata = () => {
|
|
|
4115
4583
|
};
|
|
4116
4584
|
|
|
4117
4585
|
// src/Prebuilt/components/hooks/usePlaylistMusic.js
|
|
4118
|
-
import { useCallback as
|
|
4586
|
+
import { useCallback as useCallback11 } from "react";
|
|
4119
4587
|
import {
|
|
4120
4588
|
selectAudioPlaylist,
|
|
4121
4589
|
selectAudioPlaylistTrackByPeerID,
|
|
4122
4590
|
selectPeerSharingAudioPlaylist,
|
|
4123
|
-
useHMSActions as
|
|
4591
|
+
useHMSActions as useHMSActions10,
|
|
4124
4592
|
useHMSStore as useHMSStore12
|
|
4125
4593
|
} from "@100mslive/react-sdk";
|
|
4126
4594
|
var usePlaylistMusic = () => {
|
|
4127
4595
|
const peer = useHMSStore12(selectPeerSharingAudioPlaylist);
|
|
4128
4596
|
const track = useHMSStore12(selectAudioPlaylistTrackByPeerID(peer == null ? void 0 : peer.id));
|
|
4129
4597
|
const selection = useHMSStore12(selectAudioPlaylist.selectedItem);
|
|
4130
|
-
const hmsActions =
|
|
4131
|
-
const play =
|
|
4598
|
+
const hmsActions = useHMSActions10();
|
|
4599
|
+
const play = useCallback11(
|
|
4132
4600
|
(selectedId) => __async(void 0, null, function* () {
|
|
4133
4601
|
yield hmsActions.audioPlaylist.play(selectedId);
|
|
4134
4602
|
}),
|
|
4135
4603
|
[hmsActions]
|
|
4136
4604
|
);
|
|
4137
|
-
const pause =
|
|
4605
|
+
const pause = useCallback11(() => {
|
|
4138
4606
|
hmsActions.audioPlaylist.pause();
|
|
4139
4607
|
}, [hmsActions]);
|
|
4140
|
-
const setVolume =
|
|
4608
|
+
const setVolume = useCallback11(
|
|
4141
4609
|
(value) => {
|
|
4142
4610
|
hmsActions.setVolume(value, track == null ? void 0 : track.id);
|
|
4143
4611
|
},
|
|
@@ -4147,18 +4615,18 @@ var usePlaylistMusic = () => {
|
|
|
4147
4615
|
};
|
|
4148
4616
|
|
|
4149
4617
|
// src/Prebuilt/components/hooks/useScreenshareAudio.js
|
|
4150
|
-
import { useCallback as
|
|
4618
|
+
import { useCallback as useCallback12 } from "react";
|
|
4151
4619
|
import {
|
|
4152
4620
|
selectPeerSharingAudio,
|
|
4153
4621
|
selectScreenShareAudioByPeerID,
|
|
4154
|
-
useHMSActions as
|
|
4622
|
+
useHMSActions as useHMSActions11,
|
|
4155
4623
|
useHMSStore as useHMSStore13
|
|
4156
4624
|
} from "@100mslive/react-sdk";
|
|
4157
4625
|
var useScreenshareAudio = () => {
|
|
4158
|
-
const hmsActions =
|
|
4626
|
+
const hmsActions = useHMSActions11();
|
|
4159
4627
|
const peer = useHMSStore13(selectPeerSharingAudio);
|
|
4160
4628
|
const track = useHMSStore13(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
|
4161
|
-
const handleMute =
|
|
4629
|
+
const handleMute = useCallback12(() => {
|
|
4162
4630
|
if (!peer.isLocal) {
|
|
4163
4631
|
hmsActions.setVolume(!track.volume ? 100 : 0, track.id);
|
|
4164
4632
|
} else {
|
|
@@ -4281,7 +4749,7 @@ var AdditionalRoomState = () => {
|
|
|
4281
4749
|
))));
|
|
4282
4750
|
};
|
|
4283
4751
|
|
|
4284
|
-
// src/Prebuilt/components/Header/StreamActions.
|
|
4752
|
+
// src/Prebuilt/components/Header/StreamActions.tsx
|
|
4285
4753
|
var LiveStatus = () => {
|
|
4286
4754
|
var _a7;
|
|
4287
4755
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming2();
|
|
@@ -4289,15 +4757,15 @@ var LiveStatus = () => {
|
|
|
4289
4757
|
const isMobile = useMedia3(config.media.md);
|
|
4290
4758
|
const intervalRef = useRef5(null);
|
|
4291
4759
|
const [liveTime, setLiveTime] = useState14(0);
|
|
4292
|
-
const startTimer =
|
|
4760
|
+
const startTimer = useCallback13(() => {
|
|
4293
4761
|
intervalRef.current = setInterval(() => {
|
|
4294
4762
|
var _a8;
|
|
4295
|
-
if (hlsState == null ? void 0 : hlsState.running) {
|
|
4296
|
-
setLiveTime(Date.now() -
|
|
4763
|
+
if ((hlsState == null ? void 0 : hlsState.running) && ((_a8 = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _a8.startedAt)) {
|
|
4764
|
+
setLiveTime(Date.now() - hlsState.variants[0].startedAt.getTime());
|
|
4297
4765
|
}
|
|
4298
4766
|
}, 1e3);
|
|
4299
4767
|
}, [hlsState == null ? void 0 : hlsState.running, hlsState == null ? void 0 : hlsState.variants]);
|
|
4300
|
-
|
|
4768
|
+
useEffect18(() => {
|
|
4301
4769
|
if (hlsState == null ? void 0 : hlsState.running) {
|
|
4302
4770
|
startTimer();
|
|
4303
4771
|
}
|
|
@@ -4343,6 +4811,7 @@ var RecordingStatus = () => {
|
|
|
4343
4811
|
return /* @__PURE__ */ React34.createElement(
|
|
4344
4812
|
Tooltip,
|
|
4345
4813
|
{
|
|
4814
|
+
boxCss: { zIndex: 1 },
|
|
4346
4815
|
title: getRecordingText({
|
|
4347
4816
|
isBrowserRecordingOn,
|
|
4348
4817
|
isServerRecordingOn,
|
|
@@ -4366,12 +4835,12 @@ var StartRecording = () => {
|
|
|
4366
4835
|
const [open, setOpen] = useState14(false);
|
|
4367
4836
|
const [recordingStarted, setRecordingState] = useSetAppDataByKey(APP_DATA.recordingStarted);
|
|
4368
4837
|
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming2();
|
|
4369
|
-
const hmsActions =
|
|
4838
|
+
const hmsActions = useHMSActions12();
|
|
4370
4839
|
if (!(permissions == null ? void 0 : permissions.browserRecording) || isHLSRunning) {
|
|
4371
4840
|
return null;
|
|
4372
4841
|
}
|
|
4373
4842
|
if (isBrowserRecordingOn) {
|
|
4374
|
-
return /* @__PURE__ */ React34.createElement(Popover2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React34.createElement(Popover2.Trigger, { asChild: true }, /* @__PURE__ */ React34.createElement(Button, { variant: "danger", "data-testid": "stop_recording", icon: true, outlined: true, onClick: () => setOpen(true) }, /* @__PURE__ */ React34.createElement(RecordIcon, null), /* @__PURE__ */ React34.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, "Stop Recording"))), /* @__PURE__ */ React34.createElement(Popover2.Portal, null, /* @__PURE__ */ React34.createElement(Popover2.Content, { align: "end", sideOffset: 8, css: { w: "$64" } }, /* @__PURE__ */ React34.createElement(Text, { variant: "
|
|
4843
|
+
return /* @__PURE__ */ React34.createElement(Popover2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React34.createElement(Popover2.Trigger, { asChild: true }, /* @__PURE__ */ React34.createElement(Button, { variant: "danger", "data-testid": "stop_recording", icon: true, outlined: true, onClick: () => setOpen(true) }, /* @__PURE__ */ React34.createElement(RecordIcon, null), /* @__PURE__ */ React34.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, "Stop Recording"))), /* @__PURE__ */ React34.createElement(Popover2.Portal, null, /* @__PURE__ */ React34.createElement(Popover2.Content, { align: "end", sideOffset: 8, css: { w: "$64" } }, /* @__PURE__ */ React34.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium" } }, "Are you sure you want to end the recording?"), /* @__PURE__ */ React34.createElement(
|
|
4375
4844
|
Button,
|
|
4376
4845
|
{
|
|
4377
4846
|
"data-testid": "stop_recording_confirm",
|
|
@@ -4382,8 +4851,9 @@ var StartRecording = () => {
|
|
|
4382
4851
|
try {
|
|
4383
4852
|
yield hmsActions.stopRTMPAndRecording();
|
|
4384
4853
|
} catch (error) {
|
|
4854
|
+
const err = error;
|
|
4385
4855
|
ToastManager.addToast({
|
|
4386
|
-
title:
|
|
4856
|
+
title: err.message,
|
|
4387
4857
|
variant: "error"
|
|
4388
4858
|
});
|
|
4389
4859
|
}
|
|
@@ -4407,14 +4877,15 @@ var StartRecording = () => {
|
|
|
4407
4877
|
record: true
|
|
4408
4878
|
});
|
|
4409
4879
|
} catch (error) {
|
|
4410
|
-
|
|
4880
|
+
const err = error;
|
|
4881
|
+
if (err.message.includes("stream already running")) {
|
|
4411
4882
|
ToastManager.addToast({
|
|
4412
4883
|
title: "Recording already running",
|
|
4413
4884
|
variant: "error"
|
|
4414
4885
|
});
|
|
4415
4886
|
} else {
|
|
4416
4887
|
ToastManager.addToast({
|
|
4417
|
-
title:
|
|
4888
|
+
title: err.message,
|
|
4418
4889
|
variant: "error"
|
|
4419
4890
|
});
|
|
4420
4891
|
}
|
|
@@ -4432,7 +4903,10 @@ var StreamActions = () => {
|
|
|
4432
4903
|
const roomState = useHMSStore15(selectRoomState4);
|
|
4433
4904
|
return /* @__PURE__ */ React34.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React34.createElement(AdditionalRoomState, null), !isMobile && /* @__PURE__ */ React34.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React34.createElement(RecordingStatus, null), roomState !== HMSRoomState4.Preview ? /* @__PURE__ */ React34.createElement(LiveStatus, null) : null), isConnected && !isMobile ? /* @__PURE__ */ React34.createElement(StartRecording, null) : null);
|
|
4434
4905
|
};
|
|
4435
|
-
var StopRecordingInSheet = ({
|
|
4906
|
+
var StopRecordingInSheet = ({
|
|
4907
|
+
onStopRecording,
|
|
4908
|
+
onClose
|
|
4909
|
+
}) => {
|
|
4436
4910
|
return /* @__PURE__ */ React34.createElement(Sheet.Root, { open: true }, /* @__PURE__ */ React34.createElement(Sheet.Content, null, /* @__PURE__ */ React34.createElement(Sheet.Title, { css: { p: "$10" } }, /* @__PURE__ */ React34.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%", c: "$alert_error_default" } }, /* @__PURE__ */ React34.createElement(Flex, { justify: "start", align: "center", gap: "3" }, /* @__PURE__ */ React34.createElement(AlertTriangleIcon, null), /* @__PURE__ */ React34.createElement(Text, { variant: "h5", css: { c: "$alert_error_default" } }, "Stop Recording")), /* @__PURE__ */ React34.createElement(Sheet.Close, { css: { color: "white" }, onClick: onClose }, /* @__PURE__ */ React34.createElement(CrossIcon4, null)))), /* @__PURE__ */ React34.createElement(HorizontalDivider, null), /* @__PURE__ */ React34.createElement(Box, { as: "div", css: { p: "$10", overflowY: "scroll", maxHeight: "70vh" } }, /* @__PURE__ */ React34.createElement(Text, { variant: "caption", css: { c: "$on_surface_medium", pb: "$8" } }, "Are you sure you want to stop recording? You can\u2019t undo this action."), /* @__PURE__ */ React34.createElement(
|
|
4437
4911
|
Button,
|
|
4438
4912
|
{
|
|
@@ -4454,21 +4928,24 @@ import {
|
|
|
4454
4928
|
selectLocalVideoTrackID,
|
|
4455
4929
|
selectVideoTrackByID,
|
|
4456
4930
|
useDevices,
|
|
4457
|
-
useHMSActions as
|
|
4931
|
+
useHMSActions as useHMSActions13,
|
|
4458
4932
|
useHMSStore as useHMSStore16
|
|
4459
4933
|
} from "@100mslive/react-sdk";
|
|
4460
4934
|
import { CameraFlipIcon, CheckIcon as CheckIcon2, CrossIcon as CrossIcon5, SpeakerIcon } from "@100mslive/react-icons";
|
|
4461
4935
|
var CamaraFlipActions = () => {
|
|
4462
|
-
const actions =
|
|
4936
|
+
const actions = useHMSActions13();
|
|
4463
4937
|
const { allDevices } = useDevices();
|
|
4464
4938
|
const { videoInput } = allDevices;
|
|
4465
4939
|
const isVideoOn = useHMSStore16(selectIsLocalVideoEnabled2);
|
|
4466
4940
|
const videoTrackId = useHMSStore16(selectLocalVideoTrackID);
|
|
4467
4941
|
const localVideoTrack = useHMSStore16(selectVideoTrackByID(videoTrackId));
|
|
4942
|
+
if (!videoInput || !(videoInput == null ? void 0 : videoInput.length) || !(localVideoTrack == null ? void 0 : localVideoTrack.facingMode)) {
|
|
4943
|
+
return null;
|
|
4944
|
+
}
|
|
4468
4945
|
return /* @__PURE__ */ React35.createElement(Box, null, /* @__PURE__ */ React35.createElement(
|
|
4469
4946
|
IconButton_default,
|
|
4470
4947
|
{
|
|
4471
|
-
disabled: !
|
|
4948
|
+
disabled: !isVideoOn,
|
|
4472
4949
|
onClick: () => __async(void 0, null, function* () {
|
|
4473
4950
|
try {
|
|
4474
4951
|
yield actions.switchCamera();
|
|
@@ -4529,6 +5006,7 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
|
4529
5006
|
return /* @__PURE__ */ React35.createElement(
|
|
4530
5007
|
SelectWithLabel,
|
|
4531
5008
|
{
|
|
5009
|
+
key: audioDevice.deviceId,
|
|
4532
5010
|
label: audioDevice.label,
|
|
4533
5011
|
id: audioDevice.deviceId,
|
|
4534
5012
|
checked: audioDevice.deviceId === outputSelected,
|
|
@@ -4595,57 +5073,12 @@ var Header2 = () => {
|
|
|
4595
5073
|
));
|
|
4596
5074
|
};
|
|
4597
5075
|
|
|
4598
|
-
// src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts
|
|
4599
|
-
function useRoomLayoutScreen({
|
|
4600
|
-
screen
|
|
4601
|
-
}) {
|
|
4602
|
-
var _a7;
|
|
4603
|
-
const roomLayout = useRoomLayout();
|
|
4604
|
-
const screenProps = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7[screen];
|
|
4605
|
-
return screenProps;
|
|
4606
|
-
}
|
|
4607
|
-
function useRoomLayoutPreviewScreen() {
|
|
4608
|
-
var _a7;
|
|
4609
|
-
const screenProps = useRoomLayoutScreen({ screen: "preview" });
|
|
4610
|
-
const isPreviewScreenEnabled = !!screenProps;
|
|
4611
|
-
let elements;
|
|
4612
|
-
let screenType;
|
|
4613
|
-
if (isPreviewScreenEnabled) {
|
|
4614
|
-
screenType = Object.keys(screenProps)[0];
|
|
4615
|
-
elements = (_a7 = screenProps[screenType]) == null ? void 0 : _a7.elements;
|
|
4616
|
-
}
|
|
4617
|
-
return {
|
|
4618
|
-
isPreviewScreenEnabled,
|
|
4619
|
-
elements,
|
|
4620
|
-
screenType
|
|
4621
|
-
};
|
|
4622
|
-
}
|
|
4623
|
-
function useRoomLayoutConferencingScreen() {
|
|
4624
|
-
var _a7, _b7;
|
|
4625
|
-
const screenProps = useRoomLayoutScreen({ screen: "conferencing" }) || {};
|
|
4626
|
-
const screenType = Object.keys(screenProps)[0];
|
|
4627
|
-
const elements = (_a7 = screenProps[screenType]) == null ? void 0 : _a7.elements;
|
|
4628
|
-
const hideSections = ((_b7 = screenProps[screenType]) == null ? void 0 : _b7.hideSections) || [];
|
|
4629
|
-
return {
|
|
4630
|
-
hideSections,
|
|
4631
|
-
elements,
|
|
4632
|
-
screenType
|
|
4633
|
-
};
|
|
4634
|
-
}
|
|
4635
|
-
function useRoomLayoutLeaveScreen() {
|
|
4636
|
-
const screenProps = useRoomLayoutScreen({ screen: "leave" });
|
|
4637
|
-
const isLeaveScreenEnabled = !!screenProps;
|
|
4638
|
-
return {
|
|
4639
|
-
isLeaveScreenEnabled
|
|
4640
|
-
};
|
|
4641
|
-
}
|
|
4642
|
-
|
|
4643
5076
|
// src/Prebuilt/components/PostLeave.jsx
|
|
4644
5077
|
var PostLeave = () => {
|
|
4645
|
-
const navigate =
|
|
5078
|
+
const navigate = useNavigate3();
|
|
4646
5079
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
|
4647
5080
|
const { roomCode } = useHMSPrebuiltContext();
|
|
4648
|
-
const { roomId, role } =
|
|
5081
|
+
const { roomId, role } = useParams3();
|
|
4649
5082
|
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
|
4650
5083
|
return /* @__PURE__ */ React37.createElement(Flex, { direction: "column", css: { size: "100%" } }, /* @__PURE__ */ React37.createElement(Box, { css: { h: "$18", "@md": { h: "$17" } }, "data-testid": "header" }, /* @__PURE__ */ React37.createElement(Header2, null)), /* @__PURE__ */ React37.createElement(
|
|
4651
5084
|
Flex,
|
|
@@ -4691,13 +5124,14 @@ var PostLeave = () => {
|
|
|
4691
5124
|
};
|
|
4692
5125
|
var PostLeave_default = PostLeave;
|
|
4693
5126
|
|
|
4694
|
-
// src/Prebuilt/components/Preview/PreviewContainer.
|
|
5127
|
+
// src/Prebuilt/components/Preview/PreviewContainer.tsx
|
|
4695
5128
|
import React56 from "react";
|
|
4696
|
-
import { useNavigate as
|
|
5129
|
+
import { useNavigate as useNavigate4, useParams as useParams4 } from "react-router-dom";
|
|
4697
5130
|
import { useSearchParam } from "react-use";
|
|
4698
5131
|
|
|
4699
|
-
// src/Prebuilt/components/Preview/PreviewJoin.
|
|
4700
|
-
import React55, { Fragment as Fragment6, Suspense, useCallback as
|
|
5132
|
+
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
|
5133
|
+
import React55, { Fragment as Fragment6, Suspense, useCallback as useCallback17, useEffect as useEffect23, useState as useState20 } from "react";
|
|
5134
|
+
import { useMedia as useMedia10 } from "react-use";
|
|
4701
5135
|
import {
|
|
4702
5136
|
HMSRoomState as HMSRoomState7,
|
|
4703
5137
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled5,
|
|
@@ -4705,7 +5139,7 @@ import {
|
|
|
4705
5139
|
selectRoomState as selectRoomState7,
|
|
4706
5140
|
selectVideoTrackByID as selectVideoTrackByID5,
|
|
4707
5141
|
useAVToggle as useAVToggle2,
|
|
4708
|
-
useHMSStore as
|
|
5142
|
+
useHMSStore as useHMSStore26,
|
|
4709
5143
|
useParticipants,
|
|
4710
5144
|
usePreviewJoin,
|
|
4711
5145
|
useRecordingStreaming as useRecordingStreaming4
|
|
@@ -4722,7 +5156,7 @@ import {
|
|
|
4722
5156
|
selectVideoTrackByID as selectVideoTrackByID2,
|
|
4723
5157
|
useAVToggle,
|
|
4724
5158
|
useDevices as useDevices2,
|
|
4725
|
-
useHMSActions as
|
|
5159
|
+
useHMSActions as useHMSActions14,
|
|
4726
5160
|
useHMSStore as useHMSStore18
|
|
4727
5161
|
} from "@100mslive/react-sdk";
|
|
4728
5162
|
import { CameraFlipIcon as CameraFlipIcon2, MicOffIcon, MicOnIcon as MicOnIcon3, VideoOffIcon, VideoOnIcon } from "@100mslive/react-icons";
|
|
@@ -4738,6 +5172,10 @@ var IconSection = styled(IconButton_default, {
|
|
|
4738
5172
|
borderTopRightRadius: 0,
|
|
4739
5173
|
borderColor: "$border_default",
|
|
4740
5174
|
borderBottomRightRadius: 0,
|
|
5175
|
+
position: "relative",
|
|
5176
|
+
"&:not([disabled]):focus-visible": {
|
|
5177
|
+
zIndex: 1
|
|
5178
|
+
},
|
|
4741
5179
|
"@md": {
|
|
4742
5180
|
mx: 0,
|
|
4743
5181
|
borderTopRightRadius: "$1",
|
|
@@ -4753,8 +5191,9 @@ var OptionsSection = styled(IconButton_default, {
|
|
|
4753
5191
|
borderColor: "$border_default",
|
|
4754
5192
|
borderBottomLeftRadius: 0,
|
|
4755
5193
|
borderLeftWidth: 0,
|
|
5194
|
+
position: "relative",
|
|
4756
5195
|
"&:not([disabled]):focus-visible": {
|
|
4757
|
-
|
|
5196
|
+
zIndex: 1
|
|
4758
5197
|
},
|
|
4759
5198
|
"@md": {
|
|
4760
5199
|
display: "none"
|
|
@@ -4857,16 +5296,17 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4857
5296
|
title: audioInput2.label
|
|
4858
5297
|
}));
|
|
4859
5298
|
const { isLocalVideoEnabled, isLocalAudioEnabled, toggleAudio, toggleVideo } = useAVToggle();
|
|
4860
|
-
const actions =
|
|
5299
|
+
const actions = useHMSActions14();
|
|
4861
5300
|
const videoTrackId = useHMSStore18(selectLocalVideoTrackID2);
|
|
4862
5301
|
const localVideoTrack = useHMSStore18(selectVideoTrackByID2(videoTrackId));
|
|
4863
5302
|
const roomState = useHMSStore18(selectRoomState6);
|
|
4864
|
-
const
|
|
4865
|
-
const
|
|
4866
|
-
return /* @__PURE__ */ React39.createElement(Fragment2, null, toggleAudio ? hideOptions ? /* @__PURE__ */ React39.createElement(Tooltip, { title: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)` }, /* @__PURE__ */ React39.createElement(
|
|
5303
|
+
const hasAudioDevices = (audioInput == null ? void 0 : audioInput.length) > 0;
|
|
5304
|
+
const hasVideoDevices = (videoInput == null ? void 0 : videoInput.length) > 0;
|
|
5305
|
+
return /* @__PURE__ */ React39.createElement(Fragment2, null, toggleAudio ? hideOptions || !hasAudioDevices ? /* @__PURE__ */ React39.createElement(Tooltip, { title: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)` }, /* @__PURE__ */ React39.createElement(
|
|
4867
5306
|
IconButton_default,
|
|
4868
5307
|
{
|
|
4869
5308
|
active: isLocalAudioEnabled,
|
|
5309
|
+
disabled: !toggleAudio,
|
|
4870
5310
|
onClick: toggleAudio,
|
|
4871
5311
|
key: "toggleAudio",
|
|
4872
5312
|
"data-testid": "audio_btn",
|
|
@@ -4877,7 +5317,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4877
5317
|
IconButtonWithOptions,
|
|
4878
5318
|
{
|
|
4879
5319
|
options: formattedAudioInputList,
|
|
4880
|
-
disabled: !
|
|
5320
|
+
disabled: !toggleAudio,
|
|
4881
5321
|
onDisabledClick: toggleAudio,
|
|
4882
5322
|
tooltipMessage: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)`,
|
|
4883
5323
|
icon: !isLocalAudioEnabled ? /* @__PURE__ */ React39.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React39.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" }),
|
|
@@ -4885,11 +5325,12 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4885
5325
|
onClick: toggleAudio,
|
|
4886
5326
|
key: "toggleAudio"
|
|
4887
5327
|
}
|
|
4888
|
-
) : null, toggleVideo ? hideOptions ? /* @__PURE__ */ React39.createElement(Tooltip, { title: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)` }, /* @__PURE__ */ React39.createElement(
|
|
5328
|
+
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */ React39.createElement(Tooltip, { title: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)` }, /* @__PURE__ */ React39.createElement(
|
|
4889
5329
|
IconButton_default,
|
|
4890
5330
|
{
|
|
4891
5331
|
key: "toggleVideo",
|
|
4892
5332
|
active: isLocalVideoEnabled,
|
|
5333
|
+
disabled: !toggleVideo,
|
|
4893
5334
|
onClick: toggleVideo,
|
|
4894
5335
|
"data-testid": "video_btn",
|
|
4895
5336
|
className: "__cancel-drag-event"
|
|
@@ -4898,7 +5339,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4898
5339
|
)) : /* @__PURE__ */ React39.createElement(
|
|
4899
5340
|
IconButtonWithOptions,
|
|
4900
5341
|
{
|
|
4901
|
-
disabled: !
|
|
5342
|
+
disabled: !toggleVideo,
|
|
4902
5343
|
onDisabledClick: toggleVideo,
|
|
4903
5344
|
options: formattedVideoInputList,
|
|
4904
5345
|
tooltipMessage: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)`,
|
|
@@ -4941,11 +5382,11 @@ var Chip = ({
|
|
|
4941
5382
|
};
|
|
4942
5383
|
var Chip_default = Chip;
|
|
4943
5384
|
|
|
4944
|
-
// src/Prebuilt/components/Connection/TileConnection.
|
|
5385
|
+
// src/Prebuilt/components/Connection/TileConnection.tsx
|
|
4945
5386
|
import React42 from "react";
|
|
4946
5387
|
import { PinIcon, SpotlightIcon } from "@100mslive/react-icons";
|
|
4947
5388
|
|
|
4948
|
-
// src/Prebuilt/components/Connection/ConnectionIndicator.
|
|
5389
|
+
// src/Prebuilt/components/Connection/ConnectionIndicator.tsx
|
|
4949
5390
|
import React41 from "react";
|
|
4950
5391
|
import { selectConnectionQualityByPeerID as selectConnectionQualityByPeerID2, useHMSStore as useHMSStore19 } from "@100mslive/react-sdk";
|
|
4951
5392
|
import { PoorConnectivityIcon as PoorConnectivityIcon2 } from "@100mslive/react-icons";
|
|
@@ -4978,14 +5419,13 @@ var getColor = (position, connectionScore, defaultColor, theme2) => {
|
|
|
4978
5419
|
return defaultColor;
|
|
4979
5420
|
};
|
|
4980
5421
|
|
|
4981
|
-
// src/Prebuilt/components/Connection/ConnectionIndicator.
|
|
5422
|
+
// src/Prebuilt/components/Connection/ConnectionIndicator.tsx
|
|
4982
5423
|
var Wrapper = styled("span", {
|
|
4983
5424
|
width: "28px",
|
|
4984
5425
|
height: "28px",
|
|
4985
5426
|
display: "flex",
|
|
4986
5427
|
alignItems: "center",
|
|
4987
5428
|
justifyContent: "center",
|
|
4988
|
-
backgroundColor: "$background_dim",
|
|
4989
5429
|
borderRadius: "$round",
|
|
4990
5430
|
variants: {
|
|
4991
5431
|
isTile: {
|
|
@@ -4996,7 +5436,11 @@ var Wrapper = styled("span", {
|
|
|
4996
5436
|
}
|
|
4997
5437
|
}
|
|
4998
5438
|
});
|
|
4999
|
-
var ConnectionIndicator = ({
|
|
5439
|
+
var ConnectionIndicator = ({
|
|
5440
|
+
peerId,
|
|
5441
|
+
isTile = false,
|
|
5442
|
+
hideBg = false
|
|
5443
|
+
}) => {
|
|
5000
5444
|
var _a7;
|
|
5001
5445
|
const downlinkQuality = (_a7 = useHMSStore19(selectConnectionQualityByPeerID2(peerId))) == null ? void 0 : _a7.downlinkQuality;
|
|
5002
5446
|
const { theme: theme2 } = useTheme();
|
|
@@ -5008,7 +5452,7 @@ var ConnectionIndicator = ({ peerId, isTile = false }) => {
|
|
|
5008
5452
|
return /* @__PURE__ */ React41.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React41.createElement(Wrapper, { isTile, css: { color: "#ED4C5A" }, "data-testid": "tile_network" }, /* @__PURE__ */ React41.createElement(PoorConnectivityIcon2, null)));
|
|
5009
5453
|
}
|
|
5010
5454
|
const size = isTile ? 12 : 16;
|
|
5011
|
-
return /* @__PURE__ */ React41.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React41.createElement(Wrapper, { isTile, "data-testid": "tile_network" }, /* @__PURE__ */ React41.createElement(
|
|
5455
|
+
return /* @__PURE__ */ React41.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React41.createElement(Wrapper, { isTile, "data-testid": "tile_network", css: { backgroundColor: hideBg ? "" : "$surface_bright" } }, /* @__PURE__ */ React41.createElement(
|
|
5012
5456
|
"svg",
|
|
5013
5457
|
{
|
|
5014
5458
|
width: size,
|
|
@@ -5056,19 +5500,26 @@ var ConnectionIndicator = ({ peerId, isTile = false }) => {
|
|
|
5056
5500
|
)));
|
|
5057
5501
|
};
|
|
5058
5502
|
|
|
5059
|
-
// src/Prebuilt/components/Connection/TileConnection.
|
|
5060
|
-
var TileConnection = ({
|
|
5061
|
-
|
|
5503
|
+
// src/Prebuilt/components/Connection/TileConnection.tsx
|
|
5504
|
+
var TileConnection = ({
|
|
5505
|
+
name,
|
|
5506
|
+
peerId,
|
|
5507
|
+
hideLabel,
|
|
5508
|
+
width,
|
|
5509
|
+
spotlighted,
|
|
5510
|
+
pinned
|
|
5511
|
+
}) => {
|
|
5512
|
+
return /* @__PURE__ */ React42.createElement(Wrapper2, null, !hideLabel ? /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(Flex, { align: "center" }, pinned && /* @__PURE__ */ React42.createElement(IconWrapper, null, /* @__PURE__ */ React42.createElement(PinIcon, { width: "15", height: "15" })), spotlighted && /* @__PURE__ */ React42.createElement(IconWrapper, null, /* @__PURE__ */ React42.createElement(SpotlightIcon, { width: "15", height: "15" })), /* @__PURE__ */ React42.createElement(
|
|
5062
5513
|
Text,
|
|
5063
5514
|
{
|
|
5064
5515
|
css: __spreadValues({
|
|
5065
5516
|
c: "$on_surface_high",
|
|
5066
5517
|
verticalAlign: "baseline"
|
|
5067
|
-
}, textEllipsis(width - 60)),
|
|
5518
|
+
}, width ? textEllipsis(width - 60) : {}),
|
|
5068
5519
|
variant: "xs"
|
|
5069
5520
|
},
|
|
5070
5521
|
name
|
|
5071
|
-
)), /* @__PURE__ */ React42.createElement(ConnectionIndicator, { isTile: true, peerId })) : null);
|
|
5522
|
+
)), /* @__PURE__ */ React42.createElement(ConnectionIndicator, { isTile: true, peerId, hideBg: true })) : null);
|
|
5072
5523
|
};
|
|
5073
5524
|
var IconWrapper = styled("div", { c: "$on_surface_high", ml: "$3", mt: "$1" });
|
|
5074
5525
|
var Wrapper2 = styled("div", {
|
|
@@ -5088,7 +5539,7 @@ var Wrapper2 = styled("div", {
|
|
|
5088
5539
|
var TileConnection_default = TileConnection;
|
|
5089
5540
|
|
|
5090
5541
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
|
5091
|
-
import React48, { useCallback as
|
|
5542
|
+
import React48, { useCallback as useCallback15, useEffect as useEffect20, useState as useState16 } from "react";
|
|
5092
5543
|
import { useMedia as useMedia5 } from "react-use";
|
|
5093
5544
|
import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons";
|
|
5094
5545
|
|
|
@@ -5096,7 +5547,7 @@ import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons
|
|
|
5096
5547
|
import { GridFourIcon, NotificationsIcon, SettingsIcon } from "@100mslive/react-icons";
|
|
5097
5548
|
|
|
5098
5549
|
// src/Prebuilt/components/Settings/DeviceSettings.jsx
|
|
5099
|
-
import React44, { Fragment as Fragment3, useEffect as
|
|
5550
|
+
import React44, { Fragment as Fragment3, useEffect as useEffect19, useRef as useRef6, useState as useState15 } from "react";
|
|
5100
5551
|
import {
|
|
5101
5552
|
DeviceType as DeviceType3,
|
|
5102
5553
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled3,
|
|
@@ -5285,7 +5736,7 @@ var TEST_AUDIO_URL = "https://100ms.live/test-audio.wav";
|
|
|
5285
5736
|
var TestAudio = ({ id }) => {
|
|
5286
5737
|
const audioRef = useRef6(null);
|
|
5287
5738
|
const [playing, setPlaying] = useState15(false);
|
|
5288
|
-
|
|
5739
|
+
useEffect19(() => {
|
|
5289
5740
|
if (audioRef.current && id) {
|
|
5290
5741
|
try {
|
|
5291
5742
|
if (typeof audioRef.current.setSinkId !== "undefined") {
|
|
@@ -5322,8 +5773,8 @@ var TestAudio = ({ id }) => {
|
|
|
5322
5773
|
var DeviceSettings_default = Settings;
|
|
5323
5774
|
|
|
5324
5775
|
// src/Prebuilt/components/Settings/LayoutSettings.jsx
|
|
5325
|
-
import React46, { useCallback as
|
|
5326
|
-
import { selectIsLocalScreenShared, selectIsLocalVideoEnabled as selectIsLocalVideoEnabled4, useHMSActions as
|
|
5776
|
+
import React46, { useCallback as useCallback14 } from "react";
|
|
5777
|
+
import { selectIsLocalScreenShared, selectIsLocalVideoEnabled as selectIsLocalVideoEnabled4, useHMSActions as useHMSActions15, useHMSStore as useHMSStore21 } from "@100mslive/react-sdk";
|
|
5327
5778
|
|
|
5328
5779
|
// src/Prebuilt/components/Settings/SwitchWithLabel.jsx
|
|
5329
5780
|
import React45 from "react";
|
|
@@ -5365,11 +5816,11 @@ var SwitchWithLabel_default = SwitchWithLabel;
|
|
|
5365
5816
|
|
|
5366
5817
|
// src/Prebuilt/components/Settings/LayoutSettings.jsx
|
|
5367
5818
|
var LayoutSettings = () => {
|
|
5368
|
-
const hmsActions =
|
|
5819
|
+
const hmsActions = useHMSActions15();
|
|
5369
5820
|
const isLocalVideoEnabled = useHMSStore21(selectIsLocalVideoEnabled4);
|
|
5370
5821
|
const isLocalScreenShared = useHMSStore21(selectIsLocalScreenShared);
|
|
5371
5822
|
const [{ isAudioOnly, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings();
|
|
5372
|
-
const toggleIsAudioOnly =
|
|
5823
|
+
const toggleIsAudioOnly = useCallback14(
|
|
5373
5824
|
(isAudioOnlyModeOn) => __async(void 0, null, function* () {
|
|
5374
5825
|
if (isAudioOnlyModeOn) {
|
|
5375
5826
|
isLocalVideoEnabled && (yield hmsActions.setLocalVideoEnabled(false));
|
|
@@ -5503,11 +5954,11 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
|
5503
5954
|
const [showSetting, setShowSetting] = useState16(
|
|
5504
5955
|
() => settingsList.reduce((obj, { tabName }) => __spreadProps(__spreadValues({}, obj), { [tabName]: true }), {})
|
|
5505
5956
|
);
|
|
5506
|
-
const hideSettingByTabName =
|
|
5957
|
+
const hideSettingByTabName = useCallback15(
|
|
5507
5958
|
(key) => (hide) => setShowSetting((prev) => __spreadProps(__spreadValues({}, prev), { [key]: !hide })),
|
|
5508
5959
|
[setShowSetting]
|
|
5509
5960
|
);
|
|
5510
|
-
|
|
5961
|
+
useEffect20(() => {
|
|
5511
5962
|
if (screenType === "hls_live_streaming") {
|
|
5512
5963
|
hideSettingByTabName("layout")(true);
|
|
5513
5964
|
}
|
|
@@ -5516,10 +5967,10 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
|
5516
5967
|
var _a7;
|
|
5517
5968
|
return (_a7 = Object.keys(showSetting).find((key) => showSetting[key])) != null ? _a7 : "";
|
|
5518
5969
|
});
|
|
5519
|
-
const resetSelection =
|
|
5970
|
+
const resetSelection = useCallback15(() => {
|
|
5520
5971
|
setSelection("");
|
|
5521
5972
|
}, []);
|
|
5522
|
-
|
|
5973
|
+
useEffect20(() => {
|
|
5523
5974
|
var _a7;
|
|
5524
5975
|
if (isMobile) {
|
|
5525
5976
|
setSelection("");
|
|
@@ -5700,8 +6151,7 @@ var SettingsContentHeader = ({ children, isMobile, onBack }) => {
|
|
|
5700
6151
|
var SettingsModal_default = SettingsModal;
|
|
5701
6152
|
|
|
5702
6153
|
// src/Prebuilt/components/VideoTile.jsx
|
|
5703
|
-
import React53, { Fragment as Fragment5, useCallback as
|
|
5704
|
-
import { useMedia as useMedia8 } from "react-use";
|
|
6154
|
+
import React53, { Fragment as Fragment5, useCallback as useCallback16, useEffect as useEffect22, useMemo as useMemo3, useRef as useRef7, useState as useState19 } from "react";
|
|
5705
6155
|
import {
|
|
5706
6156
|
selectAudioTrackByPeerID as selectAudioTrackByPeerID2,
|
|
5707
6157
|
selectIsPeerAudioEnabled,
|
|
@@ -5713,13 +6163,13 @@ import {
|
|
|
5713
6163
|
selectVideoTrackByID as selectVideoTrackByID4,
|
|
5714
6164
|
selectVideoTrackByPeerID as selectVideoTrackByPeerID3,
|
|
5715
6165
|
useHMSStore as useHMSStore25,
|
|
5716
|
-
useHMSVanillaStore as
|
|
6166
|
+
useHMSVanillaStore as useHMSVanillaStore5
|
|
5717
6167
|
} from "@100mslive/react-sdk";
|
|
5718
6168
|
import { BrbTileIcon, HandIcon as HandIcon3, MicOffIcon as MicOffIcon3 } from "@100mslive/react-icons";
|
|
5719
6169
|
|
|
5720
6170
|
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
|
5721
6171
|
import React52, { useState as useState18 } from "react";
|
|
5722
|
-
import { useMedia as
|
|
6172
|
+
import { useMedia as useMedia8 } from "react-use";
|
|
5723
6173
|
import {
|
|
5724
6174
|
selectLocalPeerID as selectLocalPeerID4,
|
|
5725
6175
|
selectPeerByID as selectPeerByID2,
|
|
@@ -5734,7 +6184,7 @@ import { CrossIcon as CrossIcon8, VerticalMenuIcon as VerticalMenuIcon2 } from "
|
|
|
5734
6184
|
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
|
5735
6185
|
import React50, { useState as useState17 } from "react";
|
|
5736
6186
|
import { useMedia as useMedia6 } from "react-use";
|
|
5737
|
-
import { selectLocalPeerName, useHMSActions as
|
|
6187
|
+
import { selectLocalPeerName, useHMSActions as useHMSActions16, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
|
5738
6188
|
|
|
5739
6189
|
// src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx
|
|
5740
6190
|
import React49 from "react";
|
|
@@ -5764,6 +6214,7 @@ var ChangeNameContent = ({
|
|
|
5764
6214
|
color: "$on_surface_high",
|
|
5765
6215
|
fontWeight: "$semiBold",
|
|
5766
6216
|
display: "flex",
|
|
6217
|
+
pb: "$4",
|
|
5767
6218
|
"@md": { px: "$8", borderBottom: "1px solid $border_default" }
|
|
5768
6219
|
}
|
|
5769
6220
|
},
|
|
@@ -5794,6 +6245,9 @@ var ChangeNameContent = ({
|
|
|
5794
6245
|
onKeyDown: (e) => __async(void 0, null, function* () {
|
|
5795
6246
|
if (e.key === "Enter" && currentName.trim().length > 0 && currentName !== localPeerName) {
|
|
5796
6247
|
e.preventDefault();
|
|
6248
|
+
if (isMobile) {
|
|
6249
|
+
return;
|
|
6250
|
+
}
|
|
5797
6251
|
changeName();
|
|
5798
6252
|
}
|
|
5799
6253
|
})
|
|
@@ -5841,7 +6295,7 @@ var ChangeNameContent = ({
|
|
|
5841
6295
|
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
|
5842
6296
|
var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
|
5843
6297
|
const [previewPreference, setPreviewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW);
|
|
5844
|
-
const hmsActions =
|
|
6298
|
+
const hmsActions = useHMSActions16();
|
|
5845
6299
|
const localPeerName = useHMSStore22(selectLocalPeerName);
|
|
5846
6300
|
const [currentName, setCurrentName] = useState17(localPeerName);
|
|
5847
6301
|
const isMobile = useMedia6(config.media.md);
|
|
@@ -5882,12 +6336,13 @@ var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
|
|
5882
6336
|
|
|
5883
6337
|
// src/Prebuilt/components/TileMenu/TileMenuContent.jsx
|
|
5884
6338
|
import React51, { Fragment as Fragment4 } from "react";
|
|
6339
|
+
import { useMedia as useMedia7 } from "react-use";
|
|
5885
6340
|
import {
|
|
5886
6341
|
selectPermissions as selectPermissions2,
|
|
5887
6342
|
selectSessionStore as selectSessionStore2,
|
|
5888
6343
|
selectTrackByID as selectTrackByID2,
|
|
5889
|
-
useCustomEvent,
|
|
5890
|
-
useHMSActions as
|
|
6344
|
+
useCustomEvent as useCustomEvent2,
|
|
6345
|
+
useHMSActions as useHMSActions17,
|
|
5891
6346
|
useHMSStore as useHMSStore23,
|
|
5892
6347
|
useRemoteAVToggle
|
|
5893
6348
|
} from "@100mslive/react-sdk";
|
|
@@ -5912,7 +6367,7 @@ var SpotlightActions = ({
|
|
|
5912
6367
|
return;
|
|
5913
6368
|
}
|
|
5914
6369
|
}) => {
|
|
5915
|
-
const hmsActions =
|
|
6370
|
+
const hmsActions = useHMSActions17();
|
|
5916
6371
|
const spotlightPeerId = useHMSStore23(selectSessionStore2(SESSION_STORE_KEY.SPOTLIGHT));
|
|
5917
6372
|
const isTileSpotlighted = spotlightPeerId === peerId;
|
|
5918
6373
|
const setSpotlightPeerId = (peer) => hmsActions.sessionStore.set(SESSION_STORE_KEY.SPOTLIGHT, peer).catch((err) => ToastManager.addToast({ title: err.description }));
|
|
@@ -5929,7 +6384,7 @@ var SpotlightActions = ({
|
|
|
5929
6384
|
onSpotLightClick();
|
|
5930
6385
|
}
|
|
5931
6386
|
},
|
|
5932
|
-
/* @__PURE__ */ React51.createElement(StarIcon,
|
|
6387
|
+
/* @__PURE__ */ React51.createElement(StarIcon, { height: 20, width: 20 }),
|
|
5933
6388
|
/* @__PURE__ */ React51.createElement("span", null, isTileSpotlighted ? "Remove from Spotlight" : "Spotlight Tile for everyone")
|
|
5934
6389
|
);
|
|
5935
6390
|
};
|
|
@@ -5946,18 +6401,18 @@ var PinActions = ({ audioTrackID, videoTrackID }) => {
|
|
|
5946
6401
|
css: spacingCSS,
|
|
5947
6402
|
onClick: () => isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID)
|
|
5948
6403
|
},
|
|
5949
|
-
/* @__PURE__ */ React51.createElement(PinIcon2,
|
|
6404
|
+
/* @__PURE__ */ React51.createElement(PinIcon2, { height: 20, width: 20 }),
|
|
5950
6405
|
/* @__PURE__ */ React51.createElement("span", null, isTilePinned ? "Unpin" : "Pin", " Tile for myself")
|
|
5951
6406
|
));
|
|
5952
6407
|
};
|
|
5953
6408
|
var MinimiseInset = () => {
|
|
5954
6409
|
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
|
5955
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: spacingCSS, onClick: () => setMinimised(!minimised) }, /* @__PURE__ */ React51.createElement(ShrinkIcon,
|
|
6410
|
+
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: spacingCSS, onClick: () => setMinimised(!minimised) }, /* @__PURE__ */ React51.createElement(ShrinkIcon, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement("span", null, minimised ? "Show" : "Minimise", " your video")));
|
|
5956
6411
|
};
|
|
5957
6412
|
var SimulcastLayers = ({ trackId }) => {
|
|
5958
6413
|
var _a7;
|
|
5959
6414
|
const track = useHMSStore23(selectTrackByID2(trackId));
|
|
5960
|
-
const actions =
|
|
6415
|
+
const actions = useHMSActions17();
|
|
5961
6416
|
const bg = useDropdownSelection();
|
|
5962
6417
|
if (!((_a7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _a7.length) || track.degraded || !track.enabled) {
|
|
5963
6418
|
return null;
|
|
@@ -6022,7 +6477,7 @@ var SimulcastLayers = ({ trackId }) => {
|
|
|
6022
6477
|
))));
|
|
6023
6478
|
};
|
|
6024
6479
|
var TileMenuContent = (props) => {
|
|
6025
|
-
const actions =
|
|
6480
|
+
const actions = useHMSActions17();
|
|
6026
6481
|
const { removeOthers } = useHMSStore23(selectPermissions2);
|
|
6027
6482
|
const {
|
|
6028
6483
|
videoTrackID,
|
|
@@ -6044,9 +6499,10 @@ var TileMenuContent = (props) => {
|
|
|
6044
6499
|
audioTrackID,
|
|
6045
6500
|
videoTrackID
|
|
6046
6501
|
);
|
|
6047
|
-
const { sendEvent } =
|
|
6502
|
+
const { sendEvent } = useCustomEvent2({
|
|
6048
6503
|
type: REMOTE_STOP_SCREENSHARE_TYPE
|
|
6049
6504
|
});
|
|
6505
|
+
const isMobile = useMedia7(config.media.md);
|
|
6050
6506
|
return isLocal ? (showPinAction || canMinimise) && /* @__PURE__ */ React51.createElement(React51.Fragment, null, showPinAction && /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() }), canMinimise && /* @__PURE__ */ React51.createElement(MinimiseInset, null), /* @__PURE__ */ React51.createElement(
|
|
6051
6507
|
StyledMenuTile.ItemButton,
|
|
6052
6508
|
{
|
|
@@ -6055,7 +6511,7 @@ var TileMenuContent = (props) => {
|
|
|
6055
6511
|
closeSheetOnClick();
|
|
6056
6512
|
}
|
|
6057
6513
|
},
|
|
6058
|
-
/* @__PURE__ */ React51.createElement(PencilIcon,
|
|
6514
|
+
/* @__PURE__ */ React51.createElement(PencilIcon, { height: 20, width: 20 }),
|
|
6059
6515
|
/* @__PURE__ */ React51.createElement(Text, { variant: "sm", css: { "@md": { fontWeight: "$semiBold" }, c: "$on_surface_high" } }, "Change Name")
|
|
6060
6516
|
)) : /* @__PURE__ */ React51.createElement(React51.Fragment, null, toggleVideo ? /* @__PURE__ */ React51.createElement(
|
|
6061
6517
|
StyledMenuTile.ItemButton,
|
|
@@ -6067,7 +6523,7 @@ var TileMenuContent = (props) => {
|
|
|
6067
6523
|
},
|
|
6068
6524
|
"data-testid": isVideoEnabled ? "mute_video_participant_btn" : "unmute_video_participant_btn"
|
|
6069
6525
|
},
|
|
6070
|
-
isVideoEnabled ? /* @__PURE__ */ React51.createElement(VideoOnIcon3,
|
|
6526
|
+
isVideoEnabled ? /* @__PURE__ */ React51.createElement(VideoOnIcon3, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(VideoOffIcon2, { height: 20, width: 20 }),
|
|
6071
6527
|
/* @__PURE__ */ React51.createElement("span", null, isVideoEnabled ? "Mute" : "Request Unmute")
|
|
6072
6528
|
) : null, toggleAudio ? /* @__PURE__ */ React51.createElement(
|
|
6073
6529
|
StyledMenuTile.ItemButton,
|
|
@@ -6079,9 +6535,9 @@ var TileMenuContent = (props) => {
|
|
|
6079
6535
|
},
|
|
6080
6536
|
"data-testid": isVideoEnabled ? "mute_audio_participant_btn" : "unmute_audio_participant_btn"
|
|
6081
6537
|
},
|
|
6082
|
-
isAudioEnabled ? /* @__PURE__ */ React51.createElement(MicOnIcon5,
|
|
6538
|
+
isAudioEnabled ? /* @__PURE__ */ React51.createElement(MicOnIcon5, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(MicOffIcon2, { height: 20, width: 20 }),
|
|
6083
6539
|
/* @__PURE__ */ React51.createElement("span", null, isAudioEnabled ? "Mute" : "Request Unmute")
|
|
6084
|
-
) : null, audioTrackID ? /* @__PURE__ */ React51.createElement(StyledMenuTile.VolumeItem, { "data-testid": "participant_volume_slider", css: __spreadProps(__spreadValues({}, spacingCSS), { mb: "$0" }) }, /* @__PURE__ */ React51.createElement(Flex, { align: "center", gap: 1 }, /* @__PURE__ */ React51.createElement(SpeakerIcon3,
|
|
6540
|
+
) : null, audioTrackID ? /* @__PURE__ */ React51.createElement(StyledMenuTile.VolumeItem, { "data-testid": "participant_volume_slider", css: __spreadProps(__spreadValues({}, spacingCSS), { mb: "$0" }) }, /* @__PURE__ */ React51.createElement(Flex, { align: "center", gap: 1 }, /* @__PURE__ */ React51.createElement(SpeakerIcon3, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement(Box, { as: "span", css: { ml: "$4" } }, "Volume (", volume, ")")), /* @__PURE__ */ React51.createElement(Slider, { css: { my: "0.5rem" }, step: 5, value: [volume], onValueChange: (e) => setVolume(e[0]) })) : null, showPinAction && /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() })), isMobile ? null : /* @__PURE__ */ React51.createElement(SimulcastLayers, { trackId: videoTrackID }), removeOthers ? /* @__PURE__ */ React51.createElement(
|
|
6085
6541
|
StyledMenuTile.RemoveItem,
|
|
6086
6542
|
{
|
|
6087
6543
|
css: __spreadProps(__spreadValues({}, spacingCSS), { borderTop: "none" }),
|
|
@@ -6094,7 +6550,7 @@ var TileMenuContent = (props) => {
|
|
|
6094
6550
|
}),
|
|
6095
6551
|
"data-testid": "remove_participant_btn"
|
|
6096
6552
|
},
|
|
6097
|
-
/* @__PURE__ */ React51.createElement(RemoveUserIcon,
|
|
6553
|
+
/* @__PURE__ */ React51.createElement(RemoveUserIcon, { height: 20, width: 20 }),
|
|
6098
6554
|
/* @__PURE__ */ React51.createElement("span", null, "Remove Participant")
|
|
6099
6555
|
) : null, removeOthers && isScreenshare ? /* @__PURE__ */ React51.createElement(
|
|
6100
6556
|
StyledMenuTile.RemoveItem,
|
|
@@ -6105,16 +6561,16 @@ var TileMenuContent = (props) => {
|
|
|
6105
6561
|
},
|
|
6106
6562
|
css: spacingCSS
|
|
6107
6563
|
},
|
|
6108
|
-
/* @__PURE__ */ React51.createElement(ShareScreenIcon2,
|
|
6564
|
+
/* @__PURE__ */ React51.createElement(ShareScreenIcon2, { height: 20, width: 20 }),
|
|
6109
6565
|
/* @__PURE__ */ React51.createElement("span", null, "Stop Screenshare")
|
|
6110
6566
|
) : null);
|
|
6111
6567
|
};
|
|
6112
6568
|
|
|
6113
6569
|
// src/Prebuilt/components/hooks/useDropdownList.jsx
|
|
6114
|
-
import { useEffect as
|
|
6570
|
+
import { useEffect as useEffect21 } from "react";
|
|
6115
6571
|
var useDropdownList = ({ name, open }) => {
|
|
6116
6572
|
const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);
|
|
6117
|
-
|
|
6573
|
+
useEffect21(() => {
|
|
6118
6574
|
if (open) {
|
|
6119
6575
|
if (!dropdownList.includes(name)) {
|
|
6120
6576
|
setDropdownList([...dropdownList, name]);
|
|
@@ -6151,7 +6607,7 @@ var TileMenu = ({
|
|
|
6151
6607
|
const showPinAction = audioTrackID || videoTrackID && isPrimaryVideoTrack;
|
|
6152
6608
|
const track = useHMSStore24(selectTrackByID3(videoTrackID));
|
|
6153
6609
|
const hideSimulcastLayers = !((_b7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _b7.length) || track.degraded || !track.enabled;
|
|
6154
|
-
const isMobile =
|
|
6610
|
+
const isMobile = useMedia8(config.media.md);
|
|
6155
6611
|
const peer = useHMSStore24(selectPeerByID2(peerID));
|
|
6156
6612
|
const [showNameChangeModal, setShowNameChangeModal] = useState18(false);
|
|
6157
6613
|
useDropdownList({ open, name: "TileMenu" });
|
|
@@ -6175,7 +6631,7 @@ var TileMenu = ({
|
|
|
6175
6631
|
StyledMenuTile.Trigger,
|
|
6176
6632
|
{
|
|
6177
6633
|
"data-testid": "participant_menu_btn",
|
|
6178
|
-
css: { bg: `${theme2.colors.background_dim.value}A3
|
|
6634
|
+
css: { bg: `${theme2.colors.background_dim.value}A3`, p: "$2", w: "unset", h: "unset" },
|
|
6179
6635
|
onClick: (e) => e.stopPropagation(),
|
|
6180
6636
|
className: isMobile ? "__cancel-drag-event" : ""
|
|
6181
6637
|
},
|
|
@@ -6239,7 +6695,8 @@ var Tile = ({
|
|
|
6239
6695
|
enableSpotlightingPeer = true,
|
|
6240
6696
|
hideParticipantNameOnTile = false,
|
|
6241
6697
|
roundedVideoTile = true,
|
|
6242
|
-
hideAudioMuteOnTile = false
|
|
6698
|
+
hideAudioMuteOnTile = false,
|
|
6699
|
+
hideMetadataOnTile = false
|
|
6243
6700
|
}) => {
|
|
6244
6701
|
const trackSelector = trackId ? selectVideoTrackByID4(trackId) : selectVideoTrackByPeerID3(peerId);
|
|
6245
6702
|
const track = useHMSStore25(trackSelector);
|
|
@@ -6266,7 +6723,7 @@ var Tile = ({
|
|
|
6266
6723
|
track,
|
|
6267
6724
|
isLocal
|
|
6268
6725
|
});
|
|
6269
|
-
const onHoverHandler =
|
|
6726
|
+
const onHoverHandler = useCallback16((event) => {
|
|
6270
6727
|
setIsMouseHovered(event.type === "mouseenter");
|
|
6271
6728
|
}, []);
|
|
6272
6729
|
const isTileBigEnoughToShowStats = height >= 180 && width >= 180;
|
|
@@ -6281,7 +6738,6 @@ var Tile = ({
|
|
|
6281
6738
|
}
|
|
6282
6739
|
return "large";
|
|
6283
6740
|
}, [width, height]);
|
|
6284
|
-
const isMobile = useMedia8(config.media.md);
|
|
6285
6741
|
return /* @__PURE__ */ React53.createElement(
|
|
6286
6742
|
StyledVideoTile.Root,
|
|
6287
6743
|
{
|
|
@@ -6300,7 +6756,7 @@ var Tile = ({
|
|
|
6300
6756
|
css: containerCSS
|
|
6301
6757
|
},
|
|
6302
6758
|
showStatsOnTiles && isTileBigEnoughToShowStats ? /* @__PURE__ */ React53.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
|
6303
|
-
|
|
6759
|
+
/* @__PURE__ */ React53.createElement(
|
|
6304
6760
|
Video,
|
|
6305
6761
|
{
|
|
6306
6762
|
trackId: track == null ? void 0 : track.id,
|
|
@@ -6314,19 +6770,16 @@ var Tile = ({
|
|
|
6314
6770
|
bg: "transparent"
|
|
6315
6771
|
}
|
|
6316
6772
|
}
|
|
6317
|
-
)
|
|
6773
|
+
),
|
|
6318
6774
|
isVideoMuted || !isLocal && isAudioOnly ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React53.createElement(Avatar, { name: peerName || "", "data-testid": "participant_avatar_icon", size: avatarSize })) : null,
|
|
6319
|
-
|
|
6320
|
-
hideAudioMute: hideAudioMuteOnTile,
|
|
6321
|
-
isAudioMuted
|
|
6322
|
-
}) ? /* @__PURE__ */ React53.createElement(
|
|
6775
|
+
!hideAudioMuteOnTile ? isAudioMuted ? /* @__PURE__ */ React53.createElement(
|
|
6323
6776
|
StyledVideoTile.AudioIndicator,
|
|
6324
6777
|
{
|
|
6325
6778
|
"data-testid": "participant_audio_mute_icon",
|
|
6326
6779
|
size: width && height && (width < 180 || height < 180) ? "small" : "medium"
|
|
6327
6780
|
},
|
|
6328
6781
|
/* @__PURE__ */ React53.createElement(MicOffIcon3, null)
|
|
6329
|
-
) : /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id }),
|
|
6782
|
+
) : /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id }) : null,
|
|
6330
6783
|
isMouseHovered || isDragabble ? /* @__PURE__ */ React53.createElement(
|
|
6331
6784
|
TileMenu_default,
|
|
6332
6785
|
{
|
|
@@ -6337,8 +6790,8 @@ var Tile = ({
|
|
|
6337
6790
|
enableSpotlightingPeer
|
|
6338
6791
|
}
|
|
6339
6792
|
) : null,
|
|
6340
|
-
/* @__PURE__ */ React53.createElement(PeerMetadata, { peerId }),
|
|
6341
|
-
|
|
6793
|
+
!hideMetadataOnTile && /* @__PURE__ */ React53.createElement(PeerMetadata, { peerId }),
|
|
6794
|
+
/* @__PURE__ */ React53.createElement(
|
|
6342
6795
|
TileConnection_default,
|
|
6343
6796
|
{
|
|
6344
6797
|
hideLabel: hideParticipantNameOnTile,
|
|
@@ -6353,7 +6806,7 @@ var Tile = ({
|
|
|
6353
6806
|
) : null
|
|
6354
6807
|
);
|
|
6355
6808
|
};
|
|
6356
|
-
var metaStyles = { top: "$4", left: "$4" };
|
|
6809
|
+
var metaStyles = { top: "$4", left: "$4", width: "$14", height: "$14" };
|
|
6357
6810
|
var heightAnimation = (value) => keyframes({
|
|
6358
6811
|
"50%": {
|
|
6359
6812
|
transform: `scale3d(1,${value},1)`
|
|
@@ -6363,9 +6816,9 @@ var heightAnimation = (value) => keyframes({
|
|
|
6363
6816
|
}
|
|
6364
6817
|
});
|
|
6365
6818
|
var AudioLevelIndicator = ({ trackId, value, delay }) => {
|
|
6366
|
-
const vanillaStore =
|
|
6819
|
+
const vanillaStore = useHMSVanillaStore5();
|
|
6367
6820
|
const ref = useRef7();
|
|
6368
|
-
|
|
6821
|
+
useEffect22(() => {
|
|
6369
6822
|
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
|
6370
6823
|
if (ref.current) {
|
|
6371
6824
|
ref.current.style["animation"] = `${heightAnimation(
|
|
@@ -6395,19 +6848,16 @@ var PeerMetadata = ({ peerId }) => {
|
|
|
6395
6848
|
const metaData = useHMSStore25(selectPeerMetadata2(peerId));
|
|
6396
6849
|
const isHandRaised = (metaData == null ? void 0 : metaData.isHandRaised) || false;
|
|
6397
6850
|
const isBRB = (metaData == null ? void 0 : metaData.isBRBOn) || false;
|
|
6398
|
-
return /* @__PURE__ */ React53.createElement(Fragment5, null, isHandRaised ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "raiseHand_icon_onTile" }, /* @__PURE__ */ React53.createElement(HandIcon3, { width: 24, height: 24 })) : null, isBRB ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "brb_icon_onTile" }, /* @__PURE__ */ React53.createElement(BrbTileIcon, { width:
|
|
6851
|
+
return /* @__PURE__ */ React53.createElement(Fragment5, null, isHandRaised ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "raiseHand_icon_onTile" }, /* @__PURE__ */ React53.createElement(HandIcon3, { width: 24, height: 24 })) : null, isBRB ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "brb_icon_onTile" }, /* @__PURE__ */ React53.createElement(BrbTileIcon, { width: 22, height: 22 })) : null);
|
|
6399
6852
|
};
|
|
6400
6853
|
var VideoTile = React53.memo(Tile);
|
|
6401
|
-
var showAudioMuted = ({ hideAudioMute, isAudioMuted }) => {
|
|
6402
|
-
return isAudioMuted && !hideAudioMute;
|
|
6403
|
-
};
|
|
6404
6854
|
var VideoTile_default = VideoTile;
|
|
6405
6855
|
|
|
6406
6856
|
// src/Prebuilt/components/Preview/PreviewForm.tsx
|
|
6407
6857
|
import React54 from "react";
|
|
6408
6858
|
import { useMedia as useMedia9 } from "react-use";
|
|
6409
6859
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType2 } from "@100mslive/types-prebuilt/elements/join_form";
|
|
6410
|
-
import {
|
|
6860
|
+
import { useRecordingStreaming as useRecordingStreaming3 } from "@100mslive/react-sdk";
|
|
6411
6861
|
import { RadioIcon } from "@100mslive/react-icons";
|
|
6412
6862
|
var PreviewForm = ({
|
|
6413
6863
|
name,
|
|
@@ -6421,13 +6871,11 @@ var PreviewForm = ({
|
|
|
6421
6871
|
const formSubmit = (e) => {
|
|
6422
6872
|
e.preventDefault();
|
|
6423
6873
|
};
|
|
6424
|
-
const
|
|
6425
|
-
const isMobile = useMedia9(mediaQueryLg);
|
|
6874
|
+
const isMobile = useMedia9(config.media.md);
|
|
6426
6875
|
const { isHLSRunning } = useRecordingStreaming3();
|
|
6427
|
-
const permissions = useHMSStore26(selectPermissions4);
|
|
6428
6876
|
const layout = useRoomLayout();
|
|
6429
6877
|
const { join_form: joinForm = {} } = ((_c = (_b7 = (_a7 = layout == null ? void 0 : layout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
|
6430
|
-
const showGoLive = (joinForm == null ? void 0 : joinForm.join_btn_type) === JoinForm_JoinBtnType2.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning
|
|
6878
|
+
const showGoLive = (joinForm == null ? void 0 : joinForm.join_btn_type) === JoinForm_JoinBtnType2.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning;
|
|
6431
6879
|
return /* @__PURE__ */ React54.createElement(
|
|
6432
6880
|
Form,
|
|
6433
6881
|
{
|
|
@@ -6448,6 +6896,9 @@ var PreviewForm = ({
|
|
|
6448
6896
|
onKeyDown: (e) => {
|
|
6449
6897
|
if (e.key === "Enter" && name.trim().length > 0) {
|
|
6450
6898
|
e.preventDefault();
|
|
6899
|
+
if (isMobile) {
|
|
6900
|
+
return;
|
|
6901
|
+
}
|
|
6451
6902
|
onJoin();
|
|
6452
6903
|
}
|
|
6453
6904
|
}
|
|
@@ -6469,8 +6920,8 @@ var Form = styled("form", {
|
|
|
6469
6920
|
});
|
|
6470
6921
|
var PreviewForm_default = PreviewForm;
|
|
6471
6922
|
|
|
6472
|
-
// src/Prebuilt/components/Preview/PreviewJoin.
|
|
6473
|
-
var VirtualBackground = React55.lazy(() => import("./VirtualBackground-
|
|
6923
|
+
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
|
6924
|
+
var VirtualBackground = React55.lazy(() => import("./VirtualBackground-UM2FOUHQ.js"));
|
|
6474
6925
|
var getParticipantChipContent = (peerCount = 0) => {
|
|
6475
6926
|
if (peerCount === 0) {
|
|
6476
6927
|
return "You are the first to join";
|
|
@@ -6478,7 +6929,12 @@ var getParticipantChipContent = (peerCount = 0) => {
|
|
|
6478
6929
|
const formattedNum = getFormattedCount(peerCount);
|
|
6479
6930
|
return `${formattedNum} other${parseInt(formattedNum) === 1 ? "" : "s"} in the session`;
|
|
6480
6931
|
};
|
|
6481
|
-
var PreviewJoin = ({
|
|
6932
|
+
var PreviewJoin = ({
|
|
6933
|
+
onJoin,
|
|
6934
|
+
skipPreview,
|
|
6935
|
+
initialName,
|
|
6936
|
+
asRole
|
|
6937
|
+
}) => {
|
|
6482
6938
|
var _a7, _b7, _c;
|
|
6483
6939
|
const [previewPreference, setPreviewPreference] = useUserPreferences(
|
|
6484
6940
|
UserPreferencesKeys.PREVIEW,
|
|
@@ -6487,7 +6943,7 @@ var PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
|
6487
6943
|
const { isStreamingOn } = useRecordingStreaming4();
|
|
6488
6944
|
const authToken = useAuthToken();
|
|
6489
6945
|
const [name, setName] = useState20(initialName || previewPreference.name);
|
|
6490
|
-
const {
|
|
6946
|
+
const { toggleAudio, toggleVideo } = useAVToggle2();
|
|
6491
6947
|
const [previewError, setPreviewError] = useState20(false);
|
|
6492
6948
|
const { endpoints } = useHMSPrebuiltContext();
|
|
6493
6949
|
const { peerCount } = useParticipants();
|
|
@@ -6508,19 +6964,17 @@ var PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
|
6508
6964
|
},
|
|
6509
6965
|
asRole
|
|
6510
6966
|
});
|
|
6511
|
-
const roomState =
|
|
6512
|
-
const savePreferenceAndJoin =
|
|
6967
|
+
const roomState = useHMSStore26(selectRoomState7);
|
|
6968
|
+
const savePreferenceAndJoin = useCallback17(() => {
|
|
6513
6969
|
setPreviewPreference({
|
|
6514
|
-
name
|
|
6515
|
-
isAudioMuted: !isLocalAudioEnabled,
|
|
6516
|
-
isVideoMuted: !isLocalVideoEnabled
|
|
6970
|
+
name
|
|
6517
6971
|
});
|
|
6518
6972
|
join();
|
|
6519
6973
|
onJoin && onJoin();
|
|
6520
|
-
}, [join,
|
|
6974
|
+
}, [join, name, setPreviewPreference, onJoin]);
|
|
6521
6975
|
const roomLayout = useRoomLayout();
|
|
6522
6976
|
const { preview_header: previewHeader = {} } = ((_c = (_b7 = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
|
6523
|
-
|
|
6977
|
+
useEffect23(() => {
|
|
6524
6978
|
if (authToken) {
|
|
6525
6979
|
if (skipPreview) {
|
|
6526
6980
|
savePreferenceAndJoin();
|
|
@@ -6529,7 +6983,7 @@ var PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
|
6529
6983
|
}
|
|
6530
6984
|
}
|
|
6531
6985
|
}, [authToken, skipPreview]);
|
|
6532
|
-
|
|
6986
|
+
useEffect23(() => {
|
|
6533
6987
|
if (initialName) {
|
|
6534
6988
|
setName(initialName);
|
|
6535
6989
|
}
|
|
@@ -6569,14 +7023,7 @@ var PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
|
6569
7023
|
}
|
|
6570
7024
|
},
|
|
6571
7025
|
/* @__PURE__ */ React55.createElement(PreviewTile, { name, error: previewError })
|
|
6572
|
-
) : null, /* @__PURE__ */ React55.createElement(Box, { css: { w: "100%", maxWidth: "640px" } }, /* @__PURE__ */ React55.createElement(
|
|
6573
|
-
PreviewControls,
|
|
6574
|
-
{
|
|
6575
|
-
enableJoin,
|
|
6576
|
-
savePreferenceAndJoin,
|
|
6577
|
-
hideSettings: !toggleVideo && !toggleAudio
|
|
6578
|
-
}
|
|
6579
|
-
), /* @__PURE__ */ React55.createElement(
|
|
7026
|
+
) : null, /* @__PURE__ */ React55.createElement(Box, { css: { w: "100%", maxWidth: "640px" } }, /* @__PURE__ */ React55.createElement(PreviewControls, { hideSettings: !toggleVideo && !toggleAudio }), /* @__PURE__ */ React55.createElement(
|
|
6580
7027
|
PreviewForm_default,
|
|
6581
7028
|
{
|
|
6582
7029
|
name,
|
|
@@ -6595,23 +7042,26 @@ var Container3 = styled("div", __spreadProps(__spreadValues({
|
|
|
6595
7042
|
px: "$10"
|
|
6596
7043
|
}));
|
|
6597
7044
|
var PreviewTile = ({ name, error }) => {
|
|
6598
|
-
const localPeer =
|
|
7045
|
+
const localPeer = useHMSStore26(selectLocalPeer);
|
|
6599
7046
|
const { isLocalAudioEnabled, toggleAudio } = useAVToggle2();
|
|
6600
|
-
const isVideoOn =
|
|
7047
|
+
const isVideoOn = useHMSStore26(selectIsLocalVideoEnabled5);
|
|
6601
7048
|
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
|
6602
7049
|
const trackSelector = selectVideoTrackByID5(localPeer == null ? void 0 : localPeer.videoTrack);
|
|
6603
|
-
const track =
|
|
7050
|
+
const track = useHMSStore26(trackSelector);
|
|
6604
7051
|
const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
|
|
7052
|
+
const videoTrack = useHMSStore26(selectVideoTrackByID5(localPeer == null ? void 0 : localPeer.videoTrack));
|
|
7053
|
+
const isMobile = useMedia10(config.media.md);
|
|
7054
|
+
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
|
6605
7055
|
return /* @__PURE__ */ React55.createElement(
|
|
6606
7056
|
StyledVideoTile.Container,
|
|
6607
7057
|
{
|
|
6608
7058
|
css: {
|
|
6609
7059
|
bg: "$surface_default",
|
|
6610
|
-
aspectRatio
|
|
6611
|
-
|
|
7060
|
+
aspectRatio,
|
|
7061
|
+
height: "min(640px, 40vh)",
|
|
7062
|
+
maxWidth: "640px",
|
|
6612
7063
|
overflow: "clip",
|
|
6613
7064
|
"@md": {
|
|
6614
|
-
aspectRatio: 9 / 16,
|
|
6615
7065
|
width: "min(220px, 70vw)",
|
|
6616
7066
|
maxWidth: "100%",
|
|
6617
7067
|
my: "$4"
|
|
@@ -6626,11 +7076,12 @@ var PreviewTile = ({ name, error }) => {
|
|
|
6626
7076
|
"data-testid": "preview_tile"
|
|
6627
7077
|
}
|
|
6628
7078
|
), !isVideoOn ? /* @__PURE__ */ React55.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React55.createElement(Avatar, { name, "data-testid": "preview_avatar_tile" })) : null) : !error ? /* @__PURE__ */ React55.createElement(FullPageProgress_default, null) : null,
|
|
6629
|
-
showMuteIcon ? /* @__PURE__ */ React55.createElement(StyledVideoTile.AudioIndicator, { size: "medium" }, /* @__PURE__ */ React55.createElement(MicOffIcon4, null)) : /* @__PURE__ */ React55.createElement(AudioLevel, { trackId: localPeer.audioTrack })
|
|
7079
|
+
showMuteIcon ? /* @__PURE__ */ React55.createElement(StyledVideoTile.AudioIndicator, { size: "medium" }, /* @__PURE__ */ React55.createElement(MicOffIcon4, null)) : /* @__PURE__ */ React55.createElement(AudioLevel, { trackId: localPeer == null ? void 0 : localPeer.audioTrack })
|
|
6630
7080
|
);
|
|
6631
7081
|
};
|
|
6632
7082
|
var PreviewControls = ({ hideSettings }) => {
|
|
6633
|
-
const isVideoOn =
|
|
7083
|
+
const isVideoOn = useHMSStore26(selectIsLocalVideoEnabled5);
|
|
7084
|
+
const isMobile = useMedia10(config.media.md);
|
|
6634
7085
|
return /* @__PURE__ */ React55.createElement(
|
|
6635
7086
|
Flex,
|
|
6636
7087
|
{
|
|
@@ -6640,7 +7091,7 @@ var PreviewControls = ({ hideSettings }) => {
|
|
|
6640
7091
|
mt: "$8"
|
|
6641
7092
|
}
|
|
6642
7093
|
},
|
|
6643
|
-
/* @__PURE__ */ React55.createElement(Flex, { css: { gap: "$4" } }, /* @__PURE__ */ React55.createElement(AudioVideoToggle, { compact: true }), /* @__PURE__ */ React55.createElement(Suspense, { fallback: "" }, isVideoOn ? /* @__PURE__ */ React55.createElement(VirtualBackground, null) : null)),
|
|
7094
|
+
/* @__PURE__ */ React55.createElement(Flex, { css: { gap: "$4" } }, /* @__PURE__ */ React55.createElement(AudioVideoToggle, { compact: true }), /* @__PURE__ */ React55.createElement(Suspense, { fallback: "" }, isVideoOn && !isMobile ? /* @__PURE__ */ React55.createElement(VirtualBackground, null) : null)),
|
|
6644
7095
|
!hideSettings ? /* @__PURE__ */ React55.createElement(PreviewSettings, null) : null
|
|
6645
7096
|
);
|
|
6646
7097
|
};
|
|
@@ -6650,16 +7101,16 @@ var PreviewSettings = React55.memo(() => {
|
|
|
6650
7101
|
});
|
|
6651
7102
|
var PreviewJoin_default = PreviewJoin;
|
|
6652
7103
|
|
|
6653
|
-
// src/Prebuilt/components/Preview/PreviewContainer.
|
|
7104
|
+
// src/Prebuilt/components/Preview/PreviewContainer.tsx
|
|
6654
7105
|
var PreviewContainer = () => {
|
|
6655
7106
|
var _a7, _b7, _c;
|
|
6656
|
-
const navigate =
|
|
7107
|
+
const navigate = useNavigate4();
|
|
6657
7108
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
|
6658
7109
|
const skipPreview = !isPreviewScreenEnabled;
|
|
6659
7110
|
const previewAsRole = useSearchParam(QUERY_PARAM_PREVIEW_AS_ROLE);
|
|
6660
7111
|
const { userName } = useHMSPrebuiltContext();
|
|
6661
7112
|
const initialName = userName || (skipPreview ? "Beam" : "");
|
|
6662
|
-
const { roomId: urlRoomId, role: userRole } =
|
|
7113
|
+
const { roomId: urlRoomId, role: userRole } = useParams4();
|
|
6663
7114
|
const authToken = useAuthToken();
|
|
6664
7115
|
const roomLayout = useRoomLayout();
|
|
6665
7116
|
const { preview_header: previewHeader = {} } = ((_c = (_b7 = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
|
@@ -6677,14 +7128,22 @@ var PreviewContainer = () => {
|
|
|
6677
7128
|
justify: "center",
|
|
6678
7129
|
align: "center"
|
|
6679
7130
|
},
|
|
6680
|
-
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */ React56.createElement(
|
|
7131
|
+
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */ React56.createElement(
|
|
7132
|
+
PreviewJoin_default,
|
|
7133
|
+
{
|
|
7134
|
+
initialName,
|
|
7135
|
+
skipPreview,
|
|
7136
|
+
asRole: previewAsRole != null ? previewAsRole : void 0,
|
|
7137
|
+
onJoin
|
|
7138
|
+
}
|
|
7139
|
+
) : /* @__PURE__ */ React56.createElement(FullPageProgress_default, null)
|
|
6681
7140
|
));
|
|
6682
7141
|
};
|
|
6683
7142
|
var PreviewContainer_default = PreviewContainer;
|
|
6684
7143
|
|
|
6685
7144
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
|
6686
|
-
import React58, { useEffect as
|
|
6687
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom4, useHMSStore as
|
|
7145
|
+
import React58, { useEffect as useEffect24, useState as useState21 } from "react";
|
|
7146
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom4, useHMSStore as useHMSStore27 } from "@100mslive/react-sdk";
|
|
6688
7147
|
|
|
6689
7148
|
// src/Prebuilt/components/Toast/Toast.jsx
|
|
6690
7149
|
import React57 from "react";
|
|
@@ -6706,9 +7165,9 @@ var Toast2 = (_a7) => {
|
|
|
6706
7165
|
|
|
6707
7166
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
|
6708
7167
|
var ToastContainer = () => {
|
|
6709
|
-
const isConnected =
|
|
7168
|
+
const isConnected = useHMSStore27(selectIsConnectedToRoom4);
|
|
6710
7169
|
const [toasts, setToast] = useState21([]);
|
|
6711
|
-
|
|
7170
|
+
useEffect24(() => {
|
|
6712
7171
|
ToastManager.addListener(setToast);
|
|
6713
7172
|
return () => {
|
|
6714
7173
|
ToastManager.removeListener(setToast);
|
|
@@ -6727,9 +7186,15 @@ var ToastContainer = () => {
|
|
|
6727
7186
|
};
|
|
6728
7187
|
|
|
6729
7188
|
// src/Prebuilt/plugins/FlyingEmoji.jsx
|
|
6730
|
-
import React59, { useCallback as
|
|
6731
|
-
import { useMedia as
|
|
6732
|
-
import {
|
|
7189
|
+
import React59, { useCallback as useCallback18, useEffect as useEffect25, useMemo as useMemo4, useState as useState22 } from "react";
|
|
7190
|
+
import { useMedia as useMedia11 } from "react-use";
|
|
7191
|
+
import {
|
|
7192
|
+
selectLocalPeerID as selectLocalPeerID6,
|
|
7193
|
+
selectPeerNameByID as selectPeerNameByID2,
|
|
7194
|
+
useCustomEvent as useCustomEvent3,
|
|
7195
|
+
useHMSStore as useHMSStore28,
|
|
7196
|
+
useHMSVanillaStore as useHMSVanillaStore6
|
|
7197
|
+
} from "@100mslive/react-sdk";
|
|
6733
7198
|
var emojiCount = 1;
|
|
6734
7199
|
var flyAndFade = keyframes({
|
|
6735
7200
|
"20%": { opacity: 1 },
|
|
@@ -6754,13 +7219,13 @@ var getStartingPoints = (isMobile) => {
|
|
|
6754
7219
|
return arr;
|
|
6755
7220
|
};
|
|
6756
7221
|
function FlyingEmoji() {
|
|
6757
|
-
const localPeerId =
|
|
6758
|
-
const vanillaStore =
|
|
7222
|
+
const localPeerId = useHMSStore28(selectLocalPeerID6);
|
|
7223
|
+
const vanillaStore = useHMSVanillaStore6();
|
|
6759
7224
|
const [emojis, setEmojis] = useState22([]);
|
|
6760
|
-
const isMobile =
|
|
7225
|
+
const isMobile = useMedia11(config.media.md);
|
|
6761
7226
|
const startingPoints = useMemo4(() => getStartingPoints(isMobile), [isMobile]);
|
|
6762
|
-
const showFlyingEmoji =
|
|
6763
|
-
(emojiId, senderId) => {
|
|
7227
|
+
const showFlyingEmoji = useCallback18(
|
|
7228
|
+
({ emojiId, senderId }) => {
|
|
6764
7229
|
if (!emojiId || !senderId || document.hidden) {
|
|
6765
7230
|
return;
|
|
6766
7231
|
}
|
|
@@ -6783,7 +7248,11 @@ function FlyingEmoji() {
|
|
|
6783
7248
|
},
|
|
6784
7249
|
[localPeerId, vanillaStore, startingPoints]
|
|
6785
7250
|
);
|
|
6786
|
-
|
|
7251
|
+
useCustomEvent3({
|
|
7252
|
+
type: EMOJI_REACTION_TYPE,
|
|
7253
|
+
onEvent: showFlyingEmoji
|
|
7254
|
+
});
|
|
7255
|
+
useEffect25(() => {
|
|
6787
7256
|
window.showFlyingEmoji = showFlyingEmoji;
|
|
6788
7257
|
}, [showFlyingEmoji]);
|
|
6789
7258
|
return /* @__PURE__ */ React59.createElement(
|
|
@@ -6847,30 +7316,117 @@ function FlyingEmoji() {
|
|
|
6847
7316
|
}
|
|
6848
7317
|
|
|
6849
7318
|
// src/Prebuilt/plugins/RemoteStopScreenshare.jsx
|
|
6850
|
-
import React60, { useCallback as
|
|
6851
|
-
import { useCustomEvent as
|
|
7319
|
+
import React60, { useCallback as useCallback19 } from "react";
|
|
7320
|
+
import { useCustomEvent as useCustomEvent4, useHMSActions as useHMSActions18 } from "@100mslive/react-sdk";
|
|
6852
7321
|
function RemoteStopScreenshare() {
|
|
6853
|
-
const actions =
|
|
6854
|
-
const onRemoteStopScreenshare =
|
|
7322
|
+
const actions = useHMSActions18();
|
|
7323
|
+
const onRemoteStopScreenshare = useCallback19(() => __async(this, null, function* () {
|
|
6855
7324
|
yield actions.setScreenShareEnabled(false);
|
|
6856
7325
|
}), [actions]);
|
|
6857
|
-
|
|
7326
|
+
useCustomEvent4({
|
|
6858
7327
|
type: REMOTE_STOP_SCREENSHARE_TYPE,
|
|
6859
7328
|
onEvent: onRemoteStopScreenshare
|
|
6860
7329
|
});
|
|
6861
7330
|
return /* @__PURE__ */ React60.createElement(React60.Fragment, null);
|
|
6862
7331
|
}
|
|
6863
7332
|
|
|
6864
|
-
// src/Prebuilt/
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
7333
|
+
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
|
7334
|
+
import { useCallback as useCallback20, useEffect as useEffect27, useRef as useRef9 } from "react";
|
|
7335
|
+
import {
|
|
7336
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom6,
|
|
7337
|
+
selectPermissions as selectPermissions4,
|
|
7338
|
+
useHMSActions as useHMSActions19,
|
|
7339
|
+
useHMSStore as useHMSStore30,
|
|
7340
|
+
useRecordingStreaming as useRecordingStreaming5
|
|
7341
|
+
} from "@100mslive/react-sdk";
|
|
7342
|
+
|
|
7343
|
+
// src/Prebuilt/common/hooks.js
|
|
7344
|
+
import { useEffect as useEffect26, useRef as useRef8, useState as useState23 } from "react";
|
|
7345
|
+
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType3 } from "@100mslive/types-prebuilt/elements/join_form";
|
|
7346
|
+
import {
|
|
7347
|
+
selectAvailableRoleNames as selectAvailableRoleNames2,
|
|
7348
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
|
7349
|
+
selectPeerCount,
|
|
7350
|
+
selectPeerMetadata as selectPeerMetadata3,
|
|
7351
|
+
selectPeers,
|
|
7352
|
+
selectRemotePeers,
|
|
7353
|
+
useHMSStore as useHMSStore29,
|
|
7354
|
+
useHMSVanillaStore as useHMSVanillaStore7
|
|
7355
|
+
} from "@100mslive/react-sdk";
|
|
7356
|
+
var useFilteredRoles = () => {
|
|
7357
|
+
const roles = useHMSStore29(selectAvailableRoleNames2).filter((role) => !isInternalRole(role));
|
|
7358
|
+
return roles;
|
|
7359
|
+
};
|
|
7360
|
+
var useShowStreamingUI = () => {
|
|
7361
|
+
var _a7, _b7, _c;
|
|
7362
|
+
const layout = useRoomLayout();
|
|
7363
|
+
const { join_form } = ((_c = (_b7 = (_a7 = layout == null ? void 0 : layout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
|
7364
|
+
return (join_form == null ? void 0 : join_form.join_btn_type) === JoinForm_JoinBtnType3.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE;
|
|
7365
|
+
};
|
|
7366
|
+
var useParticipants2 = (params) => {
|
|
7367
|
+
var _a7;
|
|
7368
|
+
const isConnected = useHMSStore29(selectIsConnectedToRoom5);
|
|
7369
|
+
const peerCount = useHMSStore29(selectPeerCount);
|
|
7370
|
+
const availableRoles = useHMSStore29(selectAvailableRoleNames2);
|
|
7371
|
+
let participantList = useHMSStore29(isConnected ? selectPeers : selectRemotePeers);
|
|
7372
|
+
const rolesWithParticipants = Array.from(new Set(participantList.map((peer) => peer.roleName)));
|
|
7373
|
+
const vanillaStore = useHMSVanillaStore7();
|
|
7374
|
+
if ((_a7 = params == null ? void 0 : params.metadata) == null ? void 0 : _a7.isHandRaised) {
|
|
7375
|
+
participantList = participantList.filter((peer) => {
|
|
7376
|
+
return vanillaStore.getState(selectPeerMetadata3(peer.id)).isHandRaised;
|
|
7377
|
+
});
|
|
6871
7378
|
}
|
|
6872
|
-
|
|
7379
|
+
if ((params == null ? void 0 : params.role) && availableRoles.includes(params.role)) {
|
|
7380
|
+
participantList = participantList.filter((peer) => peer.roleName === params.role);
|
|
7381
|
+
}
|
|
7382
|
+
if (params == null ? void 0 : params.search) {
|
|
7383
|
+
const search = params.search;
|
|
7384
|
+
participantList = participantList.filter((peer) => peer.name.toLowerCase().includes(search));
|
|
7385
|
+
}
|
|
7386
|
+
return { participants: participantList, isConnected, peerCount, rolesWithParticipants };
|
|
7387
|
+
};
|
|
7388
|
+
|
|
7389
|
+
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
|
7390
|
+
var useAutoStartStreaming = () => {
|
|
7391
|
+
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
|
7392
|
+
const permissions = useHMSStore30(selectPermissions4);
|
|
7393
|
+
const showStreamingUI = useShowStreamingUI();
|
|
7394
|
+
const hmsActions = useHMSActions19();
|
|
7395
|
+
const isConnected = useHMSStore30(selectIsConnectedToRoom6);
|
|
7396
|
+
const { isHLSRunning } = useRecordingStreaming5();
|
|
7397
|
+
const streamStartedRef = useRef9(false);
|
|
7398
|
+
const startHLS = useCallback20(() => __async(void 0, null, function* () {
|
|
7399
|
+
var _a7;
|
|
7400
|
+
try {
|
|
7401
|
+
if (isHLSStarted || !showStreamingUI || isHLSRunning) {
|
|
7402
|
+
return;
|
|
7403
|
+
}
|
|
7404
|
+
setHLSStarted(true);
|
|
7405
|
+
streamStartedRef.current = true;
|
|
7406
|
+
yield hmsActions.startHLSStreaming();
|
|
7407
|
+
} catch (error) {
|
|
7408
|
+
if ((_a7 = error.message) == null ? void 0 : _a7.includes("beam already started")) {
|
|
7409
|
+
return;
|
|
7410
|
+
}
|
|
7411
|
+
streamStartedRef.current = false;
|
|
7412
|
+
setHLSStarted(false);
|
|
7413
|
+
}
|
|
7414
|
+
}), [hmsActions, isHLSRunning, isHLSStarted, setHLSStarted, showStreamingUI]);
|
|
7415
|
+
useEffect27(() => {
|
|
7416
|
+
if (!isHLSStarted && !isHLSRunning) {
|
|
7417
|
+
streamStartedRef.current = false;
|
|
7418
|
+
}
|
|
7419
|
+
}, [isHLSStarted, isHLSRunning]);
|
|
7420
|
+
useEffect27(() => {
|
|
7421
|
+
if (!isConnected || streamStartedRef.current || !(permissions == null ? void 0 : permissions.hlsStreaming)) {
|
|
7422
|
+
return;
|
|
7423
|
+
}
|
|
7424
|
+
startHLS();
|
|
7425
|
+
}, [isConnected]);
|
|
6873
7426
|
};
|
|
7427
|
+
|
|
7428
|
+
// src/Prebuilt/App.tsx
|
|
7429
|
+
var Conference = React61.lazy(() => import("./conference-UWLJHMB2.js"));
|
|
6874
7430
|
var HMSPrebuilt = React61.forwardRef(
|
|
6875
7431
|
({
|
|
6876
7432
|
roomCode = "",
|
|
@@ -6885,12 +7441,10 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
6885
7441
|
onLeave
|
|
6886
7442
|
}, ref) => {
|
|
6887
7443
|
var _a7, _b7, _c, _d;
|
|
6888
|
-
const aspectRatio = "1-1";
|
|
6889
7444
|
const metadata = "";
|
|
6890
|
-
const
|
|
6891
|
-
const reactiveStore = useRef8();
|
|
7445
|
+
const reactiveStore = useRef10();
|
|
6892
7446
|
const [hydrated, setHydrated] = React61.useState(false);
|
|
6893
|
-
|
|
7447
|
+
useEffect28(() => {
|
|
6894
7448
|
setHydrated(true);
|
|
6895
7449
|
const hms = new HMSReactiveStore();
|
|
6896
7450
|
const hmsStore = hms.getStore();
|
|
@@ -6905,13 +7459,13 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
6905
7459
|
hmsNotifications
|
|
6906
7460
|
};
|
|
6907
7461
|
}, []);
|
|
6908
|
-
|
|
7462
|
+
useEffect28(() => {
|
|
6909
7463
|
if (!ref || !reactiveStore.current) {
|
|
6910
7464
|
return;
|
|
6911
7465
|
}
|
|
6912
7466
|
ref.current = __spreadValues({}, reactiveStore.current);
|
|
6913
7467
|
}, [ref]);
|
|
6914
|
-
|
|
7468
|
+
useEffect28(
|
|
6915
7469
|
() => () => {
|
|
6916
7470
|
var _a8;
|
|
6917
7471
|
(_a8 = reactiveStore == null ? void 0 : reactiveStore.current) == null ? void 0 : _a8.hmsActions.leave();
|
|
@@ -6981,7 +7535,6 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
6981
7535
|
HMSThemeProvider,
|
|
6982
7536
|
{
|
|
6983
7537
|
themeType: `${theme2.name}-${Date.now()}`,
|
|
6984
|
-
aspectRatio: getAspectRatio({ width, height }),
|
|
6985
7538
|
theme: {
|
|
6986
7539
|
//@ts-ignore: Prebuilt theme to match stiches theme
|
|
6987
7540
|
colors: theme2.palette,
|
|
@@ -7013,42 +7566,43 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
7013
7566
|
);
|
|
7014
7567
|
HMSPrebuilt.displayName = "HMSPrebuilt";
|
|
7015
7568
|
var Redirector = ({ showPreview }) => {
|
|
7016
|
-
const { roomId, role } =
|
|
7569
|
+
const { roomId, role } = useParams5();
|
|
7017
7570
|
return /* @__PURE__ */ React61.createElement(Navigate, { to: `/${showPreview ? "preview" : "meeting"}/${roomId}/${role || ""}` });
|
|
7018
7571
|
};
|
|
7019
7572
|
var RouteList = () => {
|
|
7020
7573
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
|
7021
7574
|
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
|
7575
|
+
useAutoStartStreaming();
|
|
7022
7576
|
return /* @__PURE__ */ React61.createElement(Routes, null, isPreviewScreenEnabled ? /* @__PURE__ */ React61.createElement(Route, { path: "preview" }, /* @__PURE__ */ React61.createElement(
|
|
7023
7577
|
Route,
|
|
7024
7578
|
{
|
|
7025
7579
|
path: ":roomId/:role",
|
|
7026
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7580
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React61.createElement(PreviewContainer_default, null))
|
|
7027
7581
|
}
|
|
7028
7582
|
), /* @__PURE__ */ React61.createElement(
|
|
7029
7583
|
Route,
|
|
7030
7584
|
{
|
|
7031
7585
|
path: ":roomId",
|
|
7032
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7586
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React61.createElement(PreviewContainer_default, null))
|
|
7033
7587
|
}
|
|
7034
7588
|
)) : null, /* @__PURE__ */ React61.createElement(Route, { path: "meeting" }, /* @__PURE__ */ React61.createElement(
|
|
7035
7589
|
Route,
|
|
7036
7590
|
{
|
|
7037
7591
|
path: ":roomId/:role",
|
|
7038
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7592
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React61.createElement(Conference, null))
|
|
7039
7593
|
}
|
|
7040
7594
|
), /* @__PURE__ */ React61.createElement(
|
|
7041
7595
|
Route,
|
|
7042
7596
|
{
|
|
7043
7597
|
path: ":roomId",
|
|
7044
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7598
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React61.createElement(Conference, null))
|
|
7045
7599
|
}
|
|
7046
7600
|
)), isLeaveScreenEnabled ? /* @__PURE__ */ React61.createElement(Route, { path: "leave" }, /* @__PURE__ */ React61.createElement(Route, { path: ":roomId/:role", element: /* @__PURE__ */ React61.createElement(PostLeave_default, null) }), /* @__PURE__ */ React61.createElement(Route, { path: ":roomId", element: /* @__PURE__ */ React61.createElement(PostLeave_default, null) })) : null, /* @__PURE__ */ React61.createElement(Route, { path: "/:roomId/:role", element: /* @__PURE__ */ React61.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }), /* @__PURE__ */ React61.createElement(Route, { path: "/:roomId/", element: /* @__PURE__ */ React61.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }));
|
|
7047
7601
|
};
|
|
7048
7602
|
var BackSwipe = () => {
|
|
7049
|
-
const isConnectedToRoom =
|
|
7603
|
+
const isConnectedToRoom = useHMSStore31(selectIsConnectedToRoom7);
|
|
7050
7604
|
const hmsActions = useHMSActions20();
|
|
7051
|
-
|
|
7605
|
+
useEffect28(() => {
|
|
7052
7606
|
const onRouteLeave = () => __async(void 0, null, function* () {
|
|
7053
7607
|
if (isConnectedToRoom) {
|
|
7054
7608
|
yield hmsActions.leave();
|
|
@@ -7070,7 +7624,8 @@ function AppRoutes({
|
|
|
7070
7624
|
defaultAuthToken
|
|
7071
7625
|
}) {
|
|
7072
7626
|
const roomLayout = useRoomLayout();
|
|
7073
|
-
|
|
7627
|
+
const isNotificationsDisabled = useIsNotificationDisabled();
|
|
7628
|
+
return /* @__PURE__ */ React61.createElement(Router, null, /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(ToastContainer, null), /* @__PURE__ */ React61.createElement(Notifications, null), /* @__PURE__ */ React61.createElement(BackSwipe, null), !isNotificationsDisabled && /* @__PURE__ */ React61.createElement(FlyingEmoji, null), /* @__PURE__ */ React61.createElement(RemoteStopScreenshare, null), /* @__PURE__ */ React61.createElement(KeyboardHandler, null), /* @__PURE__ */ React61.createElement(AuthToken_default, { authTokenByRoomCodeEndpoint, defaultAuthToken }), roomLayout && /* @__PURE__ */ React61.createElement(Routes, null, /* @__PURE__ */ React61.createElement(Route, { path: "/*", element: /* @__PURE__ */ React61.createElement(RouteList, null) }))));
|
|
7074
7629
|
}
|
|
7075
7630
|
|
|
7076
7631
|
// src/Progress/index.tsx
|
|
@@ -7138,7 +7693,6 @@ export {
|
|
|
7138
7693
|
UI_SETTINGS,
|
|
7139
7694
|
SIDE_PANE_OPTIONS,
|
|
7140
7695
|
isChrome,
|
|
7141
|
-
isSafari,
|
|
7142
7696
|
isIOS,
|
|
7143
7697
|
isMacOS,
|
|
7144
7698
|
isAndroid,
|
|
@@ -7149,7 +7703,6 @@ export {
|
|
|
7149
7703
|
useSidepaneToggle,
|
|
7150
7704
|
useUISettings,
|
|
7151
7705
|
useSetUiSettings,
|
|
7152
|
-
useIsHeadless,
|
|
7153
7706
|
useWaitingViewerRole,
|
|
7154
7707
|
useAuthToken,
|
|
7155
7708
|
useUrlToEmbed,
|
|
@@ -7164,18 +7717,19 @@ export {
|
|
|
7164
7717
|
DialogSelect,
|
|
7165
7718
|
DialogInputFile,
|
|
7166
7719
|
FullPageProgress_default,
|
|
7167
|
-
useRoomLayout,
|
|
7168
7720
|
ToastManager,
|
|
7721
|
+
getMetadata,
|
|
7169
7722
|
isScreenshareSupported,
|
|
7170
7723
|
isInternalRole,
|
|
7171
7724
|
getFormattedCount,
|
|
7725
|
+
PictureInPicture,
|
|
7726
|
+
useRoomLayoutPreviewScreen,
|
|
7727
|
+
useRoomLayoutConferencingScreen,
|
|
7728
|
+
useRedirectToLeave,
|
|
7172
7729
|
Sheet,
|
|
7173
7730
|
useMyMetadata,
|
|
7174
7731
|
StopRecordingInSheet,
|
|
7175
7732
|
Header2 as Header,
|
|
7176
|
-
useRoomLayoutPreviewScreen,
|
|
7177
|
-
useRoomLayoutConferencingScreen,
|
|
7178
|
-
useRoomLayoutLeaveScreen,
|
|
7179
7733
|
AudioVideoToggle,
|
|
7180
7734
|
ConnectionIndicator,
|
|
7181
7735
|
DialogDropdownTrigger,
|
|
@@ -7188,7 +7742,9 @@ export {
|
|
|
7188
7742
|
VideoTile_default,
|
|
7189
7743
|
PreviewTile,
|
|
7190
7744
|
PreviewControls,
|
|
7745
|
+
useFilteredRoles,
|
|
7746
|
+
useParticipants2 as useParticipants,
|
|
7191
7747
|
HMSPrebuilt,
|
|
7192
7748
|
Progress
|
|
7193
7749
|
};
|
|
7194
|
-
//# sourceMappingURL=chunk-
|
|
7750
|
+
//# sourceMappingURL=chunk-LYSAET4G.js.map
|