@100mslive/roomkit-react 0.3.17-alpha.17 → 0.3.17-alpha.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -9815,6 +9815,27 @@
9815
9815
  ],
9816
9816
  "format": "esm"
9817
9817
  },
9818
+ "src/Prebuilt/components/VirtualBackground/util.tsx": {
9819
+ "bytes": 384,
9820
+ "imports": [
9821
+ {
9822
+ "path": "@100mslive/react-sdk",
9823
+ "kind": "import-statement",
9824
+ "external": true
9825
+ },
9826
+ {
9827
+ "path": "src/Prebuilt/common/constants.ts",
9828
+ "kind": "import-statement",
9829
+ "original": "../../common/constants"
9830
+ },
9831
+ {
9832
+ "path": "<define:process.env>",
9833
+ "kind": "import-statement",
9834
+ "external": true
9835
+ }
9836
+ ],
9837
+ "format": "esm"
9838
+ },
9818
9839
  "src/Prebuilt/components/VirtualBackground/VBOption.tsx": {
9819
9840
  "bytes": 1248,
9820
9841
  "imports": [
@@ -9847,7 +9868,7 @@
9847
9868
  "format": "esm"
9848
9869
  },
9849
9870
  "src/Prebuilt/components/VirtualBackground/VBCollection.tsx": {
9850
- "bytes": 1333,
9871
+ "bytes": 1448,
9851
9872
  "imports": [
9852
9873
  {
9853
9874
  "path": "react",
@@ -9909,7 +9930,7 @@
9909
9930
  "format": "esm"
9910
9931
  },
9911
9932
  "src/Prebuilt/components/VirtualBackground/VBPicker.tsx": {
9912
- "bytes": 7990,
9933
+ "bytes": 8341,
9913
9934
  "imports": [
9914
9935
  {
9915
9936
  "path": "react",
@@ -9956,6 +9977,11 @@
9956
9977
  "kind": "import-statement",
9957
9978
  "original": "../../../Text"
9958
9979
  },
9980
+ {
9981
+ "path": "src/Prebuilt/components/VirtualBackground/util.tsx",
9982
+ "kind": "import-statement",
9983
+ "original": "./util"
9984
+ },
9959
9985
  {
9960
9986
  "path": "src/Prebuilt/components/VirtualBackground/VBCollection.tsx",
9961
9987
  "kind": "import-statement",
@@ -11231,7 +11257,7 @@
11231
11257
  ],
11232
11258
  "format": "esm"
11233
11259
  },
11234
- "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462101233/tldraw.css": {
11260
+ "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa9f3/tldraw.css": {
11235
11261
  "bytes": 80111,
11236
11262
  "imports": [
11237
11263
  {
@@ -11281,7 +11307,7 @@
11281
11307
  }
11282
11308
  ]
11283
11309
  },
11284
- "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462100af0/index.css": {
11310
+ "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa111/index.css": {
11285
11311
  "bytes": 597,
11286
11312
  "imports": [
11287
11313
  {
@@ -11290,7 +11316,7 @@
11290
11316
  "external": true
11291
11317
  },
11292
11318
  {
11293
- "path": "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462101233/tldraw.css",
11319
+ "path": "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa9f3/tldraw.css",
11294
11320
  "kind": "import-rule",
11295
11321
  "original": "@tldraw/tldraw/tldraw.css"
11296
11322
  }
@@ -11365,7 +11391,7 @@
11365
11391
  "original": "../../common/constants"
11366
11392
  },
11367
11393
  {
11368
- "path": "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462100af0/index.css",
11394
+ "path": "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa111/index.css",
11369
11395
  "kind": "import-statement",
11370
11396
  "original": "@100mslive/hms-whiteboard/index.css"
11371
11397
  },
@@ -15247,7 +15273,7 @@
15247
15273
  "dist/index.js": {
15248
15274
  "imports": [
15249
15275
  {
15250
- "path": "dist/chunk-X5BOIOM4.js",
15276
+ "path": "dist/chunk-IVULXQJ2.js",
15251
15277
  "kind": "import-statement"
15252
15278
  }
15253
15279
  ],
@@ -15323,16 +15349,16 @@
15323
15349
  "inputs": {},
15324
15350
  "bytes": 1882
15325
15351
  },
15326
- "dist/HLSView-34MM4BU3.js.map": {
15352
+ "dist/HLSView-KOIDBUHC.js.map": {
15327
15353
  "imports": [],
15328
15354
  "exports": [],
15329
15355
  "inputs": {},
15330
15356
  "bytes": 100275
15331
15357
  },
15332
- "dist/HLSView-34MM4BU3.js": {
15358
+ "dist/HLSView-KOIDBUHC.js": {
15333
15359
  "imports": [
15334
15360
  {
15335
- "path": "dist/chunk-X5BOIOM4.js",
15361
+ "path": "dist/chunk-IVULXQJ2.js",
15336
15362
  "kind": "import-statement"
15337
15363
  },
15338
15364
  {
@@ -15510,7 +15536,7 @@
15510
15536
  "default"
15511
15537
  ],
15512
15538
  "entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
15513
- "cssBundle": "dist/HLSView-OMNF66CE.css",
15539
+ "cssBundle": "dist/HLSView-PI6JKHG4.css",
15514
15540
  "inputs": {
15515
15541
  "src/Prebuilt/layouts/HLSView.jsx": {
15516
15542
  "bytesInOutput": 27671
@@ -15569,13 +15595,13 @@
15569
15595
  },
15570
15596
  "bytes": 61702
15571
15597
  },
15572
- "dist/chunk-X5BOIOM4.js.map": {
15598
+ "dist/chunk-IVULXQJ2.js.map": {
15573
15599
  "imports": [],
15574
15600
  "exports": [],
15575
15601
  "inputs": {},
15576
- "bytes": 3488258
15602
+ "bytes": 3489549
15577
15603
  },
15578
- "dist/chunk-X5BOIOM4.js": {
15604
+ "dist/chunk-IVULXQJ2.js": {
15579
15605
  "imports": [
15580
15606
  {
15581
15607
  "path": "react",
@@ -17742,6 +17768,11 @@
17742
17768
  "kind": "import-statement",
17743
17769
  "external": true
17744
17770
  },
17771
+ {
17772
+ "path": "@100mslive/react-sdk",
17773
+ "kind": "import-statement",
17774
+ "external": true
17775
+ },
17745
17776
  {
17746
17777
  "path": "react",
17747
17778
  "kind": "import-statement",
@@ -18103,7 +18134,7 @@
18103
18134
  "external": true
18104
18135
  },
18105
18136
  {
18106
- "path": "dist/HLSView-34MM4BU3.js",
18137
+ "path": "dist/HLSView-KOIDBUHC.js",
18107
18138
  "kind": "dynamic-import"
18108
18139
  },
18109
18140
  {
@@ -19518,10 +19549,13 @@
19518
19549
  "bytesInOutput": 1050
19519
19550
  },
19520
19551
  "src/Prebuilt/components/VirtualBackground/VBPicker.tsx": {
19521
- "bytesInOutput": 7926
19552
+ "bytesInOutput": 8218
19553
+ },
19554
+ "src/Prebuilt/components/VirtualBackground/util.tsx": {
19555
+ "bytesInOutput": 449
19522
19556
  },
19523
19557
  "src/Prebuilt/components/VirtualBackground/VBCollection.tsx": {
19524
- "bytesInOutput": 1157
19558
+ "bytesInOutput": 1209
19525
19559
  },
19526
19560
  "src/Prebuilt/components/VirtualBackground/VBOption.tsx": {
19527
19561
  "bytesInOutput": 1156
@@ -19595,7 +19629,7 @@
19595
19629
  "src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
19596
19630
  "bytesInOutput": 2830
19597
19631
  },
19598
- "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462100af0/index.css": {
19632
+ "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa111/index.css": {
19599
19633
  "bytesInOutput": 0
19600
19634
  },
19601
19635
  "src/Prebuilt/common/PeersSorter.ts": {
@@ -19761,7 +19795,7 @@
19761
19795
  "bytesInOutput": 2632
19762
19796
  }
19763
19797
  },
19764
- "bytes": 1445526
19798
+ "bytes": 1446374
19765
19799
  },
19766
19800
  "dist/index.css.map": {
19767
19801
  "imports": [],
@@ -19823,22 +19857,22 @@
19823
19857
  }
19824
19858
  ],
19825
19859
  "inputs": {
19826
- "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462101233/tldraw.css": {
19860
+ "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa9f3/tldraw.css": {
19827
19861
  "bytesInOutput": 75223
19828
19862
  },
19829
- "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462100af0/index.css": {
19863
+ "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa111/index.css": {
19830
19864
  "bytesInOutput": 401
19831
19865
  }
19832
19866
  },
19833
19867
  "bytes": 75901
19834
19868
  },
19835
- "dist/HLSView-OMNF66CE.css.map": {
19869
+ "dist/HLSView-PI6JKHG4.css.map": {
19836
19870
  "imports": [],
19837
19871
  "exports": [],
19838
19872
  "inputs": {},
19839
19873
  "bytes": 122402
19840
19874
  },
19841
- "dist/HLSView-OMNF66CE.css": {
19875
+ "dist/HLSView-PI6JKHG4.css": {
19842
19876
  "imports": [
19843
19877
  {
19844
19878
  "path": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",
@@ -19892,10 +19926,10 @@
19892
19926
  }
19893
19927
  ],
19894
19928
  "inputs": {
19895
- "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462101233/tldraw.css": {
19929
+ "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa9f3/tldraw.css": {
19896
19930
  "bytesInOutput": 75223
19897
19931
  },
19898
- "../../../../../../../tmp/tmp-2903-JaV6wVIqKgme/191462100af0/index.css": {
19932
+ "../../../../../../../tmp/tmp-2889-Z7zlAYCQ7OWd/1914c14fa111/index.css": {
19899
19933
  "bytesInOutput": 401
19900
19934
  }
19901
19935
  },
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.17-alpha.17",
13
+ "version": "0.3.17-alpha.19",
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.17",
78
+ "@100mslive/hls-player": "0.3.17-alpha.19",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.17-alpha.17",
81
- "@100mslive/hms-whiteboard": "0.0.7-alpha.17",
82
- "@100mslive/react-icons": "0.10.17-alpha.17",
83
- "@100mslive/react-sdk": "0.10.17-alpha.17",
80
+ "@100mslive/hms-virtual-background": "1.13.17-alpha.19",
81
+ "@100mslive/hms-whiteboard": "0.0.7-alpha.19",
82
+ "@100mslive/react-icons": "0.10.17-alpha.19",
83
+ "@100mslive/react-sdk": "0.10.17-alpha.19",
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": "5098e38ba75de268c5bf943f11cc7832a959fefc"
120
+ "gitHead": "2fbdfe8caf300c22658c998b2c549ebc8988af7b"
121
121
  }
@@ -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
- <VBOption.Root
33
- key={option.value}
34
- testid={option.value === HMSVirtualBackgroundTypes.IMAGE ? `virtual_bg_option-${index}` : option.value}
35
- {...option}
36
- isActive={activeBackground === option.value}
37
- >
38
- <VBOption.Icon>{option?.icon}</VBOption.Icon>
39
- <VBOption.Title>{option?.title}</VBOption.Title>
40
- </VBOption.Root>
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
  );
@@ -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,6 +63,8 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
61
63
  if (!track?.id) {
62
64
  return;
63
65
  }
66
+ const isEffectsSupported = doesBrowserSupportEffectsSDK();
67
+ setIsBlurSupported(isEffectsSupported);
64
68
  const vbObject = VBHandler.getVBObject();
65
69
  if (!isPluginAdded && !vbObject) {
66
70
  setLoadingEffects(true);
@@ -68,7 +72,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
68
72
  if (!vbObject) {
69
73
  VBHandler.initialisePlugin(isEffectsEnabled && effectsKey ? effectsKey : '', () => setLoadingEffects(false));
70
74
  vbObject = VBHandler.getVBObject();
71
- if (isEffectsEnabled && effectsKey) {
75
+ if (isEffectsEnabled && isEffectsSupported && effectsKey) {
72
76
  hmsActions.addPluginsToVideoStream([vbObject as HMSEffectsPlugin]);
73
77
  } else {
74
78
  setLoadingEffects(false);
@@ -156,6 +160,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
156
160
  await VBHandler.removeEffects();
157
161
  hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.NONE);
158
162
  },
163
+ supported: true,
159
164
  },
160
165
  {
161
166
  title: 'Blur',
@@ -165,6 +170,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
165
170
  await VBHandler?.setBlur(blurAmount);
166
171
  hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.BLUR);
167
172
  },
173
+ supported: isBlurSupported,
168
174
  },
169
175
  ]}
170
176
  activeBackground={background}
@@ -209,6 +215,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
209
215
  await VBHandler?.setBackground(mediaURL);
210
216
  hmsActions.setAppData(APP_DATA.background, mediaURL);
211
217
  },
218
+ supported: true,
212
219
  }))}
213
220
  activeBackground={background}
214
221
  />
@@ -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
+ };