@100mslive/roomkit-react 0.3.19-alpha.11 → 0.3.19-alpha.13

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.19-alpha.11",
13
+ "version": "0.3.19-alpha.13",
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.19-alpha.11",
78
+ "@100mslive/hls-player": "0.3.19-alpha.13",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.19-alpha.11",
81
- "@100mslive/hms-whiteboard": "0.0.9-alpha.11",
82
- "@100mslive/react-icons": "0.10.19-alpha.11",
83
- "@100mslive/react-sdk": "0.10.19-alpha.11",
80
+ "@100mslive/hms-virtual-background": "1.13.19-alpha.13",
81
+ "@100mslive/hms-whiteboard": "0.0.9-alpha.13",
82
+ "@100mslive/react-icons": "0.10.19-alpha.13",
83
+ "@100mslive/react-sdk": "0.10.19-alpha.13",
84
84
  "@100mslive/types-prebuilt": "0.12.12",
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": "6e9b1939c2268c0bd556fb3cc2f6905c79a48d8d"
120
+ "gitHead": "b1b838678870a5de5aec4c96716a3198564cab4c"
121
121
  }
@@ -64,6 +64,17 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
64
64
  const showVideoTile = isVideoOn && isLargeRoom && !inPreview;
65
65
 
66
66
  useEffect(() => {
67
+ const addHMSVBPlugin = async () => {
68
+ setLoadingEffects(false);
69
+ if (!role) {
70
+ return;
71
+ }
72
+ await VBHandler.initialisePlugin();
73
+ await hmsActions.addPluginToVideoTrack(
74
+ VBHandler.getVBObject() as HMSVBPlugin,
75
+ Math.floor(role.publishParams.video.frameRate / 2),
76
+ );
77
+ };
67
78
  const initializeVirtualBackground = async () => {
68
79
  if (!track?.id || pluginLoadingRef.current || isPluginAdded) {
69
80
  return;
@@ -79,17 +90,14 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
79
90
  await VBHandler.initialisePlugin(effectsKey, () => {
80
91
  setLoadingEffects(false);
81
92
  });
82
- hmsActions.addPluginsToVideoStream([VBHandler.getVBObject() as HMSMediaStreamPlugin]);
83
- } else {
84
- setLoadingEffects(false);
85
- if (!role) {
86
- return;
93
+ const vbInstance = VBHandler.getVBObject();
94
+ if (vbInstance.getName() === 'HMSEffects') {
95
+ hmsActions.addPluginsToVideoStream([VBHandler.getVBObject() as HMSMediaStreamPlugin]);
96
+ } else {
97
+ await addHMSVBPlugin();
87
98
  }
88
- await VBHandler.initialisePlugin();
89
- await hmsActions.addPluginToVideoTrack(
90
- VBHandler.getVBObject() as HMSVBPlugin,
91
- Math.floor(role.publishParams.video.frameRate / 2),
92
- );
99
+ } else {
100
+ await addHMSVBPlugin();
93
101
  }
94
102
 
95
103
  const handleDefaultBackground = async () => {