@100mslive/roomkit-react 0.3.17-alpha.5 → 0.3.17-alpha.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -2891,7 +2891,7 @@
2891
2891
  "format": "esm"
2892
2892
  },
2893
2893
  "src/Prebuilt/components/AudioVideoToggle.tsx": {
2894
- "bytes": 13290,
2894
+ "bytes": 13759,
2895
2895
  "imports": [
2896
2896
  {
2897
2897
  "path": "react",
@@ -5601,7 +5601,7 @@
5601
5601
  "format": "cjs"
5602
5602
  },
5603
5603
  "../hms-video-store/dist/index.js": {
5604
- "bytes": 361644,
5604
+ "bytes": 361745,
5605
5605
  "imports": [
5606
5606
  {
5607
5607
  "path": "../../node_modules/reselect/es/index.js",
@@ -11216,7 +11216,7 @@
11216
11216
  ],
11217
11217
  "format": "esm"
11218
11218
  },
11219
- "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3f43/tldraw.css": {
11219
+ "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1d42/tldraw.css": {
11220
11220
  "bytes": 80111,
11221
11221
  "imports": [
11222
11222
  {
@@ -11266,7 +11266,7 @@
11266
11266
  }
11267
11267
  ]
11268
11268
  },
11269
- "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3780/index.css": {
11269
+ "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1550/index.css": {
11270
11270
  "bytes": 597,
11271
11271
  "imports": [
11272
11272
  {
@@ -11275,7 +11275,7 @@
11275
11275
  "external": true
11276
11276
  },
11277
11277
  {
11278
- "path": "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3f43/tldraw.css",
11278
+ "path": "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1d42/tldraw.css",
11279
11279
  "kind": "import-rule",
11280
11280
  "original": "@tldraw/tldraw/tldraw.css"
11281
11281
  }
@@ -11350,7 +11350,7 @@
11350
11350
  "original": "../../common/constants"
11351
11351
  },
11352
11352
  {
11353
- "path": "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3780/index.css",
11353
+ "path": "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1550/index.css",
11354
11354
  "kind": "import-statement",
11355
11355
  "original": "@100mslive/hms-whiteboard/index.css"
11356
11356
  },
@@ -15237,7 +15237,7 @@
15237
15237
  "dist/index.js": {
15238
15238
  "imports": [
15239
15239
  {
15240
- "path": "dist/chunk-CAKVWPSI.js",
15240
+ "path": "dist/chunk-YBCPTZFO.js",
15241
15241
  "kind": "import-statement"
15242
15242
  }
15243
15243
  ],
@@ -15313,16 +15313,16 @@
15313
15313
  "inputs": {},
15314
15314
  "bytes": 1882
15315
15315
  },
15316
- "dist/HLSView-SG6INEVH.js.map": {
15316
+ "dist/HLSView-FAZNEBL5.js.map": {
15317
15317
  "imports": [],
15318
15318
  "exports": [],
15319
15319
  "inputs": {},
15320
15320
  "bytes": 100275
15321
15321
  },
15322
- "dist/HLSView-SG6INEVH.js": {
15322
+ "dist/HLSView-FAZNEBL5.js": {
15323
15323
  "imports": [
15324
15324
  {
15325
- "path": "dist/chunk-CAKVWPSI.js",
15325
+ "path": "dist/chunk-YBCPTZFO.js",
15326
15326
  "kind": "import-statement"
15327
15327
  },
15328
15328
  {
@@ -15500,7 +15500,7 @@
15500
15500
  "default"
15501
15501
  ],
15502
15502
  "entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
15503
- "cssBundle": "dist/HLSView-GU7KK7TC.css",
15503
+ "cssBundle": "dist/HLSView-GNQ22CRJ.css",
15504
15504
  "inputs": {
15505
15505
  "src/Prebuilt/layouts/HLSView.jsx": {
15506
15506
  "bytesInOutput": 27671
@@ -15559,13 +15559,13 @@
15559
15559
  },
15560
15560
  "bytes": 61702
15561
15561
  },
15562
- "dist/chunk-CAKVWPSI.js.map": {
15562
+ "dist/chunk-YBCPTZFO.js.map": {
15563
15563
  "imports": [],
15564
15564
  "exports": [],
15565
15565
  "inputs": {},
15566
- "bytes": 3485726
15566
+ "bytes": 3486775
15567
15567
  },
15568
- "dist/chunk-CAKVWPSI.js": {
15568
+ "dist/chunk-YBCPTZFO.js": {
15569
15569
  "imports": [
15570
15570
  {
15571
15571
  "path": "react",
@@ -18088,7 +18088,7 @@
18088
18088
  "external": true
18089
18089
  },
18090
18090
  {
18091
- "path": "dist/HLSView-SG6INEVH.js",
18091
+ "path": "dist/HLSView-FAZNEBL5.js",
18092
18092
  "kind": "dynamic-import"
18093
18093
  },
18094
18094
  {
@@ -18687,7 +18687,7 @@
18687
18687
  ],
18688
18688
  "inputs": {
18689
18689
  "<define:process.env>": {
18690
- "bytesInOutput": 17984
18690
+ "bytesInOutput": 17962
18691
18691
  },
18692
18692
  "../../node_modules/lodash/lodash.js": {
18693
18693
  "bytesInOutput": 224289
@@ -19026,7 +19026,7 @@
19026
19026
  "bytesInOutput": 3306
19027
19027
  },
19028
19028
  "src/Prebuilt/components/AudioVideoToggle.tsx": {
19029
- "bytesInOutput": 13687
19029
+ "bytesInOutput": 14235
19030
19030
  },
19031
19031
  "src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx": {
19032
19032
  "bytesInOutput": 3293
@@ -19110,7 +19110,7 @@
19110
19110
  "bytesInOutput": 178
19111
19111
  },
19112
19112
  "src/Prebuilt/components/PIP/PIPComponent.tsx": {
19113
- "bytesInOutput": 2679
19113
+ "bytesInOutput": 2681
19114
19114
  },
19115
19115
  "src/Prebuilt/components/PIP/PIPManager.ts": {
19116
19116
  "bytesInOutput": 9818
@@ -19272,7 +19272,7 @@
19272
19272
  "bytesInOutput": 3302
19273
19273
  },
19274
19274
  "src/Prebuilt/components/AppData/useSheet.ts": {
19275
- "bytesInOutput": 844
19275
+ "bytesInOutput": 846
19276
19276
  },
19277
19277
  "src/Prebuilt/components/hooks/useUnreadPollQuizPresent.tsx": {
19278
19278
  "bytesInOutput": 658
@@ -19580,7 +19580,7 @@
19580
19580
  "src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
19581
19581
  "bytesInOutput": 2830
19582
19582
  },
19583
- "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3780/index.css": {
19583
+ "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1550/index.css": {
19584
19584
  "bytesInOutput": 0
19585
19585
  },
19586
19586
  "src/Prebuilt/common/PeersSorter.ts": {
@@ -19746,7 +19746,7 @@
19746
19746
  "bytesInOutput": 2632
19747
19747
  }
19748
19748
  },
19749
- "bytes": 1445569
19749
+ "bytes": 1446099
19750
19750
  },
19751
19751
  "dist/index.css.map": {
19752
19752
  "imports": [],
@@ -19808,22 +19808,22 @@
19808
19808
  }
19809
19809
  ],
19810
19810
  "inputs": {
19811
- "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3f43/tldraw.css": {
19811
+ "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1d42/tldraw.css": {
19812
19812
  "bytesInOutput": 75223
19813
19813
  },
19814
- "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3780/index.css": {
19814
+ "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1550/index.css": {
19815
19815
  "bytesInOutput": 401
19816
19816
  }
19817
19817
  },
19818
19818
  "bytes": 75901
19819
19819
  },
19820
- "dist/HLSView-GU7KK7TC.css.map": {
19820
+ "dist/HLSView-GNQ22CRJ.css.map": {
19821
19821
  "imports": [],
19822
19822
  "exports": [],
19823
19823
  "inputs": {},
19824
19824
  "bytes": 122402
19825
19825
  },
19826
- "dist/HLSView-GU7KK7TC.css": {
19826
+ "dist/HLSView-GNQ22CRJ.css": {
19827
19827
  "imports": [
19828
19828
  {
19829
19829
  "path": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",
@@ -19877,10 +19877,10 @@
19877
19877
  }
19878
19878
  ],
19879
19879
  "inputs": {
19880
- "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3f43/tldraw.css": {
19880
+ "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1d42/tldraw.css": {
19881
19881
  "bytesInOutput": 75223
19882
19882
  },
19883
- "../../../../../../../tmp/tmp-2800-ukOip79beZ86/1910daae3780/index.css": {
19883
+ "../../../../../../../tmp/tmp-2793-LjQzGxvDNqhd/19111aab1550/index.css": {
19884
19884
  "bytesInOutput": 401
19885
19885
  }
19886
19886
  },
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.17-alpha.5",
13
+ "version": "0.3.17-alpha.7",
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.5",
78
+ "@100mslive/hls-player": "0.3.17-alpha.7",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.17-alpha.5",
81
- "@100mslive/hms-whiteboard": "0.0.7-alpha.5",
82
- "@100mslive/react-icons": "0.10.17-alpha.5",
83
- "@100mslive/react-sdk": "0.10.17-alpha.5",
80
+ "@100mslive/hms-virtual-background": "1.13.17-alpha.7",
81
+ "@100mslive/hms-whiteboard": "0.0.7-alpha.7",
82
+ "@100mslive/react-icons": "0.10.17-alpha.7",
83
+ "@100mslive/react-sdk": "0.10.17-alpha.7",
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": "b08101f4180d7b673e1d459fd252dc3ea9a65389"
120
+ "gitHead": "a3858015ba34995efa28cd6e7ce1be842fc8b000"
121
121
  }
@@ -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 setNoiseCancellationWithPlugin = async (enabled: boolean) => {
109
- if (inProgress) {
110
- return;
111
- }
112
- if (!krispPlugin.checkSupport().isSupported) {
113
- throw Error('Krisp plugin is not supported');
114
- }
115
- setInProgress(true);
116
- if (enabled) {
117
- await actions.addPluginToAudioTrack(krispPlugin);
118
- } else {
119
- await actions.removePluginFromAudioTrack(krispPlugin);
120
- }
121
- setNoiseCancellationEnabled(enabled);
122
- setInProgress(false);
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
- if (isNoiseCancellationEnabled && !isKrispPluginAdded && !inProgress && localPeer?.audioTrack) {
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({