@100mslive/roomkit-react 0.1.6-alpha.0 → 0.1.6-alpha.2
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-QMU5JK7U.js} +208 -118
- package/dist/HLSView-QMU5JK7U.js.map +7 -0
- package/dist/Prebuilt/AppContext.d.ts +1 -1
- package/dist/Prebuilt/components/Chat/ChatFooter.d.ts +7 -0
- package/dist/Prebuilt/components/Connection/ConnectionIndicator.d.ts +6 -0
- package/dist/Prebuilt/components/Connection/TileConnection.d.ts +10 -0
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +2 -0
- package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +14 -0
- package/dist/Prebuilt/components/Footer/RoleOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Header/StreamActions.d.ts +11 -0
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +4 -3
- package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +4 -3
- package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +1 -2
- package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +3 -1
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +4 -3
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -0
- package/dist/Prebuilt/components/Preview/PreviewJoin.d.ts +16 -0
- package/dist/Prebuilt/components/RoleChangeRequestModal.d.ts +2 -0
- package/dist/Prebuilt/components/SecondaryTiles.d.ts +1 -1
- package/dist/Prebuilt/components/SidePaneTabs.d.ts +7 -0
- package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +1 -0
- package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +5 -3
- package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +6 -3
- package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +1 -0
- package/dist/Prebuilt/components/hooks/useAutoStartStreaming.d.ts +1 -0
- package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +3 -0
- package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +2 -1
- package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +2 -0
- package/dist/Prebuilt/layouts/SidePane.d.ts +4 -1
- package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +2 -1
- package/dist/{VirtualBackground-AYDHYLIZ.js → VirtualBackground-37FXUPYO.js} +6 -6
- package/dist/VirtualBackground-37FXUPYO.js.map +7 -0
- package/dist/{chunk-GQD2AGWW.js → chunk-KBVIZGYW.js} +12 -2
- package/dist/{chunk-GQD2AGWW.js.map → chunk-KBVIZGYW.js.map} +2 -2
- package/dist/{chunk-RXTHJUMZ.js → chunk-WVGGQZK4.js} +986 -436
- package/dist/chunk-WVGGQZK4.js.map +7 -0
- package/dist/{chunk-E2M2ZSOL.js → chunk-ZKE2N5LH.js} +2 -2
- package/dist/{conference-V2XZGTKU.js → conference-FJJQ4TXX.js} +1136 -1301
- package/dist/conference-FJJQ4TXX.js.map +7 -0
- package/dist/index.cjs.js +3565 -3092
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +773 -525
- package/dist/meta.esbuild.json +833 -579
- package/package.json +8 -7
- package/src/Prebuilt/App.tsx +10 -21
- package/src/Prebuilt/AppContext.tsx +1 -1
- package/src/Prebuilt/IconButton.jsx +10 -0
- package/src/Prebuilt/common/PeersSorter.ts +1 -1
- package/src/Prebuilt/common/constants.js +1 -2
- package/src/Prebuilt/common/utils.js +1 -1
- package/src/Prebuilt/components/AppData/AppData.jsx +8 -2
- package/src/Prebuilt/components/AppData/useUISettings.js +6 -6
- package/src/Prebuilt/components/AudioVideoToggle.jsx +8 -6
- package/src/Prebuilt/components/Chat/Chat.jsx +24 -11
- package/src/Prebuilt/components/Chat/ChatBody.jsx +20 -21
- package/src/Prebuilt/components/Chat/{ChatFooter.jsx → ChatFooter.tsx} +38 -13
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +5 -4
- package/src/Prebuilt/components/Connection/{ConnectionIndicator.jsx → ConnectionIndicator.tsx} +12 -4
- package/src/Prebuilt/components/Connection/{TileConnection.jsx → TileConnection.tsx} +20 -6
- package/src/Prebuilt/components/EmojiReaction.jsx +2 -6
- package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +4 -1
- package/src/Prebuilt/components/Footer/Footer.tsx +30 -5
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +15 -49
- package/src/Prebuilt/components/Footer/{RoleAccordion.jsx → RoleAccordion.tsx} +33 -17
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +1 -0
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +39 -17
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +1 -1
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +8 -1
- package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +23 -9
- package/src/Prebuilt/components/Header/common.jsx +5 -2
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +6 -1
- package/src/Prebuilt/components/InsetTile.tsx +15 -8
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +21 -11
- package/src/Prebuilt/components/Leave/EndSessionContent.tsx +2 -5
- package/src/Prebuilt/components/Leave/LeaveCard.tsx +1 -3
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +28 -25
- package/src/Prebuilt/components/Leave/LeaveSessionContent.tsx +8 -2
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +8 -8
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +4 -0
- package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +1 -1
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +9 -23
- package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +89 -28
- package/src/Prebuilt/components/Notifications/Notifications.jsx +44 -28
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
- package/src/Prebuilt/components/Pagination.tsx +14 -12
- package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +11 -2
- package/src/Prebuilt/components/Preview/PreviewForm.tsx +6 -8
- package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +44 -21
- package/src/Prebuilt/components/{RoleChangeRequestModal.jsx → RoleChangeRequestModal.tsx} +36 -17
- package/src/Prebuilt/components/ScreenshareTile.jsx +6 -7
- package/src/Prebuilt/components/SecondaryTiles.tsx +12 -10
- package/src/Prebuilt/components/SidePaneTabs.tsx +120 -0
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +1 -1
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +14 -10
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +5 -4
- package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +13 -10
- package/src/Prebuilt/components/VideoLayouts/Grid.tsx +36 -34
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +33 -15
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +45 -31
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +12 -9
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +25 -9
- package/src/Prebuilt/components/VideoLayouts/interface.ts +1 -0
- package/src/Prebuilt/components/VideoTile.jsx +45 -53
- package/src/Prebuilt/components/conference.jsx +71 -74
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -28
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
- package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +1 -1
- package/src/Prebuilt/components/hooks/useTileLayout.tsx +24 -18
- package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +4 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +1 -11
- package/src/Prebuilt/layouts/HLSView.jsx +152 -82
- package/src/Prebuilt/layouts/SidePane.tsx +25 -11
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +11 -47
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +3 -3
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +2 -2
- package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
- package/src/VideoTile/StyledVideoTile.tsx +1 -0
- package/dist/HLSView-PY2FKWX3.js.map +0 -7
- package/dist/VirtualBackground-AYDHYLIZ.js.map +0 -7
- package/dist/chunk-RXTHJUMZ.js.map +0 -7
- package/dist/conference-V2XZGTKU.js.map +0 -7
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
- package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +0 -73
- package/src/Prebuilt/components/VideoList.jsx +0 -73
- /package/dist/{chunk-E2M2ZSOL.js.map → chunk-ZKE2N5LH.js.map} +0 -0
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
textEllipsis,
|
|
36
36
|
theme,
|
|
37
37
|
toastAnimation
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-KBVIZGYW.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 useEffect29, 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,14 +2946,17 @@ 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,
|
|
2954
|
+
selectPeerMetadata,
|
|
2967
2955
|
selectRoomState as selectRoomState3,
|
|
2956
|
+
useCustomEvent,
|
|
2968
2957
|
useHMSNotifications as useHMSNotifications7,
|
|
2969
|
-
useHMSStore as useHMSStore8
|
|
2958
|
+
useHMSStore as useHMSStore8,
|
|
2959
|
+
useHMSVanillaStore as useHMSVanillaStore4
|
|
2970
2960
|
} from "@100mslive/react-sdk";
|
|
2971
2961
|
|
|
2972
2962
|
// src/Prebuilt/provider/roomLayoutProvider/index.tsx
|
|
@@ -2974,7 +2964,7 @@ import React22 from "react";
|
|
|
2974
2964
|
import merge from "lodash.merge";
|
|
2975
2965
|
|
|
2976
2966
|
// src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts
|
|
2977
|
-
import { useCallback as useCallback5, useEffect as
|
|
2967
|
+
import { useCallback as useCallback5, useEffect as useEffect8, useRef as useRef4, useState as useState5 } from "react";
|
|
2978
2968
|
|
|
2979
2969
|
// src/Prebuilt/provider/roomLayoutProvider/constants/index.ts
|
|
2980
2970
|
import { JoinForm_JoinBtnType } from "@100mslive/types-prebuilt/elements/join_form";
|
|
@@ -3039,7 +3029,7 @@ var fetchWithRetry = (..._0) => __async(void 0, [..._0], function* (url = "", op
|
|
|
3039
3029
|
throw error;
|
|
3040
3030
|
});
|
|
3041
3031
|
var useFetchRoomLayout = ({
|
|
3042
|
-
endpoint = "
|
|
3032
|
+
endpoint = "",
|
|
3043
3033
|
authToken = ""
|
|
3044
3034
|
}) => {
|
|
3045
3035
|
const [layout, setLayout] = useState5(void 0);
|
|
@@ -3055,7 +3045,7 @@ var useFetchRoomLayout = ({
|
|
|
3055
3045
|
setLayout(layout2);
|
|
3056
3046
|
}
|
|
3057
3047
|
}, []);
|
|
3058
|
-
|
|
3048
|
+
useEffect8(() => {
|
|
3059
3049
|
(() => __async(void 0, null, function* () {
|
|
3060
3050
|
var _a7, _b7;
|
|
3061
3051
|
if (isFetchInProgress.current || !authToken) {
|
|
@@ -3063,7 +3053,7 @@ var useFetchRoomLayout = ({
|
|
|
3063
3053
|
}
|
|
3064
3054
|
isFetchInProgress.current = true;
|
|
3065
3055
|
try {
|
|
3066
|
-
const resp = yield fetchWithRetry(endpoint, {
|
|
3056
|
+
const resp = yield fetchWithRetry(endpoint || "https://api.100ms.live/v2/layouts/ui", {
|
|
3067
3057
|
headers: {
|
|
3068
3058
|
Authorization: `Bearer ${authToken}`
|
|
3069
3059
|
}
|
|
@@ -3113,7 +3103,7 @@ var useUpdateRoomLayout = () => {
|
|
|
3113
3103
|
|
|
3114
3104
|
// src/Prebuilt/components/Toast/ToastConfig.jsx
|
|
3115
3105
|
import React23, { useCallback as useCallback6 } from "react";
|
|
3116
|
-
import { selectPeerByID, useHMSActions as
|
|
3106
|
+
import { selectPeerByID, useHMSActions as useHMSActions6, useHMSStore as useHMSStore6 } from "@100mslive/react-sdk";
|
|
3117
3107
|
import {
|
|
3118
3108
|
ChatUnreadIcon,
|
|
3119
3109
|
ConnectivityIcon,
|
|
@@ -3132,7 +3122,7 @@ var ChatAction = React23.forwardRef((_, ref) => {
|
|
|
3132
3122
|
});
|
|
3133
3123
|
var HandRaiseAction = React23.forwardRef(({ id = "", isSingleHandRaise = true }, ref) => {
|
|
3134
3124
|
var _a7, _b7, _c;
|
|
3135
|
-
const hmsActions =
|
|
3125
|
+
const hmsActions = useHMSActions6();
|
|
3136
3126
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
|
3137
3127
|
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
|
3138
3128
|
const peer = useHMSStore6(selectPeerByID(id));
|
|
@@ -3206,7 +3196,7 @@ var ToastConfig = {
|
|
|
3206
3196
|
};
|
|
3207
3197
|
}
|
|
3208
3198
|
},
|
|
3209
|
-
|
|
3199
|
+
RAISE_HAND: {
|
|
3210
3200
|
single: (notification) => {
|
|
3211
3201
|
var _a7, _b7;
|
|
3212
3202
|
return {
|
|
@@ -3217,8 +3207,12 @@ var ToastConfig = {
|
|
|
3217
3207
|
},
|
|
3218
3208
|
multiple: (notifications) => {
|
|
3219
3209
|
var _a7;
|
|
3210
|
+
const count = new Set(notifications.map((notification) => {
|
|
3211
|
+
var _a8;
|
|
3212
|
+
return (_a8 = notification.data) == null ? void 0 : _a8.id;
|
|
3213
|
+
})).size;
|
|
3220
3214
|
return {
|
|
3221
|
-
title: `${(_a7 = notifications[notifications.length - 1].data) == null ? void 0 : _a7.name}
|
|
3215
|
+
title: `${(_a7 = notifications[notifications.length - 1].data) == null ? void 0 : _a7.name} ${count > 1 ? `${count} and others` : ""} raised hand`,
|
|
3222
3216
|
icon: /* @__PURE__ */ React23.createElement(HandIcon, null),
|
|
3223
3217
|
action: /* @__PURE__ */ React23.createElement(HandRaiseAction, { isSingleHandRaise: false })
|
|
3224
3218
|
};
|
|
@@ -3392,11 +3386,11 @@ function AutoplayBlockedModal() {
|
|
|
3392
3386
|
}
|
|
3393
3387
|
|
|
3394
3388
|
// src/Prebuilt/components/Notifications/InitErrorModal.jsx
|
|
3395
|
-
import React25, { useEffect as
|
|
3389
|
+
import React25, { useEffect as useEffect9, useState as useState6 } from "react";
|
|
3396
3390
|
var InitErrorModal = ({ notification }) => {
|
|
3397
3391
|
const [showModal, setShowModal] = useState6(false);
|
|
3398
3392
|
const [info, setInfo] = useState6({ title: "Init Error", description: "" });
|
|
3399
|
-
|
|
3393
|
+
useEffect9(() => {
|
|
3400
3394
|
const data = notification == null ? void 0 : notification.data;
|
|
3401
3395
|
if (!data || data.action !== "INIT") {
|
|
3402
3396
|
return;
|
|
@@ -3420,7 +3414,7 @@ var InitErrorModal = ({ notification }) => {
|
|
|
3420
3414
|
};
|
|
3421
3415
|
|
|
3422
3416
|
// src/Prebuilt/components/Notifications/PeerNotifications.jsx
|
|
3423
|
-
import { useEffect as
|
|
3417
|
+
import { useEffect as useEffect10 } from "react";
|
|
3424
3418
|
import {
|
|
3425
3419
|
HMSNotificationTypes,
|
|
3426
3420
|
HMSRoomState as HMSRoomState2,
|
|
@@ -3432,7 +3426,7 @@ import {
|
|
|
3432
3426
|
// src/Prebuilt/common/utils.js
|
|
3433
3427
|
var getMetadata = (metadataString) => {
|
|
3434
3428
|
try {
|
|
3435
|
-
return metadataString
|
|
3429
|
+
return !metadataString ? {} : JSON.parse(metadataString);
|
|
3436
3430
|
} catch (error) {
|
|
3437
3431
|
return {};
|
|
3438
3432
|
}
|
|
@@ -3466,7 +3460,7 @@ var PeerNotifications = () => {
|
|
|
3466
3460
|
const isPeerJoinSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_JOINED);
|
|
3467
3461
|
const isPeerLeftSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_LEFT);
|
|
3468
3462
|
const roomState = useHMSStore7(selectRoomState2);
|
|
3469
|
-
|
|
3463
|
+
useEffect10(() => {
|
|
3470
3464
|
var _a7, _b7;
|
|
3471
3465
|
if (roomState !== HMSRoomState2.Connected) {
|
|
3472
3466
|
return;
|
|
@@ -3500,7 +3494,7 @@ var PeerNotifications = () => {
|
|
|
3500
3494
|
};
|
|
3501
3495
|
|
|
3502
3496
|
// src/Prebuilt/components/Notifications/PermissionErrorModal.jsx
|
|
3503
|
-
import React26, { useEffect as
|
|
3497
|
+
import React26, { useEffect as useEffect11, useState as useState7 } from "react";
|
|
3504
3498
|
import { useMedia } from "react-use";
|
|
3505
3499
|
import { HMSNotificationTypes as HMSNotificationTypes2, useHMSNotifications as useHMSNotifications2 } from "@100mslive/react-sdk";
|
|
3506
3500
|
|
|
@@ -3516,7 +3510,7 @@ function PermissionErrorModal() {
|
|
|
3516
3510
|
const [deviceType, setDeviceType] = useState7("");
|
|
3517
3511
|
const [isSystemError, setIsSystemError] = useState7(false);
|
|
3518
3512
|
const isMobile = useMedia(config.media.md);
|
|
3519
|
-
|
|
3513
|
+
useEffect11(() => {
|
|
3520
3514
|
var _a7, _b7, _c, _d, _e;
|
|
3521
3515
|
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
3516
|
return;
|
|
@@ -3558,7 +3552,7 @@ function PermissionErrorModal() {
|
|
|
3558
3552
|
}
|
|
3559
3553
|
|
|
3560
3554
|
// src/Prebuilt/components/Notifications/ReconnectNotifications.jsx
|
|
3561
|
-
import React27, { useEffect as
|
|
3555
|
+
import React27, { useEffect as useEffect12, useState as useState8 } from "react";
|
|
3562
3556
|
import { HMSNotificationTypes as HMSNotificationTypes3, useHMSNotifications as useHMSNotifications3 } from "@100mslive/react-sdk";
|
|
3563
3557
|
var notificationTypes2 = [
|
|
3564
3558
|
HMSNotificationTypes3.RECONNECTED,
|
|
@@ -3566,11 +3560,10 @@ var notificationTypes2 = [
|
|
|
3566
3560
|
HMSNotificationTypes3.ERROR
|
|
3567
3561
|
];
|
|
3568
3562
|
var notificationId = null;
|
|
3569
|
-
var isQA = define_process_env_default.REACT_APP_ENV === "qa";
|
|
3570
3563
|
var ReconnectNotifications = () => {
|
|
3571
3564
|
const notification = useHMSNotifications3(notificationTypes2);
|
|
3572
3565
|
const [open, setOpen] = useState8(false);
|
|
3573
|
-
|
|
3566
|
+
useEffect12(() => {
|
|
3574
3567
|
var _a7;
|
|
3575
3568
|
if ((notification == null ? void 0 : notification.type) === HMSNotificationTypes3.ERROR && ((_a7 = notification == null ? void 0 : notification.data) == null ? void 0 : _a7.isTerminal)) {
|
|
3576
3569
|
setOpen(false);
|
|
@@ -3578,18 +3571,13 @@ var ReconnectNotifications = () => {
|
|
|
3578
3571
|
notificationId = ToastManager.replaceToast(notificationId, ToastConfig.RECONNECTED.single());
|
|
3579
3572
|
setOpen(false);
|
|
3580
3573
|
} 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
|
-
}
|
|
3574
|
+
notificationId = ToastManager.replaceToast(
|
|
3575
|
+
notificationId,
|
|
3576
|
+
ToastConfig.RECONNECTING.single(notification.data.message)
|
|
3577
|
+
);
|
|
3590
3578
|
}
|
|
3591
3579
|
}, [notification]);
|
|
3592
|
-
if (!open
|
|
3580
|
+
if (!open)
|
|
3593
3581
|
return null;
|
|
3594
3582
|
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
3583
|
Dialog.Content,
|
|
@@ -3610,18 +3598,18 @@ var ReconnectNotifications = () => {
|
|
|
3610
3598
|
};
|
|
3611
3599
|
|
|
3612
3600
|
// src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx
|
|
3613
|
-
import React28, { useEffect as
|
|
3614
|
-
import { HMSNotificationTypes as HMSNotificationTypes4, useHMSActions as
|
|
3601
|
+
import React28, { useEffect as useEffect13, useState as useState9 } from "react";
|
|
3602
|
+
import { HMSNotificationTypes as HMSNotificationTypes4, useHMSActions as useHMSActions7, useHMSNotifications as useHMSNotifications4 } from "@100mslive/react-sdk";
|
|
3615
3603
|
import { MicOnIcon } from "@100mslive/react-icons";
|
|
3616
3604
|
var TrackBulkUnmuteModal = () => {
|
|
3617
|
-
const hmsActions =
|
|
3605
|
+
const hmsActions = useHMSActions7();
|
|
3618
3606
|
const [muteNotification, setMuteNotification] = useState9(null);
|
|
3619
3607
|
const notification = useHMSNotifications4([
|
|
3620
3608
|
HMSNotificationTypes4.CHANGE_MULTI_TRACK_STATE_REQUEST,
|
|
3621
3609
|
HMSNotificationTypes4.ROOM_ENDED,
|
|
3622
3610
|
HMSNotificationTypes4.REMOVED_FROM_ROOM
|
|
3623
3611
|
]);
|
|
3624
|
-
|
|
3612
|
+
useEffect13(() => {
|
|
3625
3613
|
switch (notification == null ? void 0 : notification.type) {
|
|
3626
3614
|
case HMSNotificationTypes4.REMOVED_FROM_ROOM:
|
|
3627
3615
|
case HMSNotificationTypes4.ROOM_ENDED:
|
|
@@ -3658,7 +3646,7 @@ var TrackBulkUnmuteModal = () => {
|
|
|
3658
3646
|
};
|
|
3659
3647
|
|
|
3660
3648
|
// src/Prebuilt/components/Notifications/TrackNotifications.jsx
|
|
3661
|
-
import { useEffect as
|
|
3649
|
+
import { useEffect as useEffect14 } from "react";
|
|
3662
3650
|
import { HMSNotificationTypes as HMSNotificationTypes5, useHMSNotifications as useHMSNotifications5 } from "@100mslive/react-sdk";
|
|
3663
3651
|
var notificationTypes3 = [
|
|
3664
3652
|
HMSNotificationTypes5.TRACK_ADDED,
|
|
@@ -3668,7 +3656,7 @@ var notificationTypes3 = [
|
|
|
3668
3656
|
];
|
|
3669
3657
|
var TrackNotifications = () => {
|
|
3670
3658
|
const notification = useHMSNotifications5(notificationTypes3);
|
|
3671
|
-
|
|
3659
|
+
useEffect14(() => {
|
|
3672
3660
|
if (notification) {
|
|
3673
3661
|
console.debug(`[${notification.type}]`, notification);
|
|
3674
3662
|
}
|
|
@@ -3677,18 +3665,18 @@ var TrackNotifications = () => {
|
|
|
3677
3665
|
};
|
|
3678
3666
|
|
|
3679
3667
|
// src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx
|
|
3680
|
-
import React29, { useEffect as
|
|
3681
|
-
import { HMSNotificationTypes as HMSNotificationTypes6, useHMSActions as
|
|
3668
|
+
import React29, { useEffect as useEffect15, useState as useState10 } from "react";
|
|
3669
|
+
import { HMSNotificationTypes as HMSNotificationTypes6, useHMSActions as useHMSActions8, useHMSNotifications as useHMSNotifications6 } from "@100mslive/react-sdk";
|
|
3682
3670
|
import { MicOnIcon as MicOnIcon2 } from "@100mslive/react-icons";
|
|
3683
3671
|
var TrackUnmuteModal = () => {
|
|
3684
|
-
const hmsActions =
|
|
3672
|
+
const hmsActions = useHMSActions8();
|
|
3685
3673
|
const notification = useHMSNotifications6([
|
|
3686
3674
|
HMSNotificationTypes6.CHANGE_TRACK_STATE_REQUEST,
|
|
3687
3675
|
HMSNotificationTypes6.ROOM_ENDED,
|
|
3688
3676
|
HMSNotificationTypes6.REMOVED_FROM_ROOM
|
|
3689
3677
|
]);
|
|
3690
3678
|
const [muteNotification, setMuteNotification] = useState10(null);
|
|
3691
|
-
|
|
3679
|
+
useEffect15(() => {
|
|
3692
3680
|
switch (notification == null ? void 0 : notification.type) {
|
|
3693
3681
|
case HMSNotificationTypes6.REMOVED_FROM_ROOM:
|
|
3694
3682
|
case HMSNotificationTypes6.ROOM_ENDED:
|
|
@@ -3722,17 +3710,497 @@ var TrackUnmuteModal = () => {
|
|
|
3722
3710
|
);
|
|
3723
3711
|
};
|
|
3724
3712
|
|
|
3713
|
+
// src/Prebuilt/components/hooks/useRedirectToLeave.tsx
|
|
3714
|
+
import { useCallback as useCallback7 } from "react";
|
|
3715
|
+
import { useNavigate, useParams } from "react-router-dom";
|
|
3716
|
+
|
|
3717
|
+
// src/Prebuilt/components/PIP/PIPManager.js
|
|
3718
|
+
import * as workerTimers from "worker-timers";
|
|
3719
|
+
|
|
3720
|
+
// src/Prebuilt/components/PIP/pipUtils.js
|
|
3721
|
+
var CANVAS_FILL_COLOR;
|
|
3722
|
+
var CANVAS_STROKE_COLOR;
|
|
3723
|
+
function setPIPCanvasColors() {
|
|
3724
|
+
if (!CANVAS_FILL_COLOR) {
|
|
3725
|
+
CANVAS_FILL_COLOR = window.getComputedStyle(document.documentElement).getPropertyValue("--hms-ui-colors-surface_bright");
|
|
3726
|
+
}
|
|
3727
|
+
if (!CANVAS_STROKE_COLOR) {
|
|
3728
|
+
CANVAS_STROKE_COLOR = window.getComputedStyle(document.documentElement).getPropertyValue("--hms-ui-colors-border_bright");
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
function resetPIPCanvasColors() {
|
|
3732
|
+
CANVAS_FILL_COLOR = "";
|
|
3733
|
+
CANVAS_STROKE_COLOR = "";
|
|
3734
|
+
}
|
|
3735
|
+
function drawVideoElementsOnCanvas(videoElements, canvas) {
|
|
3736
|
+
let videoTiles = videoElements.filter((videoElement) => videoElement.srcObject !== null);
|
|
3737
|
+
const ctx = canvas.getContext("2d");
|
|
3738
|
+
setPIPCanvasColors();
|
|
3739
|
+
ctx.fillStyle = CANVAS_FILL_COLOR;
|
|
3740
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
3741
|
+
if (videoTiles.length === 0) {
|
|
3742
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
3743
|
+
return;
|
|
3744
|
+
}
|
|
3745
|
+
fillGridTiles(videoTiles.slice(0, 4), ctx, canvas);
|
|
3746
|
+
}
|
|
3747
|
+
function dummyChangeInCanvas(canvas) {
|
|
3748
|
+
const ctx = canvas.getContext("2d");
|
|
3749
|
+
setPIPCanvasColors();
|
|
3750
|
+
ctx.fillStyle = CANVAS_FILL_COLOR;
|
|
3751
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
3752
|
+
}
|
|
3753
|
+
function fillGridTiles(videoElements, ctx, canvas) {
|
|
3754
|
+
const offset = 8;
|
|
3755
|
+
canvas.width = 480;
|
|
3756
|
+
canvas.height = 320;
|
|
3757
|
+
ctx.fillStyle = CANVAS_FILL_COLOR;
|
|
3758
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
3759
|
+
if (videoElements.length > 0) {
|
|
3760
|
+
ctx.strokeStyle = CANVAS_STROKE_COLOR;
|
|
3761
|
+
ctx.lineWidth = offset / 2;
|
|
3762
|
+
ctx.strokeRect(0, 0, canvas.width, canvas.height);
|
|
3763
|
+
}
|
|
3764
|
+
if (videoElements.length === 1) {
|
|
3765
|
+
const video = videoElements[0];
|
|
3766
|
+
const { width, height } = getRenderDimensions(video, canvas.width - offset, canvas.height - offset);
|
|
3767
|
+
const xOffset = (canvas.width - width) / 2;
|
|
3768
|
+
const yOffset = (canvas.height - height) / 2;
|
|
3769
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3770
|
+
}
|
|
3771
|
+
if (videoElements.length === 2) {
|
|
3772
|
+
videoElements.forEach((video, index) => {
|
|
3773
|
+
const { width, height } = getRenderDimensions(
|
|
3774
|
+
video,
|
|
3775
|
+
canvas.width / 2 - offset,
|
|
3776
|
+
// This will be the max available width for each tile
|
|
3777
|
+
canvas.height - offset
|
|
3778
|
+
);
|
|
3779
|
+
const xOffset = (canvas.width / 2 - width) / 2 + canvas.width / 2 * index;
|
|
3780
|
+
const yOffset = (canvas.height - height) / 2;
|
|
3781
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3782
|
+
});
|
|
3783
|
+
const path = new Path2D();
|
|
3784
|
+
path.moveTo(canvas.width / 2, 0);
|
|
3785
|
+
path.lineTo(canvas.width / 2, canvas.height);
|
|
3786
|
+
ctx.stroke(path);
|
|
3787
|
+
}
|
|
3788
|
+
if (videoElements.length === 3) {
|
|
3789
|
+
videoElements.forEach((video, index) => {
|
|
3790
|
+
const { width, height } = getRenderDimensions(video, canvas.width / 2 - offset, canvas.height / 2 - offset);
|
|
3791
|
+
const xOffset = index < 2 ? (canvas.width / 2 - width) / 2 + canvas.width / 2 * index : canvas.width / 2 - width / 2;
|
|
3792
|
+
const yOffset = (index < 2 ? 0 : canvas.height / 2) + (canvas.height / 2 - height) / 2;
|
|
3793
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3794
|
+
});
|
|
3795
|
+
const path = new Path2D();
|
|
3796
|
+
path.moveTo(canvas.width / 2, 0);
|
|
3797
|
+
path.lineTo(canvas.width / 2, canvas.height / 2);
|
|
3798
|
+
ctx.stroke(path);
|
|
3799
|
+
path.moveTo(0, canvas.height / 2);
|
|
3800
|
+
path.lineTo(canvas.width, canvas.height / 2);
|
|
3801
|
+
ctx.stroke(path);
|
|
3802
|
+
}
|
|
3803
|
+
if (videoElements.length === 4) {
|
|
3804
|
+
videoElements.forEach((video, index) => {
|
|
3805
|
+
const { width, height } = getRenderDimensions(video, canvas.width / 2 - offset, canvas.height / 2 - offset);
|
|
3806
|
+
const xOffset = (canvas.width / 2 - width) / 2 + canvas.width / 2 * (index % 2);
|
|
3807
|
+
const yOffset = (index < 2 ? 0 : canvas.height / 2) + (canvas.height / 2 - height) / 2;
|
|
3808
|
+
ctx.drawImage(video, xOffset, yOffset, width, height);
|
|
3809
|
+
});
|
|
3810
|
+
const path = new Path2D();
|
|
3811
|
+
path.moveTo(canvas.width / 2, 0);
|
|
3812
|
+
path.lineTo(canvas.width / 2, canvas.height);
|
|
3813
|
+
ctx.stroke(path);
|
|
3814
|
+
path.moveTo(0, canvas.height / 2);
|
|
3815
|
+
path.lineTo(canvas.width, canvas.height / 2);
|
|
3816
|
+
ctx.stroke(path);
|
|
3817
|
+
}
|
|
3818
|
+
}
|
|
3819
|
+
function getRenderDimensions(video, width, height) {
|
|
3820
|
+
let finalWidth = video.videoWidth / video.videoHeight * height;
|
|
3821
|
+
let finalHeight = height;
|
|
3822
|
+
if (finalWidth > width) {
|
|
3823
|
+
finalWidth = width;
|
|
3824
|
+
finalHeight = video.videoHeight / video.videoWidth * width;
|
|
3825
|
+
}
|
|
3826
|
+
return { width: finalWidth, height: finalHeight };
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
// src/Prebuilt/components/PIP/PIPManager.js
|
|
3830
|
+
var MAX_NUMBER_OF_TILES_IN_PIP = 4;
|
|
3831
|
+
var DEFAULT_FPS = 30;
|
|
3832
|
+
var DEFAULT_CANVAS_WIDTH = 480;
|
|
3833
|
+
var DEFAULT_CANVAS_HEIGHT = 320;
|
|
3834
|
+
var LEAVE_EVENT_NAME = "leavepictureinpicture";
|
|
3835
|
+
var PIPStates = {
|
|
3836
|
+
starting: "starting",
|
|
3837
|
+
started: "started",
|
|
3838
|
+
stopping: "stopping",
|
|
3839
|
+
stopped: "stopped"
|
|
3840
|
+
};
|
|
3841
|
+
var PipManager = class {
|
|
3842
|
+
constructor() {
|
|
3843
|
+
__publicField(this, "listeners", /* @__PURE__ */ new Set());
|
|
3844
|
+
__publicField(this, "stop", () => __async(this, null, function* () {
|
|
3845
|
+
var _a7;
|
|
3846
|
+
if (this.state === PIPStates.stopped) {
|
|
3847
|
+
return;
|
|
3848
|
+
}
|
|
3849
|
+
this.state = PIPStates.stopping;
|
|
3850
|
+
(_a7 = this.pipVideo) == null ? void 0 : _a7.removeEventListener(LEAVE_EVENT_NAME, this.stop);
|
|
3851
|
+
if (this.timeoutRef) {
|
|
3852
|
+
workerTimers.clearTimeout(this.timeoutRef);
|
|
3853
|
+
this.timeoutRef = null;
|
|
3854
|
+
}
|
|
3855
|
+
if (this.isOn()) {
|
|
3856
|
+
this.exitPIP();
|
|
3857
|
+
}
|
|
3858
|
+
yield this.detachOldAttachNewTracks(this.tracksToShow, []);
|
|
3859
|
+
this.onStateChange(false);
|
|
3860
|
+
this.callListeners(false);
|
|
3861
|
+
this.reset();
|
|
3862
|
+
this.state = PIPStates.stopped;
|
|
3863
|
+
}));
|
|
3864
|
+
// ------- Private function --------------
|
|
3865
|
+
/**
|
|
3866
|
+
* @private {boolean} on - whether pip is on/off
|
|
3867
|
+
*/
|
|
3868
|
+
__publicField(this, "callListeners", (on) => {
|
|
3869
|
+
this.listeners.forEach((listener) => listener == null ? void 0 : listener(on));
|
|
3870
|
+
});
|
|
3871
|
+
this.reset();
|
|
3872
|
+
}
|
|
3873
|
+
listenToStateChange(cb) {
|
|
3874
|
+
this.listeners.add(cb);
|
|
3875
|
+
}
|
|
3876
|
+
/**
|
|
3877
|
+
* @private
|
|
3878
|
+
*/
|
|
3879
|
+
reset() {
|
|
3880
|
+
console.debug("resetting PIP state");
|
|
3881
|
+
resetPIPCanvasColors();
|
|
3882
|
+
this.canvas = null;
|
|
3883
|
+
this.pipVideo = null;
|
|
3884
|
+
this.timeoutRef = null;
|
|
3885
|
+
this.hmsActions = null;
|
|
3886
|
+
this.videoElements = [];
|
|
3887
|
+
this.tracksToShow = [];
|
|
3888
|
+
this.onStateChange = () => {
|
|
3889
|
+
};
|
|
3890
|
+
this.state = PIPStates.stopped;
|
|
3891
|
+
}
|
|
3892
|
+
/**
|
|
3893
|
+
* check if PIP is supported in this browser env
|
|
3894
|
+
*/
|
|
3895
|
+
isSupported() {
|
|
3896
|
+
return !!document.pictureInPictureEnabled && !isIOS && !(isMacOS && isSafari);
|
|
3897
|
+
}
|
|
3898
|
+
/**
|
|
3899
|
+
* check if pip is currently turned on
|
|
3900
|
+
*/
|
|
3901
|
+
isOn() {
|
|
3902
|
+
return !!document.pictureInPictureElement;
|
|
3903
|
+
}
|
|
3904
|
+
/**
|
|
3905
|
+
* request browser to start pip and start the render loop updating the pip
|
|
3906
|
+
* video element with peer tracks.
|
|
3907
|
+
* @param hmsActions
|
|
3908
|
+
* @param onStateChangeFn {function(bool):void} callback called to notify change in pip state
|
|
3909
|
+
*/
|
|
3910
|
+
start(hmsActions, onStateChangeFn) {
|
|
3911
|
+
return __async(this, null, function* () {
|
|
3912
|
+
if (!this.isSupported()) {
|
|
3913
|
+
throw new Error("pip is not supported on this browser");
|
|
3914
|
+
}
|
|
3915
|
+
console.debug("starting PIP, current state", this.state);
|
|
3916
|
+
if (this.state === PIPStates.started) {
|
|
3917
|
+
yield this.stop();
|
|
3918
|
+
} else if (this.state === PIPStates.starting) {
|
|
3919
|
+
return;
|
|
3920
|
+
}
|
|
3921
|
+
this.state = PIPStates.starting;
|
|
3922
|
+
try {
|
|
3923
|
+
yield this.init(hmsActions, onStateChangeFn);
|
|
3924
|
+
this.pipVideo.addEventListener(LEAVE_EVENT_NAME, this.stop);
|
|
3925
|
+
this.renderLoop();
|
|
3926
|
+
if (!this.isOn()) {
|
|
3927
|
+
yield this.requestPIP();
|
|
3928
|
+
}
|
|
3929
|
+
console.debug("pip started");
|
|
3930
|
+
this.state = PIPStates.started;
|
|
3931
|
+
this.onStateChange(true);
|
|
3932
|
+
this.callListeners(true);
|
|
3933
|
+
} catch (err) {
|
|
3934
|
+
console.error("error in request pip", err);
|
|
3935
|
+
this.state = PIPStates.stopped;
|
|
3936
|
+
}
|
|
3937
|
+
});
|
|
3938
|
+
}
|
|
3939
|
+
/**
|
|
3940
|
+
* @param peers {Array} All Remote Peers present in call.
|
|
3941
|
+
* @param tracksMap {Object} map of track id to track
|
|
3942
|
+
* */
|
|
3943
|
+
updatePeersAndTracks(peers, tracksMap) {
|
|
3944
|
+
return __async(this, null, function* () {
|
|
3945
|
+
if (!this.canvas) {
|
|
3946
|
+
return;
|
|
3947
|
+
}
|
|
3948
|
+
const newTracksToShowUnordered = this.pickTracksToShow(peers, tracksMap);
|
|
3949
|
+
const currentTracksShowing = this.tracksToShow;
|
|
3950
|
+
this.tracksToShow = this.orderNewTracksToShow(newTracksToShowUnordered, currentTracksShowing);
|
|
3951
|
+
try {
|
|
3952
|
+
yield this.detachOldAttachNewTracks(currentTracksShowing, this.tracksToShow, tracksMap);
|
|
3953
|
+
} catch (error) {
|
|
3954
|
+
console.error("error in detaching/attaching tracks", error);
|
|
3955
|
+
}
|
|
3956
|
+
});
|
|
3957
|
+
}
|
|
3958
|
+
/**
|
|
3959
|
+
* @private
|
|
3960
|
+
*/
|
|
3961
|
+
init(hmsActions, onStateChangeFn) {
|
|
3962
|
+
return __async(this, null, function* () {
|
|
3963
|
+
yield this.initMediaElements();
|
|
3964
|
+
this.hmsActions = hmsActions;
|
|
3965
|
+
this.onStateChange = onStateChangeFn;
|
|
3966
|
+
});
|
|
3967
|
+
}
|
|
3968
|
+
initMediaElements() {
|
|
3969
|
+
return __async(this, null, function* () {
|
|
3970
|
+
if (!this.canvas) {
|
|
3971
|
+
const { canvas, pipVideo } = this.initializeCanvasAndVideoElement();
|
|
3972
|
+
this.canvas = canvas;
|
|
3973
|
+
this.pipVideo = pipVideo;
|
|
3974
|
+
this.videoElements = this.initializeVideoElements();
|
|
3975
|
+
const videoPlayPromise = this.pipVideo.play();
|
|
3976
|
+
dummyChangeInCanvas(this.canvas);
|
|
3977
|
+
yield videoPlayPromise;
|
|
3978
|
+
}
|
|
3979
|
+
});
|
|
3980
|
+
}
|
|
3981
|
+
initializeCanvasAndVideoElement() {
|
|
3982
|
+
const canvas = document.createElement("canvas");
|
|
3983
|
+
canvas.width = DEFAULT_CANVAS_WIDTH;
|
|
3984
|
+
canvas.height = DEFAULT_CANVAS_HEIGHT;
|
|
3985
|
+
const pipVideo = document.createElement("video");
|
|
3986
|
+
pipVideo.width = DEFAULT_CANVAS_WIDTH;
|
|
3987
|
+
pipVideo.height = DEFAULT_CANVAS_HEIGHT;
|
|
3988
|
+
pipVideo.muted = true;
|
|
3989
|
+
pipVideo.srcObject = canvas.captureStream();
|
|
3990
|
+
return { canvas, pipVideo };
|
|
3991
|
+
}
|
|
3992
|
+
initializeVideoElements() {
|
|
3993
|
+
let videoElements = [];
|
|
3994
|
+
for (let i = 0; i < MAX_NUMBER_OF_TILES_IN_PIP; i++) {
|
|
3995
|
+
const videoElement = document.createElement("video");
|
|
3996
|
+
videoElement.autoplay = true;
|
|
3997
|
+
videoElement.playsinline = true;
|
|
3998
|
+
videoElements.push(videoElement);
|
|
3999
|
+
}
|
|
4000
|
+
return videoElements;
|
|
4001
|
+
}
|
|
4002
|
+
/**
|
|
4003
|
+
* render loop is responsible for rendering the video elements on canvas/pip.
|
|
4004
|
+
* in each loop current video elements are stitched and painted on canvas
|
|
4005
|
+
*/
|
|
4006
|
+
renderLoop() {
|
|
4007
|
+
const delay = 1e3 / DEFAULT_FPS;
|
|
4008
|
+
this.timeoutRef = workerTimers.setTimeout(() => {
|
|
4009
|
+
if (this.state === PIPStates.stopping || this.state === PIPStates.stopped) {
|
|
4010
|
+
return;
|
|
4011
|
+
}
|
|
4012
|
+
if (this.state === PIPStates.started) {
|
|
4013
|
+
drawVideoElementsOnCanvas(this.videoElements, this.canvas);
|
|
4014
|
+
}
|
|
4015
|
+
this.renderLoop();
|
|
4016
|
+
}, delay);
|
|
4017
|
+
}
|
|
4018
|
+
requestPIP() {
|
|
4019
|
+
return __async(this, null, function* () {
|
|
4020
|
+
try {
|
|
4021
|
+
if (this.isOn()) {
|
|
4022
|
+
this.exitPIP();
|
|
4023
|
+
}
|
|
4024
|
+
yield this.pipVideo.requestPictureInPicture();
|
|
4025
|
+
} catch (error) {
|
|
4026
|
+
console.error("error in requestpip", error, "state", this.state);
|
|
4027
|
+
throw error;
|
|
4028
|
+
}
|
|
4029
|
+
});
|
|
4030
|
+
}
|
|
4031
|
+
exitPIP() {
|
|
4032
|
+
document.exitPictureInPicture();
|
|
4033
|
+
}
|
|
4034
|
+
/**
|
|
4035
|
+
* Logic - pick only enabled video tracks
|
|
4036
|
+
* @param peers {Array<any>}
|
|
4037
|
+
* @param tracksMap {Record<string, any>}
|
|
4038
|
+
*/
|
|
4039
|
+
pickTracksToShow(peers, tracksMap) {
|
|
4040
|
+
var _a7;
|
|
4041
|
+
const tracksToShow = [];
|
|
4042
|
+
for (const peer of peers) {
|
|
4043
|
+
if (tracksToShow.length === MAX_NUMBER_OF_TILES_IN_PIP) {
|
|
4044
|
+
break;
|
|
4045
|
+
} else if (peer.videoTrack && ((_a7 = tracksMap[peer.videoTrack]) == null ? void 0 : _a7.enabled)) {
|
|
4046
|
+
tracksToShow.push(peer.videoTrack);
|
|
4047
|
+
}
|
|
4048
|
+
}
|
|
4049
|
+
return tracksToShow;
|
|
4050
|
+
}
|
|
4051
|
+
/**
|
|
4052
|
+
* there has to be a smart reordering of new tracks based on currently showing
|
|
4053
|
+
* ones to reduce unnecessary displacement. If someone was showing up both
|
|
4054
|
+
* earlier and now, it's a better UX to keep their position same instead
|
|
4055
|
+
* of letting it change.
|
|
4056
|
+
* The returned array is a shuffled version of newTracks with position of
|
|
4057
|
+
* tracks present in the old tracks intact.
|
|
4058
|
+
* eg. old = [1,5,9,3], new = [3,8,2,9], result = [8,2,9,3]
|
|
4059
|
+
* @param oldTracks {Array}
|
|
4060
|
+
* @param newTracks {Array}
|
|
4061
|
+
* @return {Array}
|
|
4062
|
+
*/
|
|
4063
|
+
orderNewTracksToShow(newTracks, oldTracks) {
|
|
4064
|
+
const betterNewTracks = [];
|
|
4065
|
+
const leftOvers = [];
|
|
4066
|
+
newTracks.forEach((track) => {
|
|
4067
|
+
const oldPosition = oldTracks.indexOf(track);
|
|
4068
|
+
if (oldPosition !== -1 && oldPosition < newTracks.length) {
|
|
4069
|
+
betterNewTracks[oldPosition] = track;
|
|
4070
|
+
} else {
|
|
4071
|
+
leftOvers.push(track);
|
|
4072
|
+
}
|
|
4073
|
+
});
|
|
4074
|
+
for (let i = 0; i < newTracks.length; i++) {
|
|
4075
|
+
if (!betterNewTracks[i]) {
|
|
4076
|
+
betterNewTracks[i] = leftOvers.shift();
|
|
4077
|
+
}
|
|
4078
|
+
}
|
|
4079
|
+
return betterNewTracks;
|
|
4080
|
+
}
|
|
4081
|
+
/**
|
|
4082
|
+
* call detach for tracks which no longer need to be shown and attach for
|
|
4083
|
+
* new ones which are to be shown now.
|
|
4084
|
+
* Note: oldTracks and newTracks are not necessarily of same length
|
|
4085
|
+
* @param oldTracks {Array<String>}
|
|
4086
|
+
* @param newTracks {Array<String>}
|
|
4087
|
+
* @param tracksMap {Record<String, any>}
|
|
4088
|
+
*/
|
|
4089
|
+
// eslint-disable-next-line complexity
|
|
4090
|
+
detachOldAttachNewTracks(oldTracks, newTracks, tracksMap = null) {
|
|
4091
|
+
return __async(this, null, function* () {
|
|
4092
|
+
const numTracks = Math.max(oldTracks.length, newTracks.length);
|
|
4093
|
+
for (let i = 0; i < numTracks; i++) {
|
|
4094
|
+
if (oldTracks[i] === newTracks[i]) {
|
|
4095
|
+
continue;
|
|
4096
|
+
} else if (oldTracks[i]) {
|
|
4097
|
+
if (!tracksMap || tracksMap[oldTracks[i]]) {
|
|
4098
|
+
yield this.hmsActions.detachVideo(oldTracks[i], this.videoElements[i]);
|
|
4099
|
+
}
|
|
4100
|
+
if (this.videoElements[i]) {
|
|
4101
|
+
this.videoElements[i].srcObject = null;
|
|
4102
|
+
}
|
|
4103
|
+
}
|
|
4104
|
+
if (newTracks[i]) {
|
|
4105
|
+
yield this.hmsActions.attachVideo(newTracks[i], this.videoElements[i]);
|
|
4106
|
+
}
|
|
4107
|
+
}
|
|
4108
|
+
});
|
|
4109
|
+
}
|
|
4110
|
+
};
|
|
4111
|
+
var PictureInPicture = new PipManager();
|
|
4112
|
+
|
|
4113
|
+
// src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts
|
|
4114
|
+
function useRoomLayoutScreen({
|
|
4115
|
+
screen
|
|
4116
|
+
}) {
|
|
4117
|
+
var _a7;
|
|
4118
|
+
const roomLayout = useRoomLayout();
|
|
4119
|
+
const screenProps = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7[screen];
|
|
4120
|
+
return screenProps;
|
|
4121
|
+
}
|
|
4122
|
+
function useRoomLayoutPreviewScreen() {
|
|
4123
|
+
var _a7;
|
|
4124
|
+
const screenProps = useRoomLayoutScreen({ screen: "preview" });
|
|
4125
|
+
const isPreviewScreenEnabled = !!screenProps;
|
|
4126
|
+
let elements;
|
|
4127
|
+
let screenType;
|
|
4128
|
+
if (isPreviewScreenEnabled) {
|
|
4129
|
+
screenType = Object.keys(screenProps)[0];
|
|
4130
|
+
elements = (_a7 = screenProps[screenType]) == null ? void 0 : _a7.elements;
|
|
4131
|
+
}
|
|
4132
|
+
return {
|
|
4133
|
+
isPreviewScreenEnabled,
|
|
4134
|
+
elements,
|
|
4135
|
+
screenType
|
|
4136
|
+
};
|
|
4137
|
+
}
|
|
4138
|
+
function useRoomLayoutConferencingScreen() {
|
|
4139
|
+
var _a7, _b7;
|
|
4140
|
+
const screenProps = useRoomLayoutScreen({ screen: "conferencing" }) || {};
|
|
4141
|
+
const screenType = Object.keys(screenProps)[0];
|
|
4142
|
+
const elements = (_a7 = screenProps[screenType]) == null ? void 0 : _a7.elements;
|
|
4143
|
+
const hideSections = ((_b7 = screenProps[screenType]) == null ? void 0 : _b7.hideSections) || [];
|
|
4144
|
+
return {
|
|
4145
|
+
hideSections,
|
|
4146
|
+
elements,
|
|
4147
|
+
screenType
|
|
4148
|
+
};
|
|
4149
|
+
}
|
|
4150
|
+
function useRoomLayoutLeaveScreen() {
|
|
4151
|
+
const screenProps = useRoomLayoutScreen({ screen: "leave" });
|
|
4152
|
+
const isLeaveScreenEnabled = !!screenProps;
|
|
4153
|
+
return {
|
|
4154
|
+
isLeaveScreenEnabled
|
|
4155
|
+
};
|
|
4156
|
+
}
|
|
4157
|
+
|
|
4158
|
+
// src/Prebuilt/components/hooks/useRedirectToLeave.tsx
|
|
4159
|
+
var useRedirectToLeave = () => {
|
|
4160
|
+
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
|
4161
|
+
const { onLeave } = useHMSPrebuiltContext();
|
|
4162
|
+
const params = useParams();
|
|
4163
|
+
const navigate = useNavigate();
|
|
4164
|
+
const redirect = useCallback7(
|
|
4165
|
+
(timeout = 0) => {
|
|
4166
|
+
setTimeout(() => {
|
|
4167
|
+
const prefix = isLeaveScreenEnabled ? "/leave/" : "/";
|
|
4168
|
+
if (params.role) {
|
|
4169
|
+
navigate(prefix + params.roomId + "/" + params.role);
|
|
4170
|
+
} else {
|
|
4171
|
+
navigate(prefix + params.roomId);
|
|
4172
|
+
}
|
|
4173
|
+
PictureInPicture.stop().catch(() => console.error("stopping pip"));
|
|
4174
|
+
ToastManager.clearAllToast();
|
|
4175
|
+
onLeave == null ? void 0 : onLeave();
|
|
4176
|
+
}, timeout);
|
|
4177
|
+
},
|
|
4178
|
+
[isLeaveScreenEnabled, navigate, onLeave, params.role, params.roomId]
|
|
4179
|
+
);
|
|
4180
|
+
return { redirectToLeave: redirect };
|
|
4181
|
+
};
|
|
4182
|
+
|
|
3725
4183
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
|
3726
4184
|
function Notifications() {
|
|
3727
4185
|
const notification = useHMSNotifications7();
|
|
3728
|
-
const navigate =
|
|
4186
|
+
const navigate = useNavigate2();
|
|
4187
|
+
const params = useParams2();
|
|
4188
|
+
const vanillaStore = useHMSVanillaStore4();
|
|
3729
4189
|
const subscribedNotifications = useSubscribedNotifications() || {};
|
|
3730
|
-
const isHeadless = useIsHeadless();
|
|
3731
4190
|
const roomState = useHMSStore8(selectRoomState3);
|
|
3732
4191
|
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
4192
|
+
const isNotificationDisabled = useIsNotificationDisabled();
|
|
4193
|
+
const { redirectToLeave } = useRedirectToLeave();
|
|
4194
|
+
const handleRoleChangeDenied = useCallback8((request) => {
|
|
4195
|
+
ToastManager.addToast({
|
|
4196
|
+
title: `${request.peerName} denied your request to join the ${request.role.name} role`,
|
|
4197
|
+
variant: "error"
|
|
4198
|
+
});
|
|
4199
|
+
}, []);
|
|
4200
|
+
useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
|
|
4201
|
+
useEffect16(() => {
|
|
4202
|
+
var _a7, _b7, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
4203
|
+
if (!notification || isNotificationDisabled) {
|
|
3736
4204
|
return;
|
|
3737
4205
|
}
|
|
3738
4206
|
switch (notification.type) {
|
|
@@ -3741,12 +4209,12 @@ function Notifications() {
|
|
|
3741
4209
|
return;
|
|
3742
4210
|
}
|
|
3743
4211
|
const metadata = getMetadata((_a7 = notification.data) == null ? void 0 : _a7.metadata);
|
|
3744
|
-
if (!(metadata == null ? void 0 : metadata.isHandRaised) || notification.data.isLocal
|
|
4212
|
+
if (!(metadata == null ? void 0 : metadata.isHandRaised) || notification.data.isLocal)
|
|
3745
4213
|
return;
|
|
3746
4214
|
console.debug("Metadata updated", notification.data);
|
|
3747
4215
|
if (!subscribedNotifications.METADATA_UPDATED)
|
|
3748
4216
|
return;
|
|
3749
|
-
ToastBatcher.showToast({ notification });
|
|
4217
|
+
ToastBatcher.showToast({ notification, type: "RAISE_HAND" });
|
|
3750
4218
|
break;
|
|
3751
4219
|
case HMSNotificationTypes7.NAME_UPDATED:
|
|
3752
4220
|
console.log(notification.data.id + " changed their name to " + notification.data.name);
|
|
@@ -3766,7 +4234,7 @@ function Notifications() {
|
|
|
3766
4234
|
{
|
|
3767
4235
|
onClick: () => {
|
|
3768
4236
|
ToastManager.removeToast(toastId);
|
|
3769
|
-
|
|
4237
|
+
navigate(`/${params.roomId}${params.role ? `/${params.role}` : ""}`);
|
|
3770
4238
|
}
|
|
3771
4239
|
},
|
|
3772
4240
|
"Rejoin"
|
|
@@ -3774,11 +4242,7 @@ function Notifications() {
|
|
|
3774
4242
|
close: false
|
|
3775
4243
|
});
|
|
3776
4244
|
}
|
|
3777
|
-
|
|
3778
|
-
const previewLocation = window.location.pathname.replace("meeting", "leave");
|
|
3779
|
-
ToastManager.clearAllToast();
|
|
3780
|
-
navigate(previewLocation);
|
|
3781
|
-
}, 2e3);
|
|
4245
|
+
redirectToLeave(1e3);
|
|
3782
4246
|
return;
|
|
3783
4247
|
}
|
|
3784
4248
|
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) {
|
|
@@ -3793,20 +4257,24 @@ function Notifications() {
|
|
|
3793
4257
|
title: `Error: ${(_k = notification.data) == null ? void 0 : _k.message} - ${(_l = notification.data) == null ? void 0 : _l.description}`
|
|
3794
4258
|
});
|
|
3795
4259
|
break;
|
|
3796
|
-
case HMSNotificationTypes7.ROLE_UPDATED:
|
|
4260
|
+
case HMSNotificationTypes7.ROLE_UPDATED: {
|
|
3797
4261
|
if ((_m = notification.data) == null ? void 0 : _m.isLocal) {
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
4262
|
+
const { prevRole } = vanillaStore.getState(selectPeerMetadata((_n = notification.data) == null ? void 0 : _n.id));
|
|
4263
|
+
if (prevRole !== ((_o = notification == null ? void 0 : notification.data) == null ? void 0 : _o.roleName)) {
|
|
4264
|
+
ToastManager.addToast({
|
|
4265
|
+
title: `You are now a ${notification.data.roleName}`
|
|
4266
|
+
});
|
|
4267
|
+
updateRoomLayoutForRole(notification.data.roleName);
|
|
4268
|
+
}
|
|
3802
4269
|
}
|
|
3803
4270
|
break;
|
|
4271
|
+
}
|
|
3804
4272
|
case HMSNotificationTypes7.CHANGE_TRACK_STATE_REQUEST:
|
|
3805
|
-
const track = (
|
|
4273
|
+
const track = (_p = notification.data) == null ? void 0 : _p.track;
|
|
3806
4274
|
if (!notification.data.enabled) {
|
|
3807
4275
|
ToastManager.addToast({
|
|
3808
4276
|
title: `Your ${track.source} ${track.type} was muted by
|
|
3809
|
-
${(
|
|
4277
|
+
${(_q = notification.data.requestedBy) == null ? void 0 : _q.name}.`
|
|
3810
4278
|
});
|
|
3811
4279
|
}
|
|
3812
4280
|
break;
|
|
@@ -3816,11 +4284,7 @@ function Notifications() {
|
|
|
3816
4284
|
title: `${notification.message}.
|
|
3817
4285
|
${notification.data.reason && `Reason: ${notification.data.reason}`}`
|
|
3818
4286
|
});
|
|
3819
|
-
|
|
3820
|
-
const leaveLocation = window.location.pathname.replace("meeting", "leave");
|
|
3821
|
-
navigate(leaveLocation);
|
|
3822
|
-
ToastManager.clearAllToast();
|
|
3823
|
-
}, 2e3);
|
|
4287
|
+
redirectToLeave(1e3);
|
|
3824
4288
|
break;
|
|
3825
4289
|
case HMSNotificationTypes7.DEVICE_CHANGE_UPDATE:
|
|
3826
4290
|
ToastManager.addToast({
|
|
@@ -3831,12 +4295,15 @@ function Notifications() {
|
|
|
3831
4295
|
break;
|
|
3832
4296
|
}
|
|
3833
4297
|
}, [notification, subscribedNotifications.ERROR, subscribedNotifications.METADATA_UPDATED]);
|
|
3834
|
-
|
|
4298
|
+
if (isNotificationDisabled) {
|
|
4299
|
+
return null;
|
|
4300
|
+
}
|
|
4301
|
+
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
4302
|
}
|
|
3836
4303
|
|
|
3837
4304
|
// src/Prebuilt/components/PostLeave.jsx
|
|
3838
4305
|
import React37 from "react";
|
|
3839
|
-
import { useNavigate as
|
|
4306
|
+
import { useNavigate as useNavigate3, useParams as useParams3 } from "react-router-dom";
|
|
3840
4307
|
import { ExitIcon } from "@100mslive/react-icons";
|
|
3841
4308
|
|
|
3842
4309
|
// src/Prebuilt/components/Header/Header.tsx
|
|
@@ -3845,7 +4312,7 @@ import { useMedia as useMedia4 } from "react-use";
|
|
|
3845
4312
|
import { HMSRoomState as HMSRoomState5, selectRoomState as selectRoomState5, useHMSStore as useHMSStore17 } from "@100mslive/react-sdk";
|
|
3846
4313
|
|
|
3847
4314
|
// src/Prebuilt/components/Header/HeaderComponents.jsx
|
|
3848
|
-
import React31, { useState as useState11 } from "react";
|
|
4315
|
+
import React31, { useEffect as useEffect17, useState as useState11 } from "react";
|
|
3849
4316
|
import { useMedia as useMedia2 } from "react-use";
|
|
3850
4317
|
import { selectDominantSpeaker, selectIsConnectedToRoom as selectIsConnectedToRoom2, useHMSStore as useHMSStore9 } from "@100mslive/react-sdk";
|
|
3851
4318
|
import { VolumeOneIcon } from "@100mslive/react-icons";
|
|
@@ -3878,6 +4345,11 @@ var Logo = () => {
|
|
|
3878
4345
|
const isMobile = useMedia2(config.media.md);
|
|
3879
4346
|
const isConnected = useHMSStore9(selectIsConnectedToRoom2);
|
|
3880
4347
|
const [hideImage, setHideImage] = useState11(false);
|
|
4348
|
+
useEffect17(() => {
|
|
4349
|
+
if (hideImage) {
|
|
4350
|
+
setHideImage(false);
|
|
4351
|
+
}
|
|
4352
|
+
}, [logo]);
|
|
3881
4353
|
if (isConnected && isMobile) {
|
|
3882
4354
|
return null;
|
|
3883
4355
|
}
|
|
@@ -3894,8 +4366,8 @@ var Logo = () => {
|
|
|
3894
4366
|
) : null;
|
|
3895
4367
|
};
|
|
3896
4368
|
|
|
3897
|
-
// src/Prebuilt/components/Header/StreamActions.
|
|
3898
|
-
import React34, { useCallback as
|
|
4369
|
+
// src/Prebuilt/components/Header/StreamActions.tsx
|
|
4370
|
+
import React34, { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef5, useState as useState13 } from "react";
|
|
3899
4371
|
import { useMedia as useMedia3 } from "react-use";
|
|
3900
4372
|
import {
|
|
3901
4373
|
HMSRoomState as HMSRoomState4,
|
|
@@ -3903,7 +4375,7 @@ import {
|
|
|
3903
4375
|
selectIsConnectedToRoom as selectIsConnectedToRoom3,
|
|
3904
4376
|
selectPermissions,
|
|
3905
4377
|
selectRoomState as selectRoomState4,
|
|
3906
|
-
useHMSActions as
|
|
4378
|
+
useHMSActions as useHMSActions12,
|
|
3907
4379
|
useHMSStore as useHMSStore15,
|
|
3908
4380
|
useRecordingStreaming as useRecordingStreaming2
|
|
3909
4381
|
} from "@100mslive/react-sdk";
|
|
@@ -4007,7 +4479,7 @@ var Sheet = {
|
|
|
4007
4479
|
};
|
|
4008
4480
|
|
|
4009
4481
|
// src/Prebuilt/components/Header/AdditionalRoomState.jsx
|
|
4010
|
-
import React33, { useState as
|
|
4482
|
+
import React33, { useState as useState12 } from "react";
|
|
4011
4483
|
import { selectLocalPeerID as selectLocalPeerID3, selectPeerSharingVideoPlaylist, useHMSStore as useHMSStore14, useScreenShare } from "@100mslive/react-sdk";
|
|
4012
4484
|
import {
|
|
4013
4485
|
AudioPlayerIcon,
|
|
@@ -4020,56 +4492,46 @@ import {
|
|
|
4020
4492
|
} from "@100mslive/react-icons";
|
|
4021
4493
|
|
|
4022
4494
|
// src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js
|
|
4023
|
-
import { useCallback as
|
|
4495
|
+
import { useCallback as useCallback10, useEffect as useEffect18, useMemo as useMemo2 } from "react";
|
|
4024
4496
|
import { selectLocalPeerID as selectLocalPeerID2, selectPeerByCondition, useHMSStore as useHMSStore11 } from "@100mslive/react-sdk";
|
|
4025
4497
|
|
|
4026
4498
|
// src/Prebuilt/components/hooks/useMetadata.jsx
|
|
4027
|
-
import { useCallback as
|
|
4028
|
-
import {
|
|
4499
|
+
import { useCallback as useCallback9 } from "react";
|
|
4500
|
+
import {
|
|
4501
|
+
selectLocalPeerID,
|
|
4502
|
+
selectPeerMetadata as selectPeerMetadata2,
|
|
4503
|
+
useHMSActions as useHMSActions9,
|
|
4504
|
+
useHMSStore as useHMSStore10,
|
|
4505
|
+
useHMSVanillaStore as useHMSVanillaStore5
|
|
4506
|
+
} from "@100mslive/react-sdk";
|
|
4029
4507
|
var useMyMetadata = () => {
|
|
4030
|
-
const hmsActions =
|
|
4508
|
+
const hmsActions = useHMSActions9();
|
|
4031
4509
|
const localPeerId = useHMSStore10(selectLocalPeerID);
|
|
4032
|
-
const
|
|
4033
|
-
const
|
|
4034
|
-
const [isBRBOn, setBRBOn] = useState12((metaData == null ? void 0 : metaData.isBRBOn) || false);
|
|
4510
|
+
const vanillaStore = useHMSVanillaStore5();
|
|
4511
|
+
const metaData = useHMSStore10(selectPeerMetadata2(localPeerId));
|
|
4035
4512
|
const update = (updatedFields) => __async(void 0, null, function* () {
|
|
4036
4513
|
try {
|
|
4037
|
-
|
|
4514
|
+
const currentMetadata = vanillaStore.getState(selectPeerMetadata2(localPeerId));
|
|
4515
|
+
yield hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));
|
|
4038
4516
|
return true;
|
|
4039
4517
|
} catch (error) {
|
|
4040
|
-
console.error("failed to update metadata ",
|
|
4518
|
+
console.error("failed to update metadata ", updatedFields);
|
|
4041
4519
|
}
|
|
4042
4520
|
});
|
|
4043
|
-
const toggleHandRaise =
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
if (success) {
|
|
4050
|
-
setBRBOn(brbUpdate);
|
|
4051
|
-
setHandRaised(!isHandRaised);
|
|
4052
|
-
}
|
|
4053
|
-
}), [isHandRaised, isBRBOn]);
|
|
4054
|
-
const toggleBRB = useCallback7(() => __async(void 0, null, function* () {
|
|
4055
|
-
const handRaiseUpdate = !isBRBOn ? false : isHandRaised;
|
|
4056
|
-
const success = yield update({
|
|
4057
|
-
isHandRaised: handRaiseUpdate,
|
|
4058
|
-
isBRBOn: !isBRBOn
|
|
4059
|
-
});
|
|
4060
|
-
if (success) {
|
|
4061
|
-
setBRBOn(!isBRBOn);
|
|
4062
|
-
setHandRaised(handRaiseUpdate);
|
|
4063
|
-
}
|
|
4064
|
-
}), [isHandRaised, isBRBOn]);
|
|
4521
|
+
const toggleHandRaise = useCallback9(() => __async(void 0, null, function* () {
|
|
4522
|
+
yield update({ isHandRaised: !(metaData == null ? void 0 : metaData.isHandRaised), isBRBOn: false });
|
|
4523
|
+
}), [metaData == null ? void 0 : metaData.isHandRaised]);
|
|
4524
|
+
const toggleBRB = useCallback9(() => __async(void 0, null, function* () {
|
|
4525
|
+
yield update({ isBRBOn: !(metaData == null ? void 0 : metaData.isBRBOn), isHandRaised: false });
|
|
4526
|
+
}), [metaData == null ? void 0 : metaData.isBRBOn]);
|
|
4065
4527
|
const setPrevRole = (role) => __async(void 0, null, function* () {
|
|
4066
4528
|
yield update({
|
|
4067
4529
|
prevRole: role
|
|
4068
4530
|
});
|
|
4069
4531
|
});
|
|
4070
4532
|
return {
|
|
4071
|
-
isHandRaised,
|
|
4072
|
-
isBRBOn,
|
|
4533
|
+
isHandRaised: !!(metaData == null ? void 0 : metaData.isHandRaised),
|
|
4534
|
+
isBRBOn: !!(metaData == null ? void 0 : metaData.isBRBOn),
|
|
4073
4535
|
metaData,
|
|
4074
4536
|
updateMetaData: update,
|
|
4075
4537
|
toggleHandRaise,
|
|
@@ -4087,7 +4549,7 @@ var useWhiteboardMetadata = () => {
|
|
|
4087
4549
|
const { updateMetaData } = useMyMetadata();
|
|
4088
4550
|
const whiteboardOwner = useHMSStore11(selectPeerByCondition(isWhiteboardOwner));
|
|
4089
4551
|
const amIWhiteboardOwner = useMemo2(() => localPeerID === (whiteboardOwner == null ? void 0 : whiteboardOwner.id), [localPeerID, whiteboardOwner]);
|
|
4090
|
-
const toggleWhiteboard =
|
|
4552
|
+
const toggleWhiteboard = useCallback10(() => __async(void 0, null, function* () {
|
|
4091
4553
|
if (!define_process_env_default.REACT_APP_PUSHER_APP_KEY) {
|
|
4092
4554
|
console.error("Cannot start whiteboard - Pusher Key unavailable");
|
|
4093
4555
|
}
|
|
@@ -4115,29 +4577,29 @@ var useWhiteboardMetadata = () => {
|
|
|
4115
4577
|
};
|
|
4116
4578
|
|
|
4117
4579
|
// src/Prebuilt/components/hooks/usePlaylistMusic.js
|
|
4118
|
-
import { useCallback as
|
|
4580
|
+
import { useCallback as useCallback11 } from "react";
|
|
4119
4581
|
import {
|
|
4120
4582
|
selectAudioPlaylist,
|
|
4121
4583
|
selectAudioPlaylistTrackByPeerID,
|
|
4122
4584
|
selectPeerSharingAudioPlaylist,
|
|
4123
|
-
useHMSActions as
|
|
4585
|
+
useHMSActions as useHMSActions10,
|
|
4124
4586
|
useHMSStore as useHMSStore12
|
|
4125
4587
|
} from "@100mslive/react-sdk";
|
|
4126
4588
|
var usePlaylistMusic = () => {
|
|
4127
4589
|
const peer = useHMSStore12(selectPeerSharingAudioPlaylist);
|
|
4128
4590
|
const track = useHMSStore12(selectAudioPlaylistTrackByPeerID(peer == null ? void 0 : peer.id));
|
|
4129
4591
|
const selection = useHMSStore12(selectAudioPlaylist.selectedItem);
|
|
4130
|
-
const hmsActions =
|
|
4131
|
-
const play =
|
|
4592
|
+
const hmsActions = useHMSActions10();
|
|
4593
|
+
const play = useCallback11(
|
|
4132
4594
|
(selectedId) => __async(void 0, null, function* () {
|
|
4133
4595
|
yield hmsActions.audioPlaylist.play(selectedId);
|
|
4134
4596
|
}),
|
|
4135
4597
|
[hmsActions]
|
|
4136
4598
|
);
|
|
4137
|
-
const pause =
|
|
4599
|
+
const pause = useCallback11(() => {
|
|
4138
4600
|
hmsActions.audioPlaylist.pause();
|
|
4139
4601
|
}, [hmsActions]);
|
|
4140
|
-
const setVolume =
|
|
4602
|
+
const setVolume = useCallback11(
|
|
4141
4603
|
(value) => {
|
|
4142
4604
|
hmsActions.setVolume(value, track == null ? void 0 : track.id);
|
|
4143
4605
|
},
|
|
@@ -4147,18 +4609,18 @@ var usePlaylistMusic = () => {
|
|
|
4147
4609
|
};
|
|
4148
4610
|
|
|
4149
4611
|
// src/Prebuilt/components/hooks/useScreenshareAudio.js
|
|
4150
|
-
import { useCallback as
|
|
4612
|
+
import { useCallback as useCallback12 } from "react";
|
|
4151
4613
|
import {
|
|
4152
4614
|
selectPeerSharingAudio,
|
|
4153
4615
|
selectScreenShareAudioByPeerID,
|
|
4154
|
-
useHMSActions as
|
|
4616
|
+
useHMSActions as useHMSActions11,
|
|
4155
4617
|
useHMSStore as useHMSStore13
|
|
4156
4618
|
} from "@100mslive/react-sdk";
|
|
4157
4619
|
var useScreenshareAudio = () => {
|
|
4158
|
-
const hmsActions =
|
|
4620
|
+
const hmsActions = useHMSActions11();
|
|
4159
4621
|
const peer = useHMSStore13(selectPeerSharingAudio);
|
|
4160
4622
|
const track = useHMSStore13(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
|
4161
|
-
const handleMute =
|
|
4623
|
+
const handleMute = useCallback12(() => {
|
|
4162
4624
|
if (!peer.isLocal) {
|
|
4163
4625
|
hmsActions.setVolume(!track.volume ? 100 : 0, track.id);
|
|
4164
4626
|
} else {
|
|
@@ -4194,7 +4656,7 @@ var AdditionalRoomState = () => {
|
|
|
4194
4656
|
const playlist = usePlaylistMusic();
|
|
4195
4657
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
|
4196
4658
|
const screenshareAudio = useScreenshareAudio();
|
|
4197
|
-
const [open, setOpen] =
|
|
4659
|
+
const [open, setOpen] = useState12(false);
|
|
4198
4660
|
const isPlaylistInactive = [
|
|
4199
4661
|
!playlist.peer || !playlist.track,
|
|
4200
4662
|
!((_a7 = playlist.peer) == null ? void 0 : _a7.isLocal) && !((_b7 = playlist.track) == null ? void 0 : _b7.enabled),
|
|
@@ -4281,19 +4743,19 @@ var AdditionalRoomState = () => {
|
|
|
4281
4743
|
))));
|
|
4282
4744
|
};
|
|
4283
4745
|
|
|
4284
|
-
// src/Prebuilt/components/Header/StreamActions.
|
|
4746
|
+
// src/Prebuilt/components/Header/StreamActions.tsx
|
|
4285
4747
|
var LiveStatus = () => {
|
|
4286
4748
|
var _a7;
|
|
4287
4749
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming2();
|
|
4288
4750
|
const hlsState = useHMSStore15(selectHLSState2);
|
|
4289
4751
|
const isMobile = useMedia3(config.media.md);
|
|
4290
4752
|
const intervalRef = useRef5(null);
|
|
4291
|
-
const [liveTime, setLiveTime] =
|
|
4292
|
-
const startTimer =
|
|
4753
|
+
const [liveTime, setLiveTime] = useState13(0);
|
|
4754
|
+
const startTimer = useCallback13(() => {
|
|
4293
4755
|
intervalRef.current = setInterval(() => {
|
|
4294
4756
|
var _a8;
|
|
4295
|
-
if (hlsState == null ? void 0 : hlsState.running) {
|
|
4296
|
-
setLiveTime(Date.now() -
|
|
4757
|
+
if ((hlsState == null ? void 0 : hlsState.running) && ((_a8 = hlsState == null ? void 0 : hlsState.variants[0]) == null ? void 0 : _a8.startedAt)) {
|
|
4758
|
+
setLiveTime(Date.now() - hlsState.variants[0].startedAt.getTime());
|
|
4297
4759
|
}
|
|
4298
4760
|
}, 1e3);
|
|
4299
4761
|
}, [hlsState == null ? void 0 : hlsState.running, hlsState == null ? void 0 : hlsState.variants]);
|
|
@@ -4343,6 +4805,7 @@ var RecordingStatus = () => {
|
|
|
4343
4805
|
return /* @__PURE__ */ React34.createElement(
|
|
4344
4806
|
Tooltip,
|
|
4345
4807
|
{
|
|
4808
|
+
boxCss: { zIndex: 1 },
|
|
4346
4809
|
title: getRecordingText({
|
|
4347
4810
|
isBrowserRecordingOn,
|
|
4348
4811
|
isServerRecordingOn,
|
|
@@ -4363,15 +4826,15 @@ var RecordingStatus = () => {
|
|
|
4363
4826
|
};
|
|
4364
4827
|
var StartRecording = () => {
|
|
4365
4828
|
const permissions = useHMSStore15(selectPermissions);
|
|
4366
|
-
const [open, setOpen] =
|
|
4829
|
+
const [open, setOpen] = useState13(false);
|
|
4367
4830
|
const [recordingStarted, setRecordingState] = useSetAppDataByKey(APP_DATA.recordingStarted);
|
|
4368
4831
|
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming2();
|
|
4369
|
-
const hmsActions =
|
|
4832
|
+
const hmsActions = useHMSActions12();
|
|
4370
4833
|
if (!(permissions == null ? void 0 : permissions.browserRecording) || isHLSRunning) {
|
|
4371
4834
|
return null;
|
|
4372
4835
|
}
|
|
4373
4836
|
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: "
|
|
4837
|
+
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
4838
|
Button,
|
|
4376
4839
|
{
|
|
4377
4840
|
"data-testid": "stop_recording_confirm",
|
|
@@ -4382,8 +4845,9 @@ var StartRecording = () => {
|
|
|
4382
4845
|
try {
|
|
4383
4846
|
yield hmsActions.stopRTMPAndRecording();
|
|
4384
4847
|
} catch (error) {
|
|
4848
|
+
const err = error;
|
|
4385
4849
|
ToastManager.addToast({
|
|
4386
|
-
title:
|
|
4850
|
+
title: err.message,
|
|
4387
4851
|
variant: "error"
|
|
4388
4852
|
});
|
|
4389
4853
|
}
|
|
@@ -4407,14 +4871,15 @@ var StartRecording = () => {
|
|
|
4407
4871
|
record: true
|
|
4408
4872
|
});
|
|
4409
4873
|
} catch (error) {
|
|
4410
|
-
|
|
4874
|
+
const err = error;
|
|
4875
|
+
if (err.message.includes("stream already running")) {
|
|
4411
4876
|
ToastManager.addToast({
|
|
4412
4877
|
title: "Recording already running",
|
|
4413
4878
|
variant: "error"
|
|
4414
4879
|
});
|
|
4415
4880
|
} else {
|
|
4416
4881
|
ToastManager.addToast({
|
|
4417
|
-
title:
|
|
4882
|
+
title: err.message,
|
|
4418
4883
|
variant: "error"
|
|
4419
4884
|
});
|
|
4420
4885
|
}
|
|
@@ -4432,7 +4897,10 @@ var StreamActions = () => {
|
|
|
4432
4897
|
const roomState = useHMSStore15(selectRoomState4);
|
|
4433
4898
|
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
4899
|
};
|
|
4435
|
-
var StopRecordingInSheet = ({
|
|
4900
|
+
var StopRecordingInSheet = ({
|
|
4901
|
+
onStopRecording,
|
|
4902
|
+
onClose
|
|
4903
|
+
}) => {
|
|
4436
4904
|
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
4905
|
Button,
|
|
4438
4906
|
{
|
|
@@ -4454,21 +4922,24 @@ import {
|
|
|
4454
4922
|
selectLocalVideoTrackID,
|
|
4455
4923
|
selectVideoTrackByID,
|
|
4456
4924
|
useDevices,
|
|
4457
|
-
useHMSActions as
|
|
4925
|
+
useHMSActions as useHMSActions13,
|
|
4458
4926
|
useHMSStore as useHMSStore16
|
|
4459
4927
|
} from "@100mslive/react-sdk";
|
|
4460
4928
|
import { CameraFlipIcon, CheckIcon as CheckIcon2, CrossIcon as CrossIcon5, SpeakerIcon } from "@100mslive/react-icons";
|
|
4461
4929
|
var CamaraFlipActions = () => {
|
|
4462
|
-
const actions =
|
|
4930
|
+
const actions = useHMSActions13();
|
|
4463
4931
|
const { allDevices } = useDevices();
|
|
4464
4932
|
const { videoInput } = allDevices;
|
|
4465
4933
|
const isVideoOn = useHMSStore16(selectIsLocalVideoEnabled2);
|
|
4466
4934
|
const videoTrackId = useHMSStore16(selectLocalVideoTrackID);
|
|
4467
4935
|
const localVideoTrack = useHMSStore16(selectVideoTrackByID(videoTrackId));
|
|
4936
|
+
if (!videoInput || !(videoInput == null ? void 0 : videoInput.length) || !(localVideoTrack == null ? void 0 : localVideoTrack.facingMode)) {
|
|
4937
|
+
return null;
|
|
4938
|
+
}
|
|
4468
4939
|
return /* @__PURE__ */ React35.createElement(Box, null, /* @__PURE__ */ React35.createElement(
|
|
4469
4940
|
IconButton_default,
|
|
4470
4941
|
{
|
|
4471
|
-
disabled: !
|
|
4942
|
+
disabled: !isVideoOn,
|
|
4472
4943
|
onClick: () => __async(void 0, null, function* () {
|
|
4473
4944
|
try {
|
|
4474
4945
|
yield actions.switchCamera();
|
|
@@ -4529,6 +5000,7 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
|
4529
5000
|
return /* @__PURE__ */ React35.createElement(
|
|
4530
5001
|
SelectWithLabel,
|
|
4531
5002
|
{
|
|
5003
|
+
key: audioDevice.deviceId,
|
|
4532
5004
|
label: audioDevice.label,
|
|
4533
5005
|
id: audioDevice.deviceId,
|
|
4534
5006
|
checked: audioDevice.deviceId === outputSelected,
|
|
@@ -4595,57 +5067,12 @@ var Header2 = () => {
|
|
|
4595
5067
|
));
|
|
4596
5068
|
};
|
|
4597
5069
|
|
|
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
5070
|
// src/Prebuilt/components/PostLeave.jsx
|
|
4644
5071
|
var PostLeave = () => {
|
|
4645
|
-
const navigate =
|
|
5072
|
+
const navigate = useNavigate3();
|
|
4646
5073
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
|
4647
5074
|
const { roomCode } = useHMSPrebuiltContext();
|
|
4648
|
-
const { roomId, role } =
|
|
5075
|
+
const { roomId, role } = useParams3();
|
|
4649
5076
|
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
|
4650
5077
|
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
5078
|
Flex,
|
|
@@ -4691,13 +5118,14 @@ var PostLeave = () => {
|
|
|
4691
5118
|
};
|
|
4692
5119
|
var PostLeave_default = PostLeave;
|
|
4693
5120
|
|
|
4694
|
-
// src/Prebuilt/components/Preview/PreviewContainer.
|
|
5121
|
+
// src/Prebuilt/components/Preview/PreviewContainer.tsx
|
|
4695
5122
|
import React56 from "react";
|
|
4696
|
-
import { useNavigate as
|
|
5123
|
+
import { useNavigate as useNavigate4, useParams as useParams4 } from "react-router-dom";
|
|
4697
5124
|
import { useSearchParam } from "react-use";
|
|
4698
5125
|
|
|
4699
|
-
// src/Prebuilt/components/Preview/PreviewJoin.
|
|
4700
|
-
import React55, { Fragment as Fragment6, Suspense, useCallback as
|
|
5126
|
+
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
|
5127
|
+
import React55, { Fragment as Fragment6, Suspense, useCallback as useCallback17, useEffect as useEffect24, useState as useState19 } from "react";
|
|
5128
|
+
import { useMedia as useMedia10 } from "react-use";
|
|
4701
5129
|
import {
|
|
4702
5130
|
HMSRoomState as HMSRoomState7,
|
|
4703
5131
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled5,
|
|
@@ -4705,7 +5133,7 @@ import {
|
|
|
4705
5133
|
selectRoomState as selectRoomState7,
|
|
4706
5134
|
selectVideoTrackByID as selectVideoTrackByID5,
|
|
4707
5135
|
useAVToggle as useAVToggle2,
|
|
4708
|
-
useHMSStore as
|
|
5136
|
+
useHMSStore as useHMSStore26,
|
|
4709
5137
|
useParticipants,
|
|
4710
5138
|
usePreviewJoin,
|
|
4711
5139
|
useRecordingStreaming as useRecordingStreaming4
|
|
@@ -4722,7 +5150,7 @@ import {
|
|
|
4722
5150
|
selectVideoTrackByID as selectVideoTrackByID2,
|
|
4723
5151
|
useAVToggle,
|
|
4724
5152
|
useDevices as useDevices2,
|
|
4725
|
-
useHMSActions as
|
|
5153
|
+
useHMSActions as useHMSActions14,
|
|
4726
5154
|
useHMSStore as useHMSStore18
|
|
4727
5155
|
} from "@100mslive/react-sdk";
|
|
4728
5156
|
import { CameraFlipIcon as CameraFlipIcon2, MicOffIcon, MicOnIcon as MicOnIcon3, VideoOffIcon, VideoOnIcon } from "@100mslive/react-icons";
|
|
@@ -4738,6 +5166,10 @@ var IconSection = styled(IconButton_default, {
|
|
|
4738
5166
|
borderTopRightRadius: 0,
|
|
4739
5167
|
borderColor: "$border_default",
|
|
4740
5168
|
borderBottomRightRadius: 0,
|
|
5169
|
+
position: "relative",
|
|
5170
|
+
"&:not([disabled]):focus-visible": {
|
|
5171
|
+
zIndex: 1
|
|
5172
|
+
},
|
|
4741
5173
|
"@md": {
|
|
4742
5174
|
mx: 0,
|
|
4743
5175
|
borderTopRightRadius: "$1",
|
|
@@ -4753,8 +5185,9 @@ var OptionsSection = styled(IconButton_default, {
|
|
|
4753
5185
|
borderColor: "$border_default",
|
|
4754
5186
|
borderBottomLeftRadius: 0,
|
|
4755
5187
|
borderLeftWidth: 0,
|
|
5188
|
+
position: "relative",
|
|
4756
5189
|
"&:not([disabled]):focus-visible": {
|
|
4757
|
-
|
|
5190
|
+
zIndex: 1
|
|
4758
5191
|
},
|
|
4759
5192
|
"@md": {
|
|
4760
5193
|
display: "none"
|
|
@@ -4857,16 +5290,17 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4857
5290
|
title: audioInput2.label
|
|
4858
5291
|
}));
|
|
4859
5292
|
const { isLocalVideoEnabled, isLocalAudioEnabled, toggleAudio, toggleVideo } = useAVToggle();
|
|
4860
|
-
const actions =
|
|
5293
|
+
const actions = useHMSActions14();
|
|
4861
5294
|
const videoTrackId = useHMSStore18(selectLocalVideoTrackID2);
|
|
4862
5295
|
const localVideoTrack = useHMSStore18(selectVideoTrackByID2(videoTrackId));
|
|
4863
5296
|
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(
|
|
5297
|
+
const hasAudioDevices = (audioInput == null ? void 0 : audioInput.length) > 0;
|
|
5298
|
+
const hasVideoDevices = (videoInput == null ? void 0 : videoInput.length) > 0;
|
|
5299
|
+
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
5300
|
IconButton_default,
|
|
4868
5301
|
{
|
|
4869
5302
|
active: isLocalAudioEnabled,
|
|
5303
|
+
disabled: !toggleAudio,
|
|
4870
5304
|
onClick: toggleAudio,
|
|
4871
5305
|
key: "toggleAudio",
|
|
4872
5306
|
"data-testid": "audio_btn",
|
|
@@ -4877,7 +5311,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4877
5311
|
IconButtonWithOptions,
|
|
4878
5312
|
{
|
|
4879
5313
|
options: formattedAudioInputList,
|
|
4880
|
-
disabled: !
|
|
5314
|
+
disabled: !toggleAudio,
|
|
4881
5315
|
onDisabledClick: toggleAudio,
|
|
4882
5316
|
tooltipMessage: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)`,
|
|
4883
5317
|
icon: !isLocalAudioEnabled ? /* @__PURE__ */ React39.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React39.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" }),
|
|
@@ -4885,11 +5319,12 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4885
5319
|
onClick: toggleAudio,
|
|
4886
5320
|
key: "toggleAudio"
|
|
4887
5321
|
}
|
|
4888
|
-
) : null, toggleVideo ? hideOptions ? /* @__PURE__ */ React39.createElement(Tooltip, { title: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)` }, /* @__PURE__ */ React39.createElement(
|
|
5322
|
+
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */ React39.createElement(Tooltip, { title: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)` }, /* @__PURE__ */ React39.createElement(
|
|
4889
5323
|
IconButton_default,
|
|
4890
5324
|
{
|
|
4891
5325
|
key: "toggleVideo",
|
|
4892
5326
|
active: isLocalVideoEnabled,
|
|
5327
|
+
disabled: !toggleVideo,
|
|
4893
5328
|
onClick: toggleVideo,
|
|
4894
5329
|
"data-testid": "video_btn",
|
|
4895
5330
|
className: "__cancel-drag-event"
|
|
@@ -4898,7 +5333,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
4898
5333
|
)) : /* @__PURE__ */ React39.createElement(
|
|
4899
5334
|
IconButtonWithOptions,
|
|
4900
5335
|
{
|
|
4901
|
-
disabled: !
|
|
5336
|
+
disabled: !toggleVideo,
|
|
4902
5337
|
onDisabledClick: toggleVideo,
|
|
4903
5338
|
options: formattedVideoInputList,
|
|
4904
5339
|
tooltipMessage: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)`,
|
|
@@ -4941,11 +5376,11 @@ var Chip = ({
|
|
|
4941
5376
|
};
|
|
4942
5377
|
var Chip_default = Chip;
|
|
4943
5378
|
|
|
4944
|
-
// src/Prebuilt/components/Connection/TileConnection.
|
|
5379
|
+
// src/Prebuilt/components/Connection/TileConnection.tsx
|
|
4945
5380
|
import React42 from "react";
|
|
4946
5381
|
import { PinIcon, SpotlightIcon } from "@100mslive/react-icons";
|
|
4947
5382
|
|
|
4948
|
-
// src/Prebuilt/components/Connection/ConnectionIndicator.
|
|
5383
|
+
// src/Prebuilt/components/Connection/ConnectionIndicator.tsx
|
|
4949
5384
|
import React41 from "react";
|
|
4950
5385
|
import { selectConnectionQualityByPeerID as selectConnectionQualityByPeerID2, useHMSStore as useHMSStore19 } from "@100mslive/react-sdk";
|
|
4951
5386
|
import { PoorConnectivityIcon as PoorConnectivityIcon2 } from "@100mslive/react-icons";
|
|
@@ -4978,14 +5413,13 @@ var getColor = (position, connectionScore, defaultColor, theme2) => {
|
|
|
4978
5413
|
return defaultColor;
|
|
4979
5414
|
};
|
|
4980
5415
|
|
|
4981
|
-
// src/Prebuilt/components/Connection/ConnectionIndicator.
|
|
5416
|
+
// src/Prebuilt/components/Connection/ConnectionIndicator.tsx
|
|
4982
5417
|
var Wrapper = styled("span", {
|
|
4983
5418
|
width: "28px",
|
|
4984
5419
|
height: "28px",
|
|
4985
5420
|
display: "flex",
|
|
4986
5421
|
alignItems: "center",
|
|
4987
5422
|
justifyContent: "center",
|
|
4988
|
-
backgroundColor: "$background_dim",
|
|
4989
5423
|
borderRadius: "$round",
|
|
4990
5424
|
variants: {
|
|
4991
5425
|
isTile: {
|
|
@@ -4996,7 +5430,11 @@ var Wrapper = styled("span", {
|
|
|
4996
5430
|
}
|
|
4997
5431
|
}
|
|
4998
5432
|
});
|
|
4999
|
-
var ConnectionIndicator = ({
|
|
5433
|
+
var ConnectionIndicator = ({
|
|
5434
|
+
peerId,
|
|
5435
|
+
isTile = false,
|
|
5436
|
+
hideBg = false
|
|
5437
|
+
}) => {
|
|
5000
5438
|
var _a7;
|
|
5001
5439
|
const downlinkQuality = (_a7 = useHMSStore19(selectConnectionQualityByPeerID2(peerId))) == null ? void 0 : _a7.downlinkQuality;
|
|
5002
5440
|
const { theme: theme2 } = useTheme();
|
|
@@ -5008,7 +5446,7 @@ var ConnectionIndicator = ({ peerId, isTile = false }) => {
|
|
|
5008
5446
|
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
5447
|
}
|
|
5010
5448
|
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(
|
|
5449
|
+
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
5450
|
"svg",
|
|
5013
5451
|
{
|
|
5014
5452
|
width: size,
|
|
@@ -5056,19 +5494,26 @@ var ConnectionIndicator = ({ peerId, isTile = false }) => {
|
|
|
5056
5494
|
)));
|
|
5057
5495
|
};
|
|
5058
5496
|
|
|
5059
|
-
// src/Prebuilt/components/Connection/TileConnection.
|
|
5060
|
-
var TileConnection = ({
|
|
5061
|
-
|
|
5497
|
+
// src/Prebuilt/components/Connection/TileConnection.tsx
|
|
5498
|
+
var TileConnection = ({
|
|
5499
|
+
name,
|
|
5500
|
+
peerId,
|
|
5501
|
+
hideLabel,
|
|
5502
|
+
width,
|
|
5503
|
+
spotlighted,
|
|
5504
|
+
pinned
|
|
5505
|
+
}) => {
|
|
5506
|
+
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
5507
|
Text,
|
|
5063
5508
|
{
|
|
5064
5509
|
css: __spreadValues({
|
|
5065
5510
|
c: "$on_surface_high",
|
|
5066
5511
|
verticalAlign: "baseline"
|
|
5067
|
-
}, textEllipsis(width - 60)),
|
|
5512
|
+
}, width ? textEllipsis(width - 60) : {}),
|
|
5068
5513
|
variant: "xs"
|
|
5069
5514
|
},
|
|
5070
5515
|
name
|
|
5071
|
-
)), /* @__PURE__ */ React42.createElement(ConnectionIndicator, { isTile: true, peerId })) : null);
|
|
5516
|
+
)), /* @__PURE__ */ React42.createElement(ConnectionIndicator, { isTile: true, peerId, hideBg: true })) : null);
|
|
5072
5517
|
};
|
|
5073
5518
|
var IconWrapper = styled("div", { c: "$on_surface_high", ml: "$3", mt: "$1" });
|
|
5074
5519
|
var Wrapper2 = styled("div", {
|
|
@@ -5088,7 +5533,7 @@ var Wrapper2 = styled("div", {
|
|
|
5088
5533
|
var TileConnection_default = TileConnection;
|
|
5089
5534
|
|
|
5090
5535
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
|
5091
|
-
import React48, { useCallback as
|
|
5536
|
+
import React48, { useCallback as useCallback15, useEffect as useEffect21, useState as useState15 } from "react";
|
|
5092
5537
|
import { useMedia as useMedia5 } from "react-use";
|
|
5093
5538
|
import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons";
|
|
5094
5539
|
|
|
@@ -5096,7 +5541,7 @@ import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons
|
|
|
5096
5541
|
import { GridFourIcon, NotificationsIcon, SettingsIcon } from "@100mslive/react-icons";
|
|
5097
5542
|
|
|
5098
5543
|
// src/Prebuilt/components/Settings/DeviceSettings.jsx
|
|
5099
|
-
import React44, { Fragment as Fragment3, useEffect as useEffect20, useRef as useRef6, useState as
|
|
5544
|
+
import React44, { Fragment as Fragment3, useEffect as useEffect20, useRef as useRef6, useState as useState14 } from "react";
|
|
5100
5545
|
import {
|
|
5101
5546
|
DeviceType as DeviceType3,
|
|
5102
5547
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled3,
|
|
@@ -5226,7 +5671,7 @@ var Settings = ({ setHide }) => {
|
|
|
5226
5671
|
};
|
|
5227
5672
|
var DeviceSelector = ({ title, devices, selection, onChange, icon, children = null }) => {
|
|
5228
5673
|
var _a7, _b7;
|
|
5229
|
-
const [open, setOpen] =
|
|
5674
|
+
const [open, setOpen] = useState14(false);
|
|
5230
5675
|
const selectionBg = useDropdownSelection();
|
|
5231
5676
|
const ref = useRef6(null);
|
|
5232
5677
|
return /* @__PURE__ */ React44.createElement(Box, { css: { mb: "$10" } }, /* @__PURE__ */ React44.createElement(Text, { css: { mb: "$4" } }, title), /* @__PURE__ */ React44.createElement(
|
|
@@ -5284,7 +5729,7 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
|
5284
5729
|
var TEST_AUDIO_URL = "https://100ms.live/test-audio.wav";
|
|
5285
5730
|
var TestAudio = ({ id }) => {
|
|
5286
5731
|
const audioRef = useRef6(null);
|
|
5287
|
-
const [playing, setPlaying] =
|
|
5732
|
+
const [playing, setPlaying] = useState14(false);
|
|
5288
5733
|
useEffect20(() => {
|
|
5289
5734
|
if (audioRef.current && id) {
|
|
5290
5735
|
try {
|
|
@@ -5322,8 +5767,8 @@ var TestAudio = ({ id }) => {
|
|
|
5322
5767
|
var DeviceSettings_default = Settings;
|
|
5323
5768
|
|
|
5324
5769
|
// src/Prebuilt/components/Settings/LayoutSettings.jsx
|
|
5325
|
-
import React46, { useCallback as
|
|
5326
|
-
import { selectIsLocalScreenShared, selectIsLocalVideoEnabled as selectIsLocalVideoEnabled4, useHMSActions as
|
|
5770
|
+
import React46, { useCallback as useCallback14 } from "react";
|
|
5771
|
+
import { selectIsLocalScreenShared, selectIsLocalVideoEnabled as selectIsLocalVideoEnabled4, useHMSActions as useHMSActions15, useHMSStore as useHMSStore21 } from "@100mslive/react-sdk";
|
|
5327
5772
|
|
|
5328
5773
|
// src/Prebuilt/components/Settings/SwitchWithLabel.jsx
|
|
5329
5774
|
import React45 from "react";
|
|
@@ -5365,11 +5810,11 @@ var SwitchWithLabel_default = SwitchWithLabel;
|
|
|
5365
5810
|
|
|
5366
5811
|
// src/Prebuilt/components/Settings/LayoutSettings.jsx
|
|
5367
5812
|
var LayoutSettings = () => {
|
|
5368
|
-
const hmsActions =
|
|
5813
|
+
const hmsActions = useHMSActions15();
|
|
5369
5814
|
const isLocalVideoEnabled = useHMSStore21(selectIsLocalVideoEnabled4);
|
|
5370
5815
|
const isLocalScreenShared = useHMSStore21(selectIsLocalScreenShared);
|
|
5371
5816
|
const [{ isAudioOnly, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings();
|
|
5372
|
-
const toggleIsAudioOnly =
|
|
5817
|
+
const toggleIsAudioOnly = useCallback14(
|
|
5373
5818
|
(isAudioOnlyModeOn) => __async(void 0, null, function* () {
|
|
5374
5819
|
if (isAudioOnlyModeOn) {
|
|
5375
5820
|
isLocalVideoEnabled && (yield hmsActions.setLocalVideoEnabled(false));
|
|
@@ -5500,10 +5945,10 @@ var settingsList = [
|
|
|
5500
5945
|
var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ */ React48.createElement(React48.Fragment, null) }) => {
|
|
5501
5946
|
const mediaQueryLg = config.media.md;
|
|
5502
5947
|
const isMobile = useMedia5(mediaQueryLg);
|
|
5503
|
-
const [showSetting, setShowSetting] =
|
|
5948
|
+
const [showSetting, setShowSetting] = useState15(
|
|
5504
5949
|
() => settingsList.reduce((obj, { tabName }) => __spreadProps(__spreadValues({}, obj), { [tabName]: true }), {})
|
|
5505
5950
|
);
|
|
5506
|
-
const hideSettingByTabName =
|
|
5951
|
+
const hideSettingByTabName = useCallback15(
|
|
5507
5952
|
(key) => (hide) => setShowSetting((prev) => __spreadProps(__spreadValues({}, prev), { [key]: !hide })),
|
|
5508
5953
|
[setShowSetting]
|
|
5509
5954
|
);
|
|
@@ -5512,11 +5957,11 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
|
5512
5957
|
hideSettingByTabName("layout")(true);
|
|
5513
5958
|
}
|
|
5514
5959
|
}, [screenType, hideSettingByTabName]);
|
|
5515
|
-
const [selection, setSelection] =
|
|
5960
|
+
const [selection, setSelection] = useState15(() => {
|
|
5516
5961
|
var _a7;
|
|
5517
5962
|
return (_a7 = Object.keys(showSetting).find((key) => showSetting[key])) != null ? _a7 : "";
|
|
5518
5963
|
});
|
|
5519
|
-
const resetSelection =
|
|
5964
|
+
const resetSelection = useCallback15(() => {
|
|
5520
5965
|
setSelection("");
|
|
5521
5966
|
}, []);
|
|
5522
5967
|
useEffect21(() => {
|
|
@@ -5700,26 +6145,25 @@ var SettingsContentHeader = ({ children, isMobile, onBack }) => {
|
|
|
5700
6145
|
var SettingsModal_default = SettingsModal;
|
|
5701
6146
|
|
|
5702
6147
|
// src/Prebuilt/components/VideoTile.jsx
|
|
5703
|
-
import React53, { Fragment as Fragment5, useCallback as
|
|
5704
|
-
import { useMedia as useMedia8 } from "react-use";
|
|
6148
|
+
import React53, { Fragment as Fragment5, useCallback as useCallback16, useEffect as useEffect23, useMemo as useMemo3, useRef as useRef7, useState as useState18 } from "react";
|
|
5705
6149
|
import {
|
|
5706
6150
|
selectAudioTrackByPeerID as selectAudioTrackByPeerID2,
|
|
5707
6151
|
selectIsPeerAudioEnabled,
|
|
5708
6152
|
selectLocalPeerID as selectLocalPeerID5,
|
|
5709
|
-
selectPeerMetadata as
|
|
6153
|
+
selectPeerMetadata as selectPeerMetadata3,
|
|
5710
6154
|
selectPeerNameByID,
|
|
5711
6155
|
selectSessionStore as selectSessionStore3,
|
|
5712
6156
|
selectTrackAudioByID,
|
|
5713
6157
|
selectVideoTrackByID as selectVideoTrackByID4,
|
|
5714
6158
|
selectVideoTrackByPeerID as selectVideoTrackByPeerID3,
|
|
5715
6159
|
useHMSStore as useHMSStore25,
|
|
5716
|
-
useHMSVanillaStore as
|
|
6160
|
+
useHMSVanillaStore as useHMSVanillaStore6
|
|
5717
6161
|
} from "@100mslive/react-sdk";
|
|
5718
6162
|
import { BrbTileIcon, HandIcon as HandIcon3, MicOffIcon as MicOffIcon3 } from "@100mslive/react-icons";
|
|
5719
6163
|
|
|
5720
6164
|
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
|
5721
|
-
import React52, { useState as
|
|
5722
|
-
import { useMedia as
|
|
6165
|
+
import React52, { useState as useState17 } from "react";
|
|
6166
|
+
import { useMedia as useMedia8 } from "react-use";
|
|
5723
6167
|
import {
|
|
5724
6168
|
selectLocalPeerID as selectLocalPeerID4,
|
|
5725
6169
|
selectPeerByID as selectPeerByID2,
|
|
@@ -5732,9 +6176,9 @@ import {
|
|
|
5732
6176
|
import { CrossIcon as CrossIcon8, VerticalMenuIcon as VerticalMenuIcon2 } from "@100mslive/react-icons";
|
|
5733
6177
|
|
|
5734
6178
|
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
|
5735
|
-
import React50, { useState as
|
|
6179
|
+
import React50, { useState as useState16 } from "react";
|
|
5736
6180
|
import { useMedia as useMedia6 } from "react-use";
|
|
5737
|
-
import { selectLocalPeerName, useHMSActions as
|
|
6181
|
+
import { selectLocalPeerName, useHMSActions as useHMSActions16, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
|
5738
6182
|
|
|
5739
6183
|
// src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx
|
|
5740
6184
|
import React49 from "react";
|
|
@@ -5764,6 +6208,7 @@ var ChangeNameContent = ({
|
|
|
5764
6208
|
color: "$on_surface_high",
|
|
5765
6209
|
fontWeight: "$semiBold",
|
|
5766
6210
|
display: "flex",
|
|
6211
|
+
pb: "$4",
|
|
5767
6212
|
"@md": { px: "$8", borderBottom: "1px solid $border_default" }
|
|
5768
6213
|
}
|
|
5769
6214
|
},
|
|
@@ -5794,6 +6239,9 @@ var ChangeNameContent = ({
|
|
|
5794
6239
|
onKeyDown: (e) => __async(void 0, null, function* () {
|
|
5795
6240
|
if (e.key === "Enter" && currentName.trim().length > 0 && currentName !== localPeerName) {
|
|
5796
6241
|
e.preventDefault();
|
|
6242
|
+
if (isMobile) {
|
|
6243
|
+
return;
|
|
6244
|
+
}
|
|
5797
6245
|
changeName();
|
|
5798
6246
|
}
|
|
5799
6247
|
})
|
|
@@ -5841,9 +6289,9 @@ var ChangeNameContent = ({
|
|
|
5841
6289
|
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
|
5842
6290
|
var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
|
5843
6291
|
const [previewPreference, setPreviewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW);
|
|
5844
|
-
const hmsActions =
|
|
6292
|
+
const hmsActions = useHMSActions16();
|
|
5845
6293
|
const localPeerName = useHMSStore22(selectLocalPeerName);
|
|
5846
|
-
const [currentName, setCurrentName] =
|
|
6294
|
+
const [currentName, setCurrentName] = useState16(localPeerName);
|
|
5847
6295
|
const isMobile = useMedia6(config.media.md);
|
|
5848
6296
|
const changeName = () => __async(void 0, null, function* () {
|
|
5849
6297
|
const name = currentName.trim();
|
|
@@ -5882,12 +6330,13 @@ var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
|
|
5882
6330
|
|
|
5883
6331
|
// src/Prebuilt/components/TileMenu/TileMenuContent.jsx
|
|
5884
6332
|
import React51, { Fragment as Fragment4 } from "react";
|
|
6333
|
+
import { useMedia as useMedia7 } from "react-use";
|
|
5885
6334
|
import {
|
|
5886
6335
|
selectPermissions as selectPermissions2,
|
|
5887
6336
|
selectSessionStore as selectSessionStore2,
|
|
5888
6337
|
selectTrackByID as selectTrackByID2,
|
|
5889
|
-
useCustomEvent,
|
|
5890
|
-
useHMSActions as
|
|
6338
|
+
useCustomEvent as useCustomEvent2,
|
|
6339
|
+
useHMSActions as useHMSActions17,
|
|
5891
6340
|
useHMSStore as useHMSStore23,
|
|
5892
6341
|
useRemoteAVToggle
|
|
5893
6342
|
} from "@100mslive/react-sdk";
|
|
@@ -5912,7 +6361,7 @@ var SpotlightActions = ({
|
|
|
5912
6361
|
return;
|
|
5913
6362
|
}
|
|
5914
6363
|
}) => {
|
|
5915
|
-
const hmsActions =
|
|
6364
|
+
const hmsActions = useHMSActions17();
|
|
5916
6365
|
const spotlightPeerId = useHMSStore23(selectSessionStore2(SESSION_STORE_KEY.SPOTLIGHT));
|
|
5917
6366
|
const isTileSpotlighted = spotlightPeerId === peerId;
|
|
5918
6367
|
const setSpotlightPeerId = (peer) => hmsActions.sessionStore.set(SESSION_STORE_KEY.SPOTLIGHT, peer).catch((err) => ToastManager.addToast({ title: err.description }));
|
|
@@ -5929,7 +6378,7 @@ var SpotlightActions = ({
|
|
|
5929
6378
|
onSpotLightClick();
|
|
5930
6379
|
}
|
|
5931
6380
|
},
|
|
5932
|
-
/* @__PURE__ */ React51.createElement(StarIcon,
|
|
6381
|
+
/* @__PURE__ */ React51.createElement(StarIcon, { height: 20, width: 20 }),
|
|
5933
6382
|
/* @__PURE__ */ React51.createElement("span", null, isTileSpotlighted ? "Remove from Spotlight" : "Spotlight Tile for everyone")
|
|
5934
6383
|
);
|
|
5935
6384
|
};
|
|
@@ -5946,18 +6395,18 @@ var PinActions = ({ audioTrackID, videoTrackID }) => {
|
|
|
5946
6395
|
css: spacingCSS,
|
|
5947
6396
|
onClick: () => isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID)
|
|
5948
6397
|
},
|
|
5949
|
-
/* @__PURE__ */ React51.createElement(PinIcon2,
|
|
6398
|
+
/* @__PURE__ */ React51.createElement(PinIcon2, { height: 20, width: 20 }),
|
|
5950
6399
|
/* @__PURE__ */ React51.createElement("span", null, isTilePinned ? "Unpin" : "Pin", " Tile for myself")
|
|
5951
6400
|
));
|
|
5952
6401
|
};
|
|
5953
6402
|
var MinimiseInset = () => {
|
|
5954
6403
|
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,
|
|
6404
|
+
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
6405
|
};
|
|
5957
6406
|
var SimulcastLayers = ({ trackId }) => {
|
|
5958
6407
|
var _a7;
|
|
5959
6408
|
const track = useHMSStore23(selectTrackByID2(trackId));
|
|
5960
|
-
const actions =
|
|
6409
|
+
const actions = useHMSActions17();
|
|
5961
6410
|
const bg = useDropdownSelection();
|
|
5962
6411
|
if (!((_a7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _a7.length) || track.degraded || !track.enabled) {
|
|
5963
6412
|
return null;
|
|
@@ -6022,7 +6471,7 @@ var SimulcastLayers = ({ trackId }) => {
|
|
|
6022
6471
|
))));
|
|
6023
6472
|
};
|
|
6024
6473
|
var TileMenuContent = (props) => {
|
|
6025
|
-
const actions =
|
|
6474
|
+
const actions = useHMSActions17();
|
|
6026
6475
|
const { removeOthers } = useHMSStore23(selectPermissions2);
|
|
6027
6476
|
const {
|
|
6028
6477
|
videoTrackID,
|
|
@@ -6044,9 +6493,10 @@ var TileMenuContent = (props) => {
|
|
|
6044
6493
|
audioTrackID,
|
|
6045
6494
|
videoTrackID
|
|
6046
6495
|
);
|
|
6047
|
-
const { sendEvent } =
|
|
6496
|
+
const { sendEvent } = useCustomEvent2({
|
|
6048
6497
|
type: REMOTE_STOP_SCREENSHARE_TYPE
|
|
6049
6498
|
});
|
|
6499
|
+
const isMobile = useMedia7(config.media.md);
|
|
6050
6500
|
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
6501
|
StyledMenuTile.ItemButton,
|
|
6052
6502
|
{
|
|
@@ -6055,7 +6505,7 @@ var TileMenuContent = (props) => {
|
|
|
6055
6505
|
closeSheetOnClick();
|
|
6056
6506
|
}
|
|
6057
6507
|
},
|
|
6058
|
-
/* @__PURE__ */ React51.createElement(PencilIcon,
|
|
6508
|
+
/* @__PURE__ */ React51.createElement(PencilIcon, { height: 20, width: 20 }),
|
|
6059
6509
|
/* @__PURE__ */ React51.createElement(Text, { variant: "sm", css: { "@md": { fontWeight: "$semiBold" }, c: "$on_surface_high" } }, "Change Name")
|
|
6060
6510
|
)) : /* @__PURE__ */ React51.createElement(React51.Fragment, null, toggleVideo ? /* @__PURE__ */ React51.createElement(
|
|
6061
6511
|
StyledMenuTile.ItemButton,
|
|
@@ -6067,7 +6517,7 @@ var TileMenuContent = (props) => {
|
|
|
6067
6517
|
},
|
|
6068
6518
|
"data-testid": isVideoEnabled ? "mute_video_participant_btn" : "unmute_video_participant_btn"
|
|
6069
6519
|
},
|
|
6070
|
-
isVideoEnabled ? /* @__PURE__ */ React51.createElement(VideoOnIcon3,
|
|
6520
|
+
isVideoEnabled ? /* @__PURE__ */ React51.createElement(VideoOnIcon3, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(VideoOffIcon2, { height: 20, width: 20 }),
|
|
6071
6521
|
/* @__PURE__ */ React51.createElement("span", null, isVideoEnabled ? "Mute" : "Request Unmute")
|
|
6072
6522
|
) : null, toggleAudio ? /* @__PURE__ */ React51.createElement(
|
|
6073
6523
|
StyledMenuTile.ItemButton,
|
|
@@ -6079,9 +6529,9 @@ var TileMenuContent = (props) => {
|
|
|
6079
6529
|
},
|
|
6080
6530
|
"data-testid": isVideoEnabled ? "mute_audio_participant_btn" : "unmute_audio_participant_btn"
|
|
6081
6531
|
},
|
|
6082
|
-
isAudioEnabled ? /* @__PURE__ */ React51.createElement(MicOnIcon5,
|
|
6532
|
+
isAudioEnabled ? /* @__PURE__ */ React51.createElement(MicOnIcon5, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(MicOffIcon2, { height: 20, width: 20 }),
|
|
6083
6533
|
/* @__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,
|
|
6534
|
+
) : 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
6535
|
StyledMenuTile.RemoveItem,
|
|
6086
6536
|
{
|
|
6087
6537
|
css: __spreadProps(__spreadValues({}, spacingCSS), { borderTop: "none" }),
|
|
@@ -6094,7 +6544,7 @@ var TileMenuContent = (props) => {
|
|
|
6094
6544
|
}),
|
|
6095
6545
|
"data-testid": "remove_participant_btn"
|
|
6096
6546
|
},
|
|
6097
|
-
/* @__PURE__ */ React51.createElement(RemoveUserIcon,
|
|
6547
|
+
/* @__PURE__ */ React51.createElement(RemoveUserIcon, { height: 20, width: 20 }),
|
|
6098
6548
|
/* @__PURE__ */ React51.createElement("span", null, "Remove Participant")
|
|
6099
6549
|
) : null, removeOthers && isScreenshare ? /* @__PURE__ */ React51.createElement(
|
|
6100
6550
|
StyledMenuTile.RemoveItem,
|
|
@@ -6105,7 +6555,7 @@ var TileMenuContent = (props) => {
|
|
|
6105
6555
|
},
|
|
6106
6556
|
css: spacingCSS
|
|
6107
6557
|
},
|
|
6108
|
-
/* @__PURE__ */ React51.createElement(ShareScreenIcon2,
|
|
6558
|
+
/* @__PURE__ */ React51.createElement(ShareScreenIcon2, { height: 20, width: 20 }),
|
|
6109
6559
|
/* @__PURE__ */ React51.createElement("span", null, "Stop Screenshare")
|
|
6110
6560
|
) : null);
|
|
6111
6561
|
};
|
|
@@ -6140,7 +6590,7 @@ var TileMenu = ({
|
|
|
6140
6590
|
enableSpotlightingPeer = true
|
|
6141
6591
|
}) => {
|
|
6142
6592
|
var _a7, _b7;
|
|
6143
|
-
const [open, setOpen] =
|
|
6593
|
+
const [open, setOpen] = useState17(false);
|
|
6144
6594
|
const { theme: theme2 } = useTheme();
|
|
6145
6595
|
const localPeerID = useHMSStore24(selectLocalPeerID4);
|
|
6146
6596
|
const isLocal = localPeerID === peerID;
|
|
@@ -6151,9 +6601,9 @@ var TileMenu = ({
|
|
|
6151
6601
|
const showPinAction = audioTrackID || videoTrackID && isPrimaryVideoTrack;
|
|
6152
6602
|
const track = useHMSStore24(selectTrackByID3(videoTrackID));
|
|
6153
6603
|
const hideSimulcastLayers = !((_b7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _b7.length) || track.degraded || !track.enabled;
|
|
6154
|
-
const isMobile =
|
|
6604
|
+
const isMobile = useMedia8(config.media.md);
|
|
6155
6605
|
const peer = useHMSStore24(selectPeerByID2(peerID));
|
|
6156
|
-
const [showNameChangeModal, setShowNameChangeModal] =
|
|
6606
|
+
const [showNameChangeModal, setShowNameChangeModal] = useState17(false);
|
|
6157
6607
|
useDropdownList({ open, name: "TileMenu" });
|
|
6158
6608
|
if (!(removeOthers || toggleAudio || toggleVideo || setVolume || showPinAction) && hideSimulcastLayers) {
|
|
6159
6609
|
return null;
|
|
@@ -6175,7 +6625,7 @@ var TileMenu = ({
|
|
|
6175
6625
|
StyledMenuTile.Trigger,
|
|
6176
6626
|
{
|
|
6177
6627
|
"data-testid": "participant_menu_btn",
|
|
6178
|
-
css: { bg: `${theme2.colors.background_dim.value}A3
|
|
6628
|
+
css: { bg: `${theme2.colors.background_dim.value}A3`, p: "$2", w: "unset", h: "unset" },
|
|
6179
6629
|
onClick: (e) => e.stopPropagation(),
|
|
6180
6630
|
className: isMobile ? "__cancel-drag-event" : ""
|
|
6181
6631
|
},
|
|
@@ -6239,7 +6689,8 @@ var Tile = ({
|
|
|
6239
6689
|
enableSpotlightingPeer = true,
|
|
6240
6690
|
hideParticipantNameOnTile = false,
|
|
6241
6691
|
roundedVideoTile = true,
|
|
6242
|
-
hideAudioMuteOnTile = false
|
|
6692
|
+
hideAudioMuteOnTile = false,
|
|
6693
|
+
hideMetadataOnTile = false
|
|
6243
6694
|
}) => {
|
|
6244
6695
|
const trackSelector = trackId ? selectVideoTrackByID4(trackId) : selectVideoTrackByPeerID3(peerId);
|
|
6245
6696
|
const track = useHMSStore25(trackSelector);
|
|
@@ -6251,7 +6702,7 @@ var Tile = ({
|
|
|
6251
6702
|
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
|
6252
6703
|
const isAudioMuted = !useHMSStore25(selectIsPeerAudioEnabled(peerId));
|
|
6253
6704
|
const isVideoMuted = !(track == null ? void 0 : track.enabled);
|
|
6254
|
-
const [isMouseHovered, setIsMouseHovered] =
|
|
6705
|
+
const [isMouseHovered, setIsMouseHovered] = useState18(false);
|
|
6255
6706
|
const isVideoDegraded = track == null ? void 0 : track.degraded;
|
|
6256
6707
|
const isLocal = localPeerID === peerId;
|
|
6257
6708
|
const [pinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
|
@@ -6266,7 +6717,7 @@ var Tile = ({
|
|
|
6266
6717
|
track,
|
|
6267
6718
|
isLocal
|
|
6268
6719
|
});
|
|
6269
|
-
const onHoverHandler =
|
|
6720
|
+
const onHoverHandler = useCallback16((event) => {
|
|
6270
6721
|
setIsMouseHovered(event.type === "mouseenter");
|
|
6271
6722
|
}, []);
|
|
6272
6723
|
const isTileBigEnoughToShowStats = height >= 180 && width >= 180;
|
|
@@ -6281,7 +6732,6 @@ var Tile = ({
|
|
|
6281
6732
|
}
|
|
6282
6733
|
return "large";
|
|
6283
6734
|
}, [width, height]);
|
|
6284
|
-
const isMobile = useMedia8(config.media.md);
|
|
6285
6735
|
return /* @__PURE__ */ React53.createElement(
|
|
6286
6736
|
StyledVideoTile.Root,
|
|
6287
6737
|
{
|
|
@@ -6300,7 +6750,7 @@ var Tile = ({
|
|
|
6300
6750
|
css: containerCSS
|
|
6301
6751
|
},
|
|
6302
6752
|
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
|
-
|
|
6753
|
+
/* @__PURE__ */ React53.createElement(
|
|
6304
6754
|
Video,
|
|
6305
6755
|
{
|
|
6306
6756
|
trackId: track == null ? void 0 : track.id,
|
|
@@ -6314,19 +6764,16 @@ var Tile = ({
|
|
|
6314
6764
|
bg: "transparent"
|
|
6315
6765
|
}
|
|
6316
6766
|
}
|
|
6317
|
-
)
|
|
6767
|
+
),
|
|
6318
6768
|
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(
|
|
6769
|
+
!hideAudioMuteOnTile ? isAudioMuted ? /* @__PURE__ */ React53.createElement(
|
|
6323
6770
|
StyledVideoTile.AudioIndicator,
|
|
6324
6771
|
{
|
|
6325
6772
|
"data-testid": "participant_audio_mute_icon",
|
|
6326
6773
|
size: width && height && (width < 180 || height < 180) ? "small" : "medium"
|
|
6327
6774
|
},
|
|
6328
6775
|
/* @__PURE__ */ React53.createElement(MicOffIcon3, null)
|
|
6329
|
-
) : /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id }),
|
|
6776
|
+
) : /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id }) : null,
|
|
6330
6777
|
isMouseHovered || isDragabble ? /* @__PURE__ */ React53.createElement(
|
|
6331
6778
|
TileMenu_default,
|
|
6332
6779
|
{
|
|
@@ -6337,8 +6784,8 @@ var Tile = ({
|
|
|
6337
6784
|
enableSpotlightingPeer
|
|
6338
6785
|
}
|
|
6339
6786
|
) : null,
|
|
6340
|
-
/* @__PURE__ */ React53.createElement(PeerMetadata, { peerId }),
|
|
6341
|
-
|
|
6787
|
+
!hideMetadataOnTile && /* @__PURE__ */ React53.createElement(PeerMetadata, { peerId }),
|
|
6788
|
+
/* @__PURE__ */ React53.createElement(
|
|
6342
6789
|
TileConnection_default,
|
|
6343
6790
|
{
|
|
6344
6791
|
hideLabel: hideParticipantNameOnTile,
|
|
@@ -6353,7 +6800,7 @@ var Tile = ({
|
|
|
6353
6800
|
) : null
|
|
6354
6801
|
);
|
|
6355
6802
|
};
|
|
6356
|
-
var metaStyles = { top: "$4", left: "$4" };
|
|
6803
|
+
var metaStyles = { top: "$4", left: "$4", width: "$14", height: "$14" };
|
|
6357
6804
|
var heightAnimation = (value) => keyframes({
|
|
6358
6805
|
"50%": {
|
|
6359
6806
|
transform: `scale3d(1,${value},1)`
|
|
@@ -6363,7 +6810,7 @@ var heightAnimation = (value) => keyframes({
|
|
|
6363
6810
|
}
|
|
6364
6811
|
});
|
|
6365
6812
|
var AudioLevelIndicator = ({ trackId, value, delay }) => {
|
|
6366
|
-
const vanillaStore =
|
|
6813
|
+
const vanillaStore = useHMSVanillaStore6();
|
|
6367
6814
|
const ref = useRef7();
|
|
6368
6815
|
useEffect23(() => {
|
|
6369
6816
|
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
|
@@ -6392,22 +6839,19 @@ var AudioLevel = ({ trackId }) => {
|
|
|
6392
6839
|
return /* @__PURE__ */ React53.createElement(StyledVideoTile.AudioIndicator, null, /* @__PURE__ */ React53.createElement(Flex, { align: "center", justify: "center", css: { gap: "$2" } }, [3, 2, 3].map((v, i) => /* @__PURE__ */ React53.createElement(AudioLevelIndicator, { trackId, value: v, delay: i * 0.15, key: i }))));
|
|
6393
6840
|
};
|
|
6394
6841
|
var PeerMetadata = ({ peerId }) => {
|
|
6395
|
-
const metaData = useHMSStore25(
|
|
6842
|
+
const metaData = useHMSStore25(selectPeerMetadata3(peerId));
|
|
6396
6843
|
const isHandRaised = (metaData == null ? void 0 : metaData.isHandRaised) || false;
|
|
6397
6844
|
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:
|
|
6845
|
+
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
6846
|
};
|
|
6400
6847
|
var VideoTile = React53.memo(Tile);
|
|
6401
|
-
var showAudioMuted = ({ hideAudioMute, isAudioMuted }) => {
|
|
6402
|
-
return isAudioMuted && !hideAudioMute;
|
|
6403
|
-
};
|
|
6404
6848
|
var VideoTile_default = VideoTile;
|
|
6405
6849
|
|
|
6406
6850
|
// src/Prebuilt/components/Preview/PreviewForm.tsx
|
|
6407
6851
|
import React54 from "react";
|
|
6408
6852
|
import { useMedia as useMedia9 } from "react-use";
|
|
6409
6853
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType2 } from "@100mslive/types-prebuilt/elements/join_form";
|
|
6410
|
-
import {
|
|
6854
|
+
import { useRecordingStreaming as useRecordingStreaming3 } from "@100mslive/react-sdk";
|
|
6411
6855
|
import { RadioIcon } from "@100mslive/react-icons";
|
|
6412
6856
|
var PreviewForm = ({
|
|
6413
6857
|
name,
|
|
@@ -6421,13 +6865,11 @@ var PreviewForm = ({
|
|
|
6421
6865
|
const formSubmit = (e) => {
|
|
6422
6866
|
e.preventDefault();
|
|
6423
6867
|
};
|
|
6424
|
-
const
|
|
6425
|
-
const isMobile = useMedia9(mediaQueryLg);
|
|
6868
|
+
const isMobile = useMedia9(config.media.md);
|
|
6426
6869
|
const { isHLSRunning } = useRecordingStreaming3();
|
|
6427
|
-
const permissions = useHMSStore26(selectPermissions4);
|
|
6428
6870
|
const layout = useRoomLayout();
|
|
6429
6871
|
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
|
|
6872
|
+
const showGoLive = (joinForm == null ? void 0 : joinForm.join_btn_type) === JoinForm_JoinBtnType2.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning;
|
|
6431
6873
|
return /* @__PURE__ */ React54.createElement(
|
|
6432
6874
|
Form,
|
|
6433
6875
|
{
|
|
@@ -6448,6 +6890,9 @@ var PreviewForm = ({
|
|
|
6448
6890
|
onKeyDown: (e) => {
|
|
6449
6891
|
if (e.key === "Enter" && name.trim().length > 0) {
|
|
6450
6892
|
e.preventDefault();
|
|
6893
|
+
if (isMobile) {
|
|
6894
|
+
return;
|
|
6895
|
+
}
|
|
6451
6896
|
onJoin();
|
|
6452
6897
|
}
|
|
6453
6898
|
}
|
|
@@ -6469,8 +6914,8 @@ var Form = styled("form", {
|
|
|
6469
6914
|
});
|
|
6470
6915
|
var PreviewForm_default = PreviewForm;
|
|
6471
6916
|
|
|
6472
|
-
// src/Prebuilt/components/Preview/PreviewJoin.
|
|
6473
|
-
var VirtualBackground = React55.lazy(() => import("./VirtualBackground-
|
|
6917
|
+
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
|
6918
|
+
var VirtualBackground = React55.lazy(() => import("./VirtualBackground-37FXUPYO.js"));
|
|
6474
6919
|
var getParticipantChipContent = (peerCount = 0) => {
|
|
6475
6920
|
if (peerCount === 0) {
|
|
6476
6921
|
return "You are the first to join";
|
|
@@ -6478,7 +6923,12 @@ var getParticipantChipContent = (peerCount = 0) => {
|
|
|
6478
6923
|
const formattedNum = getFormattedCount(peerCount);
|
|
6479
6924
|
return `${formattedNum} other${parseInt(formattedNum) === 1 ? "" : "s"} in the session`;
|
|
6480
6925
|
};
|
|
6481
|
-
var PreviewJoin = ({
|
|
6926
|
+
var PreviewJoin = ({
|
|
6927
|
+
onJoin,
|
|
6928
|
+
skipPreview,
|
|
6929
|
+
initialName,
|
|
6930
|
+
asRole
|
|
6931
|
+
}) => {
|
|
6482
6932
|
var _a7, _b7, _c;
|
|
6483
6933
|
const [previewPreference, setPreviewPreference] = useUserPreferences(
|
|
6484
6934
|
UserPreferencesKeys.PREVIEW,
|
|
@@ -6486,9 +6936,9 @@ var PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
|
6486
6936
|
);
|
|
6487
6937
|
const { isStreamingOn } = useRecordingStreaming4();
|
|
6488
6938
|
const authToken = useAuthToken();
|
|
6489
|
-
const [name, setName] =
|
|
6490
|
-
const {
|
|
6491
|
-
const [previewError, setPreviewError] =
|
|
6939
|
+
const [name, setName] = useState19(initialName || previewPreference.name);
|
|
6940
|
+
const { toggleAudio, toggleVideo } = useAVToggle2();
|
|
6941
|
+
const [previewError, setPreviewError] = useState19(false);
|
|
6492
6942
|
const { endpoints } = useHMSPrebuiltContext();
|
|
6493
6943
|
const { peerCount } = useParticipants();
|
|
6494
6944
|
const { enableJoin, preview, join } = usePreviewJoin({
|
|
@@ -6508,16 +6958,14 @@ var PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
|
6508
6958
|
},
|
|
6509
6959
|
asRole
|
|
6510
6960
|
});
|
|
6511
|
-
const roomState =
|
|
6512
|
-
const savePreferenceAndJoin =
|
|
6961
|
+
const roomState = useHMSStore26(selectRoomState7);
|
|
6962
|
+
const savePreferenceAndJoin = useCallback17(() => {
|
|
6513
6963
|
setPreviewPreference({
|
|
6514
|
-
name
|
|
6515
|
-
isAudioMuted: !isLocalAudioEnabled,
|
|
6516
|
-
isVideoMuted: !isLocalVideoEnabled
|
|
6964
|
+
name
|
|
6517
6965
|
});
|
|
6518
6966
|
join();
|
|
6519
6967
|
onJoin && onJoin();
|
|
6520
|
-
}, [join,
|
|
6968
|
+
}, [join, name, setPreviewPreference, onJoin]);
|
|
6521
6969
|
const roomLayout = useRoomLayout();
|
|
6522
6970
|
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
6971
|
useEffect24(() => {
|
|
@@ -6569,14 +7017,7 @@ var PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
|
6569
7017
|
}
|
|
6570
7018
|
},
|
|
6571
7019
|
/* @__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(
|
|
7020
|
+
) : null, /* @__PURE__ */ React55.createElement(Box, { css: { w: "100%", maxWidth: "640px" } }, /* @__PURE__ */ React55.createElement(PreviewControls, { hideSettings: !toggleVideo && !toggleAudio }), /* @__PURE__ */ React55.createElement(
|
|
6580
7021
|
PreviewForm_default,
|
|
6581
7022
|
{
|
|
6582
7023
|
name,
|
|
@@ -6595,23 +7036,26 @@ var Container3 = styled("div", __spreadProps(__spreadValues({
|
|
|
6595
7036
|
px: "$10"
|
|
6596
7037
|
}));
|
|
6597
7038
|
var PreviewTile = ({ name, error }) => {
|
|
6598
|
-
const localPeer =
|
|
7039
|
+
const localPeer = useHMSStore26(selectLocalPeer);
|
|
6599
7040
|
const { isLocalAudioEnabled, toggleAudio } = useAVToggle2();
|
|
6600
|
-
const isVideoOn =
|
|
7041
|
+
const isVideoOn = useHMSStore26(selectIsLocalVideoEnabled5);
|
|
6601
7042
|
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
|
6602
7043
|
const trackSelector = selectVideoTrackByID5(localPeer == null ? void 0 : localPeer.videoTrack);
|
|
6603
|
-
const track =
|
|
7044
|
+
const track = useHMSStore26(trackSelector);
|
|
6604
7045
|
const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
|
|
7046
|
+
const videoTrack = useHMSStore26(selectVideoTrackByID5(localPeer == null ? void 0 : localPeer.videoTrack));
|
|
7047
|
+
const isMobile = useMedia10(config.media.md);
|
|
7048
|
+
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
|
6605
7049
|
return /* @__PURE__ */ React55.createElement(
|
|
6606
7050
|
StyledVideoTile.Container,
|
|
6607
7051
|
{
|
|
6608
7052
|
css: {
|
|
6609
7053
|
bg: "$surface_default",
|
|
6610
|
-
aspectRatio
|
|
6611
|
-
|
|
7054
|
+
aspectRatio,
|
|
7055
|
+
height: "min(640px, 40vh)",
|
|
7056
|
+
maxWidth: "640px",
|
|
6612
7057
|
overflow: "clip",
|
|
6613
7058
|
"@md": {
|
|
6614
|
-
aspectRatio: 9 / 16,
|
|
6615
7059
|
width: "min(220px, 70vw)",
|
|
6616
7060
|
maxWidth: "100%",
|
|
6617
7061
|
my: "$4"
|
|
@@ -6626,11 +7070,11 @@ var PreviewTile = ({ name, error }) => {
|
|
|
6626
7070
|
"data-testid": "preview_tile"
|
|
6627
7071
|
}
|
|
6628
7072
|
), !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 })
|
|
7073
|
+
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
7074
|
);
|
|
6631
7075
|
};
|
|
6632
7076
|
var PreviewControls = ({ hideSettings }) => {
|
|
6633
|
-
const
|
|
7077
|
+
const isMobile = useMedia10(config.media.md);
|
|
6634
7078
|
return /* @__PURE__ */ React55.createElement(
|
|
6635
7079
|
Flex,
|
|
6636
7080
|
{
|
|
@@ -6640,26 +7084,26 @@ var PreviewControls = ({ hideSettings }) => {
|
|
|
6640
7084
|
mt: "$8"
|
|
6641
7085
|
}
|
|
6642
7086
|
},
|
|
6643
|
-
/* @__PURE__ */ React55.createElement(Flex, { css: { gap: "$4" } }, /* @__PURE__ */ React55.createElement(AudioVideoToggle,
|
|
7087
|
+
/* @__PURE__ */ React55.createElement(Flex, { css: { gap: "$4" } }, /* @__PURE__ */ React55.createElement(AudioVideoToggle, null), /* @__PURE__ */ React55.createElement(Suspense, { fallback: "" }, !isMobile ? /* @__PURE__ */ React55.createElement(VirtualBackground, null) : null)),
|
|
6644
7088
|
!hideSettings ? /* @__PURE__ */ React55.createElement(PreviewSettings, null) : null
|
|
6645
7089
|
);
|
|
6646
7090
|
};
|
|
6647
7091
|
var PreviewSettings = React55.memo(() => {
|
|
6648
|
-
const [open, setOpen] =
|
|
7092
|
+
const [open, setOpen] = useState19(false);
|
|
6649
7093
|
return /* @__PURE__ */ React55.createElement(Fragment6, null, /* @__PURE__ */ React55.createElement(IconButton_default, { "data-testid": "preview_setting_btn", css: { flexShrink: 0 }, onClick: () => setOpen((value) => !value) }, /* @__PURE__ */ React55.createElement(SettingsIcon2, null)), open && /* @__PURE__ */ React55.createElement(SettingsModal_default, { open, onOpenChange: setOpen }));
|
|
6650
7094
|
});
|
|
6651
7095
|
var PreviewJoin_default = PreviewJoin;
|
|
6652
7096
|
|
|
6653
|
-
// src/Prebuilt/components/Preview/PreviewContainer.
|
|
7097
|
+
// src/Prebuilt/components/Preview/PreviewContainer.tsx
|
|
6654
7098
|
var PreviewContainer = () => {
|
|
6655
7099
|
var _a7, _b7, _c;
|
|
6656
|
-
const navigate =
|
|
7100
|
+
const navigate = useNavigate4();
|
|
6657
7101
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
|
6658
7102
|
const skipPreview = !isPreviewScreenEnabled;
|
|
6659
7103
|
const previewAsRole = useSearchParam(QUERY_PARAM_PREVIEW_AS_ROLE);
|
|
6660
7104
|
const { userName } = useHMSPrebuiltContext();
|
|
6661
7105
|
const initialName = userName || (skipPreview ? "Beam" : "");
|
|
6662
|
-
const { roomId: urlRoomId, role: userRole } =
|
|
7106
|
+
const { roomId: urlRoomId, role: userRole } = useParams4();
|
|
6663
7107
|
const authToken = useAuthToken();
|
|
6664
7108
|
const roomLayout = useRoomLayout();
|
|
6665
7109
|
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 +7121,22 @@ var PreviewContainer = () => {
|
|
|
6677
7121
|
justify: "center",
|
|
6678
7122
|
align: "center"
|
|
6679
7123
|
},
|
|
6680
|
-
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */ React56.createElement(
|
|
7124
|
+
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */ React56.createElement(
|
|
7125
|
+
PreviewJoin_default,
|
|
7126
|
+
{
|
|
7127
|
+
initialName,
|
|
7128
|
+
skipPreview,
|
|
7129
|
+
asRole: previewAsRole != null ? previewAsRole : void 0,
|
|
7130
|
+
onJoin
|
|
7131
|
+
}
|
|
7132
|
+
) : /* @__PURE__ */ React56.createElement(FullPageProgress_default, null)
|
|
6681
7133
|
));
|
|
6682
7134
|
};
|
|
6683
7135
|
var PreviewContainer_default = PreviewContainer;
|
|
6684
7136
|
|
|
6685
7137
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
|
6686
|
-
import React58, { useEffect as useEffect25, useState as
|
|
6687
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom4, useHMSStore as
|
|
7138
|
+
import React58, { useEffect as useEffect25, useState as useState20 } from "react";
|
|
7139
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom4, useHMSStore as useHMSStore27 } from "@100mslive/react-sdk";
|
|
6688
7140
|
|
|
6689
7141
|
// src/Prebuilt/components/Toast/Toast.jsx
|
|
6690
7142
|
import React57 from "react";
|
|
@@ -6706,8 +7158,8 @@ var Toast2 = (_a7) => {
|
|
|
6706
7158
|
|
|
6707
7159
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
|
6708
7160
|
var ToastContainer = () => {
|
|
6709
|
-
const isConnected =
|
|
6710
|
-
const [toasts, setToast] =
|
|
7161
|
+
const isConnected = useHMSStore27(selectIsConnectedToRoom4);
|
|
7162
|
+
const [toasts, setToast] = useState20([]);
|
|
6711
7163
|
useEffect25(() => {
|
|
6712
7164
|
ToastManager.addListener(setToast);
|
|
6713
7165
|
return () => {
|
|
@@ -6727,9 +7179,15 @@ var ToastContainer = () => {
|
|
|
6727
7179
|
};
|
|
6728
7180
|
|
|
6729
7181
|
// src/Prebuilt/plugins/FlyingEmoji.jsx
|
|
6730
|
-
import React59, { useCallback as
|
|
6731
|
-
import { useMedia as
|
|
6732
|
-
import {
|
|
7182
|
+
import React59, { useCallback as useCallback18, useEffect as useEffect26, useMemo as useMemo4, useState as useState21 } from "react";
|
|
7183
|
+
import { useMedia as useMedia11 } from "react-use";
|
|
7184
|
+
import {
|
|
7185
|
+
selectLocalPeerID as selectLocalPeerID6,
|
|
7186
|
+
selectPeerNameByID as selectPeerNameByID2,
|
|
7187
|
+
useCustomEvent as useCustomEvent3,
|
|
7188
|
+
useHMSStore as useHMSStore28,
|
|
7189
|
+
useHMSVanillaStore as useHMSVanillaStore7
|
|
7190
|
+
} from "@100mslive/react-sdk";
|
|
6733
7191
|
var emojiCount = 1;
|
|
6734
7192
|
var flyAndFade = keyframes({
|
|
6735
7193
|
"20%": { opacity: 1 },
|
|
@@ -6754,13 +7212,13 @@ var getStartingPoints = (isMobile) => {
|
|
|
6754
7212
|
return arr;
|
|
6755
7213
|
};
|
|
6756
7214
|
function FlyingEmoji() {
|
|
6757
|
-
const localPeerId =
|
|
6758
|
-
const vanillaStore =
|
|
6759
|
-
const [emojis, setEmojis] =
|
|
6760
|
-
const isMobile =
|
|
7215
|
+
const localPeerId = useHMSStore28(selectLocalPeerID6);
|
|
7216
|
+
const vanillaStore = useHMSVanillaStore7();
|
|
7217
|
+
const [emojis, setEmojis] = useState21([]);
|
|
7218
|
+
const isMobile = useMedia11(config.media.md);
|
|
6761
7219
|
const startingPoints = useMemo4(() => getStartingPoints(isMobile), [isMobile]);
|
|
6762
|
-
const showFlyingEmoji =
|
|
6763
|
-
(emojiId, senderId) => {
|
|
7220
|
+
const showFlyingEmoji = useCallback18(
|
|
7221
|
+
({ emojiId, senderId }) => {
|
|
6764
7222
|
if (!emojiId || !senderId || document.hidden) {
|
|
6765
7223
|
return;
|
|
6766
7224
|
}
|
|
@@ -6783,6 +7241,10 @@ function FlyingEmoji() {
|
|
|
6783
7241
|
},
|
|
6784
7242
|
[localPeerId, vanillaStore, startingPoints]
|
|
6785
7243
|
);
|
|
7244
|
+
useCustomEvent3({
|
|
7245
|
+
type: EMOJI_REACTION_TYPE,
|
|
7246
|
+
onEvent: showFlyingEmoji
|
|
7247
|
+
});
|
|
6786
7248
|
useEffect26(() => {
|
|
6787
7249
|
window.showFlyingEmoji = showFlyingEmoji;
|
|
6788
7250
|
}, [showFlyingEmoji]);
|
|
@@ -6847,30 +7309,117 @@ function FlyingEmoji() {
|
|
|
6847
7309
|
}
|
|
6848
7310
|
|
|
6849
7311
|
// src/Prebuilt/plugins/RemoteStopScreenshare.jsx
|
|
6850
|
-
import React60, { useCallback as
|
|
6851
|
-
import { useCustomEvent as
|
|
7312
|
+
import React60, { useCallback as useCallback19 } from "react";
|
|
7313
|
+
import { useCustomEvent as useCustomEvent4, useHMSActions as useHMSActions18 } from "@100mslive/react-sdk";
|
|
6852
7314
|
function RemoteStopScreenshare() {
|
|
6853
|
-
const actions =
|
|
6854
|
-
const onRemoteStopScreenshare =
|
|
7315
|
+
const actions = useHMSActions18();
|
|
7316
|
+
const onRemoteStopScreenshare = useCallback19(() => __async(this, null, function* () {
|
|
6855
7317
|
yield actions.setScreenShareEnabled(false);
|
|
6856
7318
|
}), [actions]);
|
|
6857
|
-
|
|
7319
|
+
useCustomEvent4({
|
|
6858
7320
|
type: REMOTE_STOP_SCREENSHARE_TYPE,
|
|
6859
7321
|
onEvent: onRemoteStopScreenshare
|
|
6860
7322
|
});
|
|
6861
7323
|
return /* @__PURE__ */ React60.createElement(React60.Fragment, null);
|
|
6862
7324
|
}
|
|
6863
7325
|
|
|
6864
|
-
// src/Prebuilt/
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
7326
|
+
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
|
7327
|
+
import { useCallback as useCallback20, useEffect as useEffect28, useRef as useRef9 } from "react";
|
|
7328
|
+
import {
|
|
7329
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom6,
|
|
7330
|
+
selectPermissions as selectPermissions4,
|
|
7331
|
+
useHMSActions as useHMSActions19,
|
|
7332
|
+
useHMSStore as useHMSStore30,
|
|
7333
|
+
useRecordingStreaming as useRecordingStreaming5
|
|
7334
|
+
} from "@100mslive/react-sdk";
|
|
7335
|
+
|
|
7336
|
+
// src/Prebuilt/common/hooks.js
|
|
7337
|
+
import { useEffect as useEffect27, useRef as useRef8, useState as useState22 } from "react";
|
|
7338
|
+
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType3 } from "@100mslive/types-prebuilt/elements/join_form";
|
|
7339
|
+
import {
|
|
7340
|
+
selectAvailableRoleNames as selectAvailableRoleNames2,
|
|
7341
|
+
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
|
7342
|
+
selectPeerCount,
|
|
7343
|
+
selectPeerMetadata as selectPeerMetadata4,
|
|
7344
|
+
selectPeers,
|
|
7345
|
+
selectRemotePeers,
|
|
7346
|
+
useHMSStore as useHMSStore29,
|
|
7347
|
+
useHMSVanillaStore as useHMSVanillaStore8
|
|
7348
|
+
} from "@100mslive/react-sdk";
|
|
7349
|
+
var useFilteredRoles = () => {
|
|
7350
|
+
const roles = useHMSStore29(selectAvailableRoleNames2).filter((role) => !isInternalRole(role));
|
|
7351
|
+
return roles;
|
|
7352
|
+
};
|
|
7353
|
+
var useShowStreamingUI = () => {
|
|
7354
|
+
var _a7, _b7, _c;
|
|
7355
|
+
const layout = useRoomLayout();
|
|
7356
|
+
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) || {};
|
|
7357
|
+
return (join_form == null ? void 0 : join_form.join_btn_type) === JoinForm_JoinBtnType3.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE;
|
|
7358
|
+
};
|
|
7359
|
+
var useParticipants2 = (params) => {
|
|
7360
|
+
var _a7;
|
|
7361
|
+
const isConnected = useHMSStore29(selectIsConnectedToRoom5);
|
|
7362
|
+
const peerCount = useHMSStore29(selectPeerCount);
|
|
7363
|
+
const availableRoles = useHMSStore29(selectAvailableRoleNames2);
|
|
7364
|
+
let participantList = useHMSStore29(isConnected ? selectPeers : selectRemotePeers);
|
|
7365
|
+
const rolesWithParticipants = Array.from(new Set(participantList.map((peer) => peer.roleName)));
|
|
7366
|
+
const vanillaStore = useHMSVanillaStore8();
|
|
7367
|
+
if ((_a7 = params == null ? void 0 : params.metadata) == null ? void 0 : _a7.isHandRaised) {
|
|
7368
|
+
participantList = participantList.filter((peer) => {
|
|
7369
|
+
return vanillaStore.getState(selectPeerMetadata4(peer.id)).isHandRaised;
|
|
7370
|
+
});
|
|
6871
7371
|
}
|
|
6872
|
-
|
|
7372
|
+
if ((params == null ? void 0 : params.role) && availableRoles.includes(params.role)) {
|
|
7373
|
+
participantList = participantList.filter((peer) => peer.roleName === params.role);
|
|
7374
|
+
}
|
|
7375
|
+
if (params == null ? void 0 : params.search) {
|
|
7376
|
+
const search = params.search;
|
|
7377
|
+
participantList = participantList.filter((peer) => peer.name.toLowerCase().includes(search));
|
|
7378
|
+
}
|
|
7379
|
+
return { participants: participantList, isConnected, peerCount, rolesWithParticipants };
|
|
7380
|
+
};
|
|
7381
|
+
|
|
7382
|
+
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
|
7383
|
+
var useAutoStartStreaming = () => {
|
|
7384
|
+
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
|
7385
|
+
const permissions = useHMSStore30(selectPermissions4);
|
|
7386
|
+
const showStreamingUI = useShowStreamingUI();
|
|
7387
|
+
const hmsActions = useHMSActions19();
|
|
7388
|
+
const isConnected = useHMSStore30(selectIsConnectedToRoom6);
|
|
7389
|
+
const { isHLSRunning } = useRecordingStreaming5();
|
|
7390
|
+
const streamStartedRef = useRef9(false);
|
|
7391
|
+
const startHLS = useCallback20(() => __async(void 0, null, function* () {
|
|
7392
|
+
var _a7;
|
|
7393
|
+
try {
|
|
7394
|
+
if (isHLSStarted || !showStreamingUI || isHLSRunning) {
|
|
7395
|
+
return;
|
|
7396
|
+
}
|
|
7397
|
+
setHLSStarted(true);
|
|
7398
|
+
streamStartedRef.current = true;
|
|
7399
|
+
yield hmsActions.startHLSStreaming();
|
|
7400
|
+
} catch (error) {
|
|
7401
|
+
if ((_a7 = error.message) == null ? void 0 : _a7.includes("beam already started")) {
|
|
7402
|
+
return;
|
|
7403
|
+
}
|
|
7404
|
+
streamStartedRef.current = false;
|
|
7405
|
+
setHLSStarted(false);
|
|
7406
|
+
}
|
|
7407
|
+
}), [hmsActions, isHLSRunning, isHLSStarted, setHLSStarted, showStreamingUI]);
|
|
7408
|
+
useEffect28(() => {
|
|
7409
|
+
if (!isHLSStarted && !isHLSRunning) {
|
|
7410
|
+
streamStartedRef.current = false;
|
|
7411
|
+
}
|
|
7412
|
+
}, [isHLSStarted, isHLSRunning]);
|
|
7413
|
+
useEffect28(() => {
|
|
7414
|
+
if (!isConnected || streamStartedRef.current || !(permissions == null ? void 0 : permissions.hlsStreaming)) {
|
|
7415
|
+
return;
|
|
7416
|
+
}
|
|
7417
|
+
startHLS();
|
|
7418
|
+
}, [isConnected]);
|
|
6873
7419
|
};
|
|
7420
|
+
|
|
7421
|
+
// src/Prebuilt/App.tsx
|
|
7422
|
+
var Conference = React61.lazy(() => import("./conference-FJJQ4TXX.js"));
|
|
6874
7423
|
var HMSPrebuilt = React61.forwardRef(
|
|
6875
7424
|
({
|
|
6876
7425
|
roomCode = "",
|
|
@@ -6885,12 +7434,10 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
6885
7434
|
onLeave
|
|
6886
7435
|
}, ref) => {
|
|
6887
7436
|
var _a7, _b7, _c, _d;
|
|
6888
|
-
const aspectRatio = "1-1";
|
|
6889
7437
|
const metadata = "";
|
|
6890
|
-
const
|
|
6891
|
-
const reactiveStore = useRef8();
|
|
7438
|
+
const reactiveStore = useRef10();
|
|
6892
7439
|
const [hydrated, setHydrated] = React61.useState(false);
|
|
6893
|
-
|
|
7440
|
+
useEffect29(() => {
|
|
6894
7441
|
setHydrated(true);
|
|
6895
7442
|
const hms = new HMSReactiveStore();
|
|
6896
7443
|
const hmsStore = hms.getStore();
|
|
@@ -6905,13 +7452,13 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
6905
7452
|
hmsNotifications
|
|
6906
7453
|
};
|
|
6907
7454
|
}, []);
|
|
6908
|
-
|
|
7455
|
+
useEffect29(() => {
|
|
6909
7456
|
if (!ref || !reactiveStore.current) {
|
|
6910
7457
|
return;
|
|
6911
7458
|
}
|
|
6912
7459
|
ref.current = __spreadValues({}, reactiveStore.current);
|
|
6913
7460
|
}, [ref]);
|
|
6914
|
-
|
|
7461
|
+
useEffect29(
|
|
6915
7462
|
() => () => {
|
|
6916
7463
|
var _a8;
|
|
6917
7464
|
(_a8 = reactiveStore == null ? void 0 : reactiveStore.current) == null ? void 0 : _a8.hmsActions.leave();
|
|
@@ -6981,7 +7528,6 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
6981
7528
|
HMSThemeProvider,
|
|
6982
7529
|
{
|
|
6983
7530
|
themeType: `${theme2.name}-${Date.now()}`,
|
|
6984
|
-
aspectRatio: getAspectRatio({ width, height }),
|
|
6985
7531
|
theme: {
|
|
6986
7532
|
//@ts-ignore: Prebuilt theme to match stiches theme
|
|
6987
7533
|
colors: theme2.palette,
|
|
@@ -7013,42 +7559,43 @@ var HMSPrebuilt = React61.forwardRef(
|
|
|
7013
7559
|
);
|
|
7014
7560
|
HMSPrebuilt.displayName = "HMSPrebuilt";
|
|
7015
7561
|
var Redirector = ({ showPreview }) => {
|
|
7016
|
-
const { roomId, role } =
|
|
7562
|
+
const { roomId, role } = useParams5();
|
|
7017
7563
|
return /* @__PURE__ */ React61.createElement(Navigate, { to: `/${showPreview ? "preview" : "meeting"}/${roomId}/${role || ""}` });
|
|
7018
7564
|
};
|
|
7019
7565
|
var RouteList = () => {
|
|
7020
7566
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
|
7021
7567
|
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
|
7568
|
+
useAutoStartStreaming();
|
|
7022
7569
|
return /* @__PURE__ */ React61.createElement(Routes, null, isPreviewScreenEnabled ? /* @__PURE__ */ React61.createElement(Route, { path: "preview" }, /* @__PURE__ */ React61.createElement(
|
|
7023
7570
|
Route,
|
|
7024
7571
|
{
|
|
7025
7572
|
path: ":roomId/:role",
|
|
7026
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7573
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React61.createElement(PreviewContainer_default, null))
|
|
7027
7574
|
}
|
|
7028
7575
|
), /* @__PURE__ */ React61.createElement(
|
|
7029
7576
|
Route,
|
|
7030
7577
|
{
|
|
7031
7578
|
path: ":roomId",
|
|
7032
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7579
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React61.createElement(PreviewContainer_default, null))
|
|
7033
7580
|
}
|
|
7034
7581
|
)) : null, /* @__PURE__ */ React61.createElement(Route, { path: "meeting" }, /* @__PURE__ */ React61.createElement(
|
|
7035
7582
|
Route,
|
|
7036
7583
|
{
|
|
7037
7584
|
path: ":roomId/:role",
|
|
7038
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7585
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React61.createElement(Conference, null))
|
|
7039
7586
|
}
|
|
7040
7587
|
), /* @__PURE__ */ React61.createElement(
|
|
7041
7588
|
Route,
|
|
7042
7589
|
{
|
|
7043
7590
|
path: ":roomId",
|
|
7044
|
-
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, {
|
|
7591
|
+
element: /* @__PURE__ */ React61.createElement(Suspense2, { fallback: /* @__PURE__ */ React61.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React61.createElement(Conference, null))
|
|
7045
7592
|
}
|
|
7046
7593
|
)), 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
7594
|
};
|
|
7048
7595
|
var BackSwipe = () => {
|
|
7049
|
-
const isConnectedToRoom =
|
|
7596
|
+
const isConnectedToRoom = useHMSStore31(selectIsConnectedToRoom7);
|
|
7050
7597
|
const hmsActions = useHMSActions20();
|
|
7051
|
-
|
|
7598
|
+
useEffect29(() => {
|
|
7052
7599
|
const onRouteLeave = () => __async(void 0, null, function* () {
|
|
7053
7600
|
if (isConnectedToRoom) {
|
|
7054
7601
|
yield hmsActions.leave();
|
|
@@ -7070,7 +7617,8 @@ function AppRoutes({
|
|
|
7070
7617
|
defaultAuthToken
|
|
7071
7618
|
}) {
|
|
7072
7619
|
const roomLayout = useRoomLayout();
|
|
7073
|
-
|
|
7620
|
+
const isNotificationsDisabled = useIsNotificationDisabled();
|
|
7621
|
+
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
7622
|
}
|
|
7075
7623
|
|
|
7076
7624
|
// src/Progress/index.tsx
|
|
@@ -7138,7 +7686,6 @@ export {
|
|
|
7138
7686
|
UI_SETTINGS,
|
|
7139
7687
|
SIDE_PANE_OPTIONS,
|
|
7140
7688
|
isChrome,
|
|
7141
|
-
isSafari,
|
|
7142
7689
|
isIOS,
|
|
7143
7690
|
isMacOS,
|
|
7144
7691
|
isAndroid,
|
|
@@ -7147,9 +7694,9 @@ export {
|
|
|
7147
7694
|
ROLE_CHANGE_DECLINED,
|
|
7148
7695
|
useIsSidepaneTypeOpen,
|
|
7149
7696
|
useSidepaneToggle,
|
|
7697
|
+
useSidepaneReset,
|
|
7150
7698
|
useUISettings,
|
|
7151
7699
|
useSetUiSettings,
|
|
7152
|
-
useIsHeadless,
|
|
7153
7700
|
useWaitingViewerRole,
|
|
7154
7701
|
useAuthToken,
|
|
7155
7702
|
useUrlToEmbed,
|
|
@@ -7164,18 +7711,19 @@ export {
|
|
|
7164
7711
|
DialogSelect,
|
|
7165
7712
|
DialogInputFile,
|
|
7166
7713
|
FullPageProgress_default,
|
|
7167
|
-
useRoomLayout,
|
|
7168
7714
|
ToastManager,
|
|
7715
|
+
getMetadata,
|
|
7169
7716
|
isScreenshareSupported,
|
|
7170
7717
|
isInternalRole,
|
|
7171
7718
|
getFormattedCount,
|
|
7719
|
+
PictureInPicture,
|
|
7720
|
+
useRoomLayoutPreviewScreen,
|
|
7721
|
+
useRoomLayoutConferencingScreen,
|
|
7722
|
+
useRedirectToLeave,
|
|
7172
7723
|
Sheet,
|
|
7173
7724
|
useMyMetadata,
|
|
7174
7725
|
StopRecordingInSheet,
|
|
7175
7726
|
Header2 as Header,
|
|
7176
|
-
useRoomLayoutPreviewScreen,
|
|
7177
|
-
useRoomLayoutConferencingScreen,
|
|
7178
|
-
useRoomLayoutLeaveScreen,
|
|
7179
7727
|
AudioVideoToggle,
|
|
7180
7728
|
ConnectionIndicator,
|
|
7181
7729
|
DialogDropdownTrigger,
|
|
@@ -7188,7 +7736,9 @@ export {
|
|
|
7188
7736
|
VideoTile_default,
|
|
7189
7737
|
PreviewTile,
|
|
7190
7738
|
PreviewControls,
|
|
7739
|
+
useFilteredRoles,
|
|
7740
|
+
useParticipants2 as useParticipants,
|
|
7191
7741
|
HMSPrebuilt,
|
|
7192
7742
|
Progress
|
|
7193
7743
|
};
|
|
7194
|
-
//# sourceMappingURL=chunk-
|
|
7744
|
+
//# sourceMappingURL=chunk-WVGGQZK4.js.map
|