@100mslive/roomkit-react 0.3.19-alpha.9 → 0.3.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-EYFJ7YDU.js → HLSView-GYB2QDIN.js} +2 -2
- package/dist/{HLSView-5SR3RWXG.css → HLSView-LNJLFWK4.css} +3 -3
- package/dist/{HLSView-5SR3RWXG.css.map → HLSView-LNJLFWK4.css.map} +1 -1
- package/dist/Prebuilt/components/VirtualBackground/VBHandler.d.ts +1 -0
- package/dist/{chunk-3FZB2LJY.js → chunk-DIIFM6TW.js} +144 -126
- package/dist/chunk-DIIFM6TW.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +573 -562
- 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 +44 -63
- package/dist/meta.esbuild.json +56 -75
- package/package.json +7 -7
- package/src/Prebuilt/AppStateContext.tsx +8 -5
- package/src/Prebuilt/components/EndCallFeedback/Feedback.tsx +3 -2
- package/src/Prebuilt/components/EndCallFeedback/FeedbackForm.tsx +16 -6
- package/src/Prebuilt/components/EndCallFeedback/ThankyouView.tsx +1 -1
- package/src/Prebuilt/components/InsetTile.tsx +1 -1
- package/src/Prebuilt/components/Leave/LeaveSessionContent.tsx +3 -1
- package/src/Prebuilt/components/PIP/PIPChat.tsx +11 -4
- package/src/Prebuilt/components/VirtualBackground/VBHandler.tsx +15 -3
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +21 -16
- package/dist/Prebuilt/components/VirtualBackground/util.d.ts +0 -1
- package/dist/chunk-3FZB2LJY.js.map +0 -7
- package/src/Prebuilt/components/VirtualBackground/util.tsx +0 -13
- /package/dist/{HLSView-EYFJ7YDU.js.map → HLSView-GYB2QDIN.js.map} +0 -0
@@ -25,7 +25,6 @@ import {
|
|
25
25
|
import { BlurPersonHighIcon, CrossCircleIcon, CrossIcon } from '@100mslive/react-icons';
|
26
26
|
import { Box, config as cssConfig, Flex, Loading, Slider, Video } from '../../../index';
|
27
27
|
import { Text } from '../../../Text';
|
28
|
-
import { doesBrowserSupportEffectsSDK } from './util';
|
29
28
|
import { VBCollection } from './VBCollection';
|
30
29
|
import { VBHandler } from './VBHandler';
|
31
30
|
// @ts-ignore
|
@@ -49,7 +48,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
49
48
|
const [blurAmount, setBlurAmount] = useState(VBHandler.getBlurAmount() || 0.5);
|
50
49
|
const roomState = useHMSStore(selectRoomState);
|
51
50
|
const isLargeRoom = useHMSStore(selectIsLargeRoom);
|
52
|
-
const
|
51
|
+
const isEffectsSupported = VBHandler.isEffectsSupported();
|
53
52
|
const isEffectsEnabled = useHMSStore(selectIsEffectsEnabled);
|
54
53
|
const effectsKey = useHMSStore(selectEffectsKey);
|
55
54
|
const isMobile = useMedia(cssConfig.media.md);
|
@@ -64,14 +63,22 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
64
63
|
const showVideoTile = isVideoOn && isLargeRoom && !inPreview;
|
65
64
|
|
66
65
|
useEffect(() => {
|
66
|
+
const addHMSVBPlugin = async () => {
|
67
|
+
setLoadingEffects(false);
|
68
|
+
if (!role) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
await VBHandler.initialisePlugin();
|
72
|
+
await hmsActions.addPluginToVideoTrack(
|
73
|
+
VBHandler.getVBObject() as HMSVBPlugin,
|
74
|
+
Math.floor(role.publishParams.video.frameRate / 2),
|
75
|
+
);
|
76
|
+
};
|
67
77
|
const initializeVirtualBackground = async () => {
|
68
78
|
if (!track?.id || pluginLoadingRef.current || isPluginAdded) {
|
69
79
|
return;
|
70
80
|
}
|
71
81
|
|
72
|
-
const isEffectsSupported = doesBrowserSupportEffectsSDK();
|
73
|
-
setIsBlurSupported(isEffectsSupported);
|
74
|
-
|
75
82
|
try {
|
76
83
|
pluginLoadingRef.current = true;
|
77
84
|
if (isEffectsEnabled && isEffectsSupported && effectsKey) {
|
@@ -79,17 +86,14 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
79
86
|
await VBHandler.initialisePlugin(effectsKey, () => {
|
80
87
|
setLoadingEffects(false);
|
81
88
|
});
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
const vbInstance = VBHandler.getVBObject();
|
90
|
+
if (vbInstance.getName() === 'HMSEffects') {
|
91
|
+
hmsActions.addPluginsToVideoStream([VBHandler.getVBObject() as HMSMediaStreamPlugin]);
|
92
|
+
} else {
|
93
|
+
await addHMSVBPlugin();
|
87
94
|
}
|
88
|
-
|
89
|
-
await
|
90
|
-
VBHandler.getVBObject() as HMSVBPlugin,
|
91
|
-
Math.floor(role.publishParams.video.frameRate / 2),
|
92
|
-
);
|
95
|
+
} else {
|
96
|
+
await addHMSVBPlugin();
|
93
97
|
}
|
94
98
|
|
95
99
|
const handleDefaultBackground = async () => {
|
@@ -117,6 +121,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
117
121
|
role,
|
118
122
|
isPluginAdded,
|
119
123
|
isEffectsEnabled,
|
124
|
+
isEffectsSupported,
|
120
125
|
effectsKey,
|
121
126
|
track?.id,
|
122
127
|
background,
|
@@ -185,7 +190,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
185
190
|
await VBHandler?.setBlur(blurAmount);
|
186
191
|
hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.BLUR);
|
187
192
|
},
|
188
|
-
supported:
|
193
|
+
supported: isEffectsSupported && isEffectsEnabled,
|
189
194
|
},
|
190
195
|
]}
|
191
196
|
activeBackground={background}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const doesBrowserSupportEffectsSDK: () => boolean;
|