@100mslive/roomkit-react 0.3.17-alpha.2 → 0.3.17-alpha.21
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-XS66ENNF.css → HLSView-PM6EVI6U.css} +3 -3
- package/dist/{HLSView-XS66ENNF.css.map → HLSView-PM6EVI6U.css.map} +1 -1
- package/dist/{HLSView-DRQ5LA2D.js → HLSView-UD242SZD.js} +2 -2
- package/dist/Prebuilt/components/MoreSettings/constants.d.ts +4 -0
- package/dist/Prebuilt/components/Notifications/ReconnectNotifications.d.ts +1 -2
- package/dist/Prebuilt/components/VirtualBackground/VBCollection.d.ts +1 -0
- package/dist/Prebuilt/components/VirtualBackground/util.d.ts +1 -0
- package/dist/{chunk-UBM3HDE3.js → chunk-U2QQEDVU.js} +924 -893
- package/dist/chunk-U2QQEDVU.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +1074 -1040
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +122 -73
- package/dist/meta.esbuild.json +135 -86
- package/package.json +7 -7
- package/src/Prebuilt/components/AppData/AppData.tsx +9 -3
- package/src/Prebuilt/components/AudioVideoToggle.tsx +31 -18
- package/src/Prebuilt/components/MoreSettings/constants.ts +2 -0
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +10 -37
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +3 -1
- package/src/Prebuilt/components/Settings/LayoutSettings.tsx +0 -28
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +2 -2
- package/src/Prebuilt/components/VirtualBackground/VBCollection.tsx +16 -11
- package/src/Prebuilt/components/VirtualBackground/VBHandler.tsx +1 -2
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +10 -2
- package/src/Prebuilt/components/VirtualBackground/VBToggle.tsx +9 -2
- package/src/Prebuilt/components/VirtualBackground/util.tsx +13 -0
- package/dist/chunk-UBM3HDE3.js.map +0 -7
- /package/dist/{HLSView-DRQ5LA2D.js.map → HLSView-UD242SZD.js.map} +0 -0
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"prebuilt",
|
11
11
|
"roomkit"
|
12
12
|
],
|
13
|
-
"version": "0.3.17-alpha.
|
13
|
+
"version": "0.3.17-alpha.21",
|
14
14
|
"author": "100ms",
|
15
15
|
"license": "MIT",
|
16
16
|
"repository": {
|
@@ -75,12 +75,12 @@
|
|
75
75
|
"react": ">=17.0.2 <19.0.0"
|
76
76
|
},
|
77
77
|
"dependencies": {
|
78
|
-
"@100mslive/hls-player": "0.3.17-alpha.
|
78
|
+
"@100mslive/hls-player": "0.3.17-alpha.21",
|
79
79
|
"@100mslive/hms-noise-cancellation": "0.0.1",
|
80
|
-
"@100mslive/hms-virtual-background": "1.13.17-alpha.
|
81
|
-
"@100mslive/hms-whiteboard": "0.0.7-alpha.
|
82
|
-
"@100mslive/react-icons": "0.10.17-alpha.
|
83
|
-
"@100mslive/react-sdk": "0.10.17-alpha.
|
80
|
+
"@100mslive/hms-virtual-background": "1.13.17-alpha.21",
|
81
|
+
"@100mslive/hms-whiteboard": "0.0.7-alpha.21",
|
82
|
+
"@100mslive/react-icons": "0.10.17-alpha.21",
|
83
|
+
"@100mslive/react-sdk": "0.10.17-alpha.21",
|
84
84
|
"@100mslive/types-prebuilt": "0.12.11",
|
85
85
|
"@emoji-mart/data": "^1.0.6",
|
86
86
|
"@emoji-mart/react": "^1.0.1",
|
@@ -117,5 +117,5 @@
|
|
117
117
|
"uuid": "^8.3.2",
|
118
118
|
"worker-timers": "^7.0.40"
|
119
119
|
},
|
120
|
-
"gitHead": "
|
120
|
+
"gitHead": "6763867d8efe03ea0c654002d8f828011c6c919e"
|
121
121
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { useEffect, useMemo, useRef } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
2
3
|
import {
|
3
4
|
HMSRoomState,
|
4
5
|
selectFullAppData,
|
@@ -10,6 +11,7 @@ import {
|
|
10
11
|
useHMSStore,
|
11
12
|
useRecordingStreaming,
|
12
13
|
} from '@100mslive/react-sdk';
|
14
|
+
import { config as cssConfig } from '../../../Theme';
|
13
15
|
import { LayoutMode } from '../Settings/LayoutSettings';
|
14
16
|
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
15
17
|
//@ts-ignore
|
@@ -26,6 +28,7 @@ import {
|
|
26
28
|
UI_MODE_GRID,
|
27
29
|
UI_SETTINGS,
|
28
30
|
} from '../../common/constants';
|
31
|
+
import { DEFAULT_TILES_IN_VIEW } from '../MoreSettings/constants';
|
29
32
|
|
30
33
|
const initialAppData = {
|
31
34
|
[APP_DATA.uiSettings]: {
|
@@ -80,6 +83,7 @@ export const AppData = React.memo(() => {
|
|
80
83
|
const { isLocalVideoEnabled } = useAVToggle();
|
81
84
|
const sidepaneOpenedRef = useRef(false);
|
82
85
|
const [, setNoiseCancellationEnabled] = useSetNoiseCancellation();
|
86
|
+
const isMobile = useMedia(cssConfig.media.md);
|
83
87
|
|
84
88
|
useEffect(() => {
|
85
89
|
if (elements?.noise_cancellation?.enabled_by_default) {
|
@@ -117,10 +121,12 @@ export const AppData = React.memo(() => {
|
|
117
121
|
...uiSettings,
|
118
122
|
[UI_SETTINGS.isAudioOnly]: undefined,
|
119
123
|
[UI_SETTINGS.uiViewMode]: uiSettings.uiViewMode || UI_MODE_GRID,
|
120
|
-
[UI_SETTINGS.maxTileCount]:
|
124
|
+
[UI_SETTINGS.maxTileCount]: isMobile
|
125
|
+
? DEFAULT_TILES_IN_VIEW.MWEB
|
126
|
+
: Number(elements?.video_tile_layout?.grid?.tiles_in_view) || DEFAULT_TILES_IN_VIEW.DESKTOP,
|
121
127
|
};
|
122
|
-
hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings,
|
123
|
-
}, [preferences, hmsActions, elements?.video_tile_layout]);
|
128
|
+
hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings, false);
|
129
|
+
}, [preferences, hmsActions, elements?.video_tile_layout, isMobile]);
|
124
130
|
|
125
131
|
useEffect(() => {
|
126
132
|
if (!preferences.subscribedNotifications) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { Fragment, useEffect, useState } from 'react';
|
1
|
+
import React, { Fragment, useCallback, useEffect, useState } from 'react';
|
2
2
|
import { HMSKrispPlugin } from '@100mslive/hms-noise-cancellation';
|
3
3
|
import {
|
4
4
|
DeviceType,
|
@@ -14,6 +14,7 @@ import {
|
|
14
14
|
useDevices,
|
15
15
|
useHMSActions,
|
16
16
|
useHMSStore,
|
17
|
+
useHMSVanillaStore,
|
17
18
|
} from '@100mslive/react-sdk';
|
18
19
|
import {
|
19
20
|
AudioLevelIcon,
|
@@ -105,22 +106,26 @@ const useNoiseCancellationWithPlugin = () => {
|
|
105
106
|
const actions = useHMSActions();
|
106
107
|
const [inProgress, setInProgress] = useState(false);
|
107
108
|
const [, setNoiseCancellationEnabled] = useSetNoiseCancellation();
|
108
|
-
const
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
109
|
+
const isEnabledForRoom = useHMSStore(selectRoom)?.isNoiseCancellationEnabled;
|
110
|
+
const setNoiseCancellationWithPlugin = useCallback(
|
111
|
+
async (enabled: boolean) => {
|
112
|
+
if (!isEnabledForRoom || inProgress) {
|
113
|
+
return;
|
114
|
+
}
|
115
|
+
if (!krispPlugin.checkSupport().isSupported) {
|
116
|
+
throw Error('Krisp plugin is not supported');
|
117
|
+
}
|
118
|
+
setInProgress(true);
|
119
|
+
if (enabled) {
|
120
|
+
await actions.addPluginToAudioTrack(krispPlugin);
|
121
|
+
} else {
|
122
|
+
await actions.removePluginFromAudioTrack(krispPlugin);
|
123
|
+
}
|
124
|
+
setNoiseCancellationEnabled(enabled);
|
125
|
+
setInProgress(false);
|
126
|
+
},
|
127
|
+
[actions, inProgress, isEnabledForRoom, setNoiseCancellationEnabled],
|
128
|
+
);
|
124
129
|
return {
|
125
130
|
setNoiseCancellationWithPlugin,
|
126
131
|
inProgress,
|
@@ -274,6 +279,7 @@ export const AudioVideoToggle = ({ hideOptions = false }: { hideOptions?: boolea
|
|
274
279
|
const localPeer = useHMSStore(selectLocalPeer);
|
275
280
|
const { isLocalVideoEnabled, isLocalAudioEnabled, toggleAudio, toggleVideo } = useAVToggle();
|
276
281
|
const actions = useHMSActions();
|
282
|
+
const vanillaStore = useHMSVanillaStore();
|
277
283
|
const videoTrackId = useHMSStore(selectLocalVideoTrackID);
|
278
284
|
const localVideoTrack = useHMSStore(selectVideoTrackByID(videoTrackId));
|
279
285
|
const roomState = useHMSStore(selectRoomState);
|
@@ -289,7 +295,14 @@ export const AudioVideoToggle = ({ hideOptions = false }: { hideOptions?: boolea
|
|
289
295
|
|
290
296
|
useEffect(() => {
|
291
297
|
(async () => {
|
292
|
-
|
298
|
+
const isEnabledForRoom = vanillaStore.getState(selectRoom)?.isNoiseCancellationEnabled;
|
299
|
+
if (
|
300
|
+
isEnabledForRoom &&
|
301
|
+
isNoiseCancellationEnabled &&
|
302
|
+
!isKrispPluginAdded &&
|
303
|
+
!inProgress &&
|
304
|
+
localPeer?.audioTrack
|
305
|
+
) {
|
293
306
|
try {
|
294
307
|
await setNoiseCancellationWithPlugin(true);
|
295
308
|
ToastManager.addToast({
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import { useEffect, useRef } from 'react';
|
2
2
|
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
3
|
-
import { Dialog, Flex, Loading, Text } from '../../..';
|
4
3
|
// @ts-ignore: No implicit Any
|
5
4
|
import { ToastConfig } from '../Toast/ToastConfig';
|
6
5
|
// @ts-ignore: No implicit Any
|
@@ -15,50 +14,24 @@ let notificationId: string | null = null;
|
|
15
14
|
|
16
15
|
export const ReconnectNotifications = () => {
|
17
16
|
const notification = useHMSNotifications(notificationTypes);
|
18
|
-
const
|
17
|
+
const prevErrorCode = useRef(0);
|
19
18
|
useEffect(() => {
|
20
19
|
if (!notification) {
|
21
20
|
return;
|
22
21
|
}
|
23
|
-
if (notification.type === HMSNotificationTypes.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
if (notification.type === HMSNotificationTypes.RECONNECTED) {
|
23
|
+
notificationId = ToastManager.replaceToast(
|
24
|
+
notificationId,
|
25
|
+
ToastConfig.RECONNECTED.single([4005, 4006].includes(prevErrorCode.current)),
|
26
|
+
);
|
28
27
|
} else if (notification.type === HMSNotificationTypes.RECONNECTING) {
|
28
|
+
prevErrorCode.current = notification.data?.code || 0;
|
29
29
|
notificationId = ToastManager.replaceToast(
|
30
30
|
notificationId,
|
31
31
|
ToastConfig.RECONNECTING.single(notification.data?.message),
|
32
32
|
);
|
33
33
|
}
|
34
34
|
}, [notification]);
|
35
|
-
|
36
|
-
return
|
37
|
-
<Dialog.Root open={open} modal={true}>
|
38
|
-
<Dialog.Portal container={document.getElementById('conferencing')}>
|
39
|
-
<Dialog.Overlay />
|
40
|
-
<Dialog.Content
|
41
|
-
css={{
|
42
|
-
width: 'fit-content',
|
43
|
-
maxWidth: '80%',
|
44
|
-
p: '$4 $8',
|
45
|
-
position: 'relative',
|
46
|
-
top: 'unset',
|
47
|
-
bottom: '$9',
|
48
|
-
transform: 'translate(-50%, -100%)',
|
49
|
-
animation: 'none !important',
|
50
|
-
}}
|
51
|
-
>
|
52
|
-
<Flex align="center">
|
53
|
-
<div style={{ display: 'inline', margin: '0.25rem' }}>
|
54
|
-
<Loading size={16} />
|
55
|
-
</div>
|
56
|
-
<Text css={{ fontSize: '$space$8', color: '$on_surface_high' }}>
|
57
|
-
You lost your network connection. Trying to reconnect.
|
58
|
-
</Text>
|
59
|
-
</Flex>
|
60
|
-
</Dialog.Content>
|
61
|
-
</Dialog.Portal>
|
62
|
-
</Dialog.Root>
|
63
|
-
);
|
35
|
+
|
36
|
+
return null;
|
64
37
|
};
|
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
HMSRoomState,
|
5
5
|
selectAppData,
|
6
6
|
selectIsLocalVideoEnabled,
|
7
|
+
selectIsVBEnabled,
|
7
8
|
selectLocalPeer,
|
8
9
|
selectRoomState,
|
9
10
|
selectVideoTrackByID,
|
@@ -253,6 +254,7 @@ export const PreviewTile = ({ name, error }: { name: string; error?: boolean })
|
|
253
254
|
|
254
255
|
export const PreviewControls = ({ hideSettings, vbEnabled }: { hideSettings: boolean; vbEnabled: boolean }) => {
|
255
256
|
const isMobile = useMedia(cssConfig.media.md);
|
257
|
+
const isVBEnabledForUser = useHMSStore(selectIsVBEnabled);
|
256
258
|
return (
|
257
259
|
<Flex
|
258
260
|
justify={hideSettings && isMobile ? 'center' : 'between'}
|
@@ -263,7 +265,7 @@ export const PreviewControls = ({ hideSettings, vbEnabled }: { hideSettings: boo
|
|
263
265
|
>
|
264
266
|
<Flex css={{ gap: '$4' }}>
|
265
267
|
<AudioVideoToggle />
|
266
|
-
{vbEnabled ? <VBToggle /> : null}
|
268
|
+
{vbEnabled && isVBEnabledForUser ? <VBToggle /> : null}
|
267
269
|
</Flex>
|
268
270
|
<Flex align="center" gap="1">
|
269
271
|
{isMobile && <NoiseCancellation iconOnly />}
|
@@ -41,34 +41,6 @@ export const LayoutSettings = () => {
|
|
41
41
|
|
42
42
|
return (
|
43
43
|
<Box className={settingOverflow()}>
|
44
|
-
<Box>
|
45
|
-
{/* <Text variant="md" css={{ fontWeight: '$semiBold' }}>
|
46
|
-
Layout Modes
|
47
|
-
</Text>
|
48
|
-
<RadioGroup.Root
|
49
|
-
css={{ flexDirection: 'column', alignItems: 'start', gap: '$10', my: '$2', py: '$8' }}
|
50
|
-
value={layoutMode}
|
51
|
-
onValueChange={value =>
|
52
|
-
setUISettings({
|
53
|
-
[UI_SETTINGS.layoutMode]: value,
|
54
|
-
})
|
55
|
-
}
|
56
|
-
>
|
57
|
-
{Object.keys(LayoutMode).map(key => {
|
58
|
-
return (
|
59
|
-
<Flex align="center" key={key} css={{ mr: '$8', gap: '$8' }}>
|
60
|
-
<RadioGroup.Item value={LayoutMode[key as LayoutModeKeys]} id={`layoutMode-${key}`} css={{ mr: '$4' }}>
|
61
|
-
<RadioGroup.Indicator />
|
62
|
-
</RadioGroup.Item>
|
63
|
-
<Label htmlFor={`layoutMode-${key}`} css={{ display: 'flex', gap: '$8', cursor: 'pointer' }}>
|
64
|
-
{LayoutModeIconMapping[LayoutMode[key as LayoutModeKeys]]}
|
65
|
-
{LayoutMode[key as LayoutModeKeys]}
|
66
|
-
</Label>
|
67
|
-
</Flex>
|
68
|
-
);
|
69
|
-
})}
|
70
|
-
</RadioGroup.Root> */}
|
71
|
-
</Box>
|
72
44
|
<Flex align="center" css={{ w: '100%', my: '$2', py: '$8', '@md': { display: 'none' } }}>
|
73
45
|
<Text variant="md" css={{ fontWeight: '$semiBold' }}>
|
74
46
|
Tiles In View({maxTileCount})
|
@@ -153,9 +153,9 @@ export const ToastConfig = {
|
|
153
153
|
},
|
154
154
|
},
|
155
155
|
RECONNECTED: {
|
156
|
-
single:
|
156
|
+
single: online => {
|
157
157
|
return {
|
158
|
-
title: `You are now connected`,
|
158
|
+
title: `You are now ${online ? 'online' : 'connected'}`,
|
159
159
|
icon: <ConnectivityIcon />,
|
160
160
|
variant: 'success',
|
161
161
|
duration: 3000,
|
@@ -15,6 +15,7 @@ export const VBCollection = ({
|
|
15
15
|
onClick?: () => Promise<void>;
|
16
16
|
mediaURL?: string;
|
17
17
|
value: string | HMSVirtualBackgroundTypes;
|
18
|
+
supported?: boolean;
|
18
19
|
}[];
|
19
20
|
title: string;
|
20
21
|
activeBackground: string;
|
@@ -28,17 +29,21 @@ export const VBCollection = ({
|
|
28
29
|
{title}
|
29
30
|
</Text>
|
30
31
|
<Box css={{ py: '$4', display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: '$8' }}>
|
31
|
-
{options.map((option, index) =>
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
{options.map((option, index) =>
|
33
|
+
option.supported ? (
|
34
|
+
<VBOption.Root
|
35
|
+
key={option.value}
|
36
|
+
testid={option.value === HMSVirtualBackgroundTypes.IMAGE ? `virtual_bg_option-${index}` : option.value}
|
37
|
+
{...option}
|
38
|
+
isActive={activeBackground === option.value}
|
39
|
+
>
|
40
|
+
<VBOption.Icon>{option?.icon}</VBOption.Icon>
|
41
|
+
<VBOption.Title>{option?.title}</VBOption.Title>
|
42
|
+
</VBOption.Root>
|
43
|
+
) : (
|
44
|
+
''
|
45
|
+
),
|
46
|
+
)}
|
42
47
|
</Box>
|
43
48
|
</Box>
|
44
49
|
);
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { HMSEffectsPlugin, HMSVBPlugin, HMSVirtualBackgroundTypes } from '@100mslive/hms-virtual-background';
|
2
|
-
|
3
2
|
export class VBPlugin {
|
4
3
|
private hmsPlugin?: HMSVBPlugin;
|
5
|
-
private effectsPlugin?: HMSEffectsPlugin
|
4
|
+
private effectsPlugin?: HMSEffectsPlugin;
|
6
5
|
|
7
6
|
initialisePlugin = (effectsSDKKey?: string, onInit?: () => void) => {
|
8
7
|
if (this.getVBObject()) {
|
@@ -22,6 +22,7 @@ import {
|
|
22
22
|
import { BlurPersonHighIcon, CrossCircleIcon, CrossIcon } from '@100mslive/react-icons';
|
23
23
|
import { Box, config as cssConfig, Flex, Loading, Slider, Video } from '../../../index';
|
24
24
|
import { Text } from '../../../Text';
|
25
|
+
import { doesBrowserSupportEffectsSDK } from './util';
|
25
26
|
import { VBCollection } from './VBCollection';
|
26
27
|
import { VBHandler } from './VBHandler';
|
27
28
|
// @ts-ignore
|
@@ -45,6 +46,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
45
46
|
const [blurAmount, setBlurAmount] = useState(VBHandler.getBlurAmount() || 0.5);
|
46
47
|
const roomState = useHMSStore(selectRoomState);
|
47
48
|
const isLargeRoom = useHMSStore(selectIsLargeRoom);
|
49
|
+
const [isBlurSupported, setIsBlurSupported] = useState(false);
|
48
50
|
const isEffectsEnabled = useHMSStore(selectIsEffectsEnabled);
|
49
51
|
const effectsKey = useHMSStore(selectEffectsKey);
|
50
52
|
const isMobile = useMedia(cssConfig.media.md);
|
@@ -61,13 +63,16 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
61
63
|
if (!track?.id) {
|
62
64
|
return;
|
63
65
|
}
|
64
|
-
|
66
|
+
const isEffectsSupported = doesBrowserSupportEffectsSDK();
|
67
|
+
setIsBlurSupported(isEffectsSupported);
|
68
|
+
const vbObject = VBHandler.getVBObject();
|
69
|
+
if (!isPluginAdded && !vbObject) {
|
65
70
|
setLoadingEffects(true);
|
66
71
|
let vbObject = VBHandler.getVBObject();
|
67
72
|
if (!vbObject) {
|
68
73
|
VBHandler.initialisePlugin(isEffectsEnabled && effectsKey ? effectsKey : '', () => setLoadingEffects(false));
|
69
74
|
vbObject = VBHandler.getVBObject();
|
70
|
-
if (isEffectsEnabled && effectsKey) {
|
75
|
+
if (isEffectsEnabled && isEffectsSupported && effectsKey) {
|
71
76
|
hmsActions.addPluginsToVideoStream([vbObject as HMSEffectsPlugin]);
|
72
77
|
} else {
|
73
78
|
setLoadingEffects(false);
|
@@ -155,6 +160,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
155
160
|
await VBHandler.removeEffects();
|
156
161
|
hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.NONE);
|
157
162
|
},
|
163
|
+
supported: true,
|
158
164
|
},
|
159
165
|
{
|
160
166
|
title: 'Blur',
|
@@ -164,6 +170,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
164
170
|
await VBHandler?.setBlur(blurAmount);
|
165
171
|
hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.BLUR);
|
166
172
|
},
|
173
|
+
supported: isBlurSupported,
|
167
174
|
},
|
168
175
|
]}
|
169
176
|
activeBackground={background}
|
@@ -208,6 +215,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
208
215
|
await VBHandler?.setBackground(mediaURL);
|
209
216
|
hmsActions.setAppData(APP_DATA.background, mediaURL);
|
210
217
|
},
|
218
|
+
supported: true,
|
211
219
|
}))}
|
212
220
|
activeBackground={background}
|
213
221
|
/>
|
@@ -1,5 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
selectAppData,
|
4
|
+
selectIsEffectsEnabled,
|
5
|
+
selectIsLocalVideoEnabled,
|
6
|
+
selectIsVBEnabled,
|
7
|
+
useHMSStore,
|
8
|
+
} from '@100mslive/react-sdk';
|
3
9
|
import { VirtualBackgroundIcon } from '@100mslive/react-icons';
|
4
10
|
import { Loading } from '../../../Loading';
|
5
11
|
import { Tooltip } from '../../../Tooltip';
|
@@ -12,10 +18,11 @@ export const VBToggle = () => {
|
|
12
18
|
const toggleVB = useSidepaneToggle(SIDE_PANE_OPTIONS.VB);
|
13
19
|
const isVBOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.VB);
|
14
20
|
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
|
21
|
+
const isVBEnabled = useHMSStore(selectIsVBEnabled);
|
15
22
|
const isEffectsEnabled = useHMSStore(selectIsEffectsEnabled);
|
16
23
|
const loadingEffects = useHMSStore(selectAppData(APP_DATA.loadingEffects));
|
17
24
|
|
18
|
-
if (!isVideoOn || (!isEffectsEnabled && isSafari)) {
|
25
|
+
if (!isVideoOn || (!isEffectsEnabled && isSafari) || !isVBEnabled) {
|
19
26
|
return null;
|
20
27
|
}
|
21
28
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { parsedUserAgent } from '@100mslive/react-sdk';
|
2
|
+
import { isSafari } from '../../common/constants';
|
3
|
+
|
4
|
+
export const doesBrowserSupportEffectsSDK = () => {
|
5
|
+
if (!isSafari) {
|
6
|
+
return true;
|
7
|
+
}
|
8
|
+
const browserVersion = parsedUserAgent?.getBrowser()?.version || '16';
|
9
|
+
if (browserVersion && parseInt(browserVersion.split('.')[0]) < 17) {
|
10
|
+
return false;
|
11
|
+
}
|
12
|
+
return true;
|
13
|
+
};
|