@100mslive/roomkit-react 0.3.19-alpha.14 → 0.3.19-alpha.16

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.14",
13
+ "version": "0.3.19-alpha.16",
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.14",
78
+ "@100mslive/hls-player": "0.3.19-alpha.16",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.19-alpha.14",
81
- "@100mslive/hms-whiteboard": "0.0.9-alpha.14",
82
- "@100mslive/react-icons": "0.10.19-alpha.14",
83
- "@100mslive/react-sdk": "0.10.19-alpha.14",
80
+ "@100mslive/hms-virtual-background": "1.13.19-alpha.16",
81
+ "@100mslive/hms-whiteboard": "0.0.9-alpha.16",
82
+ "@100mslive/react-icons": "0.10.19-alpha.16",
83
+ "@100mslive/react-sdk": "0.10.19-alpha.16",
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": "99c54d70e77c7d9ccd39fcd222a3c964b39bbd47"
120
+ "gitHead": "f4e569ef4919bfe1b7b6bc4f82bb9c3f856a50ce"
121
121
  }
@@ -1,7 +1,8 @@
1
1
  // Open issue with eslint-plugin-import https://github.com/import-js/eslint-plugin-import/issues/1810
2
2
  // eslint-disable-next-line
3
3
  import { HMSVBPlugin, HMSVirtualBackgroundTypes } from '@100mslive/hms-virtual-background/hmsvbplugin';
4
-
4
+ import { parsedUserAgent } from '@100mslive/react-sdk';
5
+ import { isSafari } from '../../common/constants';
5
6
  export class VBPlugin {
6
7
  private hmsPlugin?: HMSVBPlugin;
7
8
  private effectsPlugin?: any;
@@ -101,6 +102,17 @@ export class VBPlugin {
101
102
  this.effectsPlugin = undefined;
102
103
  this.hmsPlugin = undefined;
103
104
  };
105
+
106
+ isEffectsSupported = () => {
107
+ if (!isSafari) {
108
+ return true;
109
+ }
110
+ const browserVersion = parsedUserAgent?.getBrowser()?.version || '16';
111
+ if (browserVersion && parseInt(browserVersion.split('.')[0]) < 17) {
112
+ return false;
113
+ }
114
+ return true;
115
+ };
104
116
  }
105
117
 
106
118
  export const VBHandler = new VBPlugin();
@@ -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 [isBlurSupported, setIsBlurSupported] = useState(false);
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);
@@ -80,9 +79,6 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
80
79
  return;
81
80
  }
82
81
 
83
- const isEffectsSupported = doesBrowserSupportEffectsSDK();
84
- setIsBlurSupported(isEffectsSupported);
85
-
86
82
  try {
87
83
  pluginLoadingRef.current = true;
88
84
  if (isEffectsEnabled && isEffectsSupported && effectsKey) {
@@ -125,6 +121,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
125
121
  role,
126
122
  isPluginAdded,
127
123
  isEffectsEnabled,
124
+ isEffectsSupported,
128
125
  effectsKey,
129
126
  track?.id,
130
127
  background,
@@ -193,7 +190,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
193
190
  await VBHandler?.setBlur(blurAmount);
194
191
  hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.BLUR);
195
192
  },
196
- supported: isBlurSupported,
193
+ supported: isEffectsSupported && isEffectsEnabled,
197
194
  },
198
195
  ]}
199
196
  activeBackground={background}
@@ -1 +0,0 @@
1
- export declare const doesBrowserSupportEffectsSDK: () => boolean;