@100mslive/roomkit-react 0.3.14-alpha.7 → 0.3.14-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HLSView-RRYP5FV5.js → HLSView-C7QKK3HT.js} +2 -2
- package/dist/{HLSView-YIIBVIYC.css → HLSView-UMOI3RZE.css} +3 -3
- package/dist/{HLSView-YIIBVIYC.css.map → HLSView-UMOI3RZE.css.map} +1 -1
- package/dist/Prebuilt/components/Notifications/PermissionErrorModal.d.ts +5 -1
- package/dist/{chunk-DR5OAQOV.js → chunk-EODBFJ5Y.js} +530 -503
- package/dist/{chunk-DR5OAQOV.js.map → chunk-EODBFJ5Y.js.map} +3 -3
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +569 -545
- 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 +32 -22
- package/dist/meta.esbuild.json +42 -32
- package/package.json +7 -7
- package/src/Diagnostics/AudioTest.tsx +27 -18
- package/src/Diagnostics/VideoTest.tsx +10 -2
- package/src/Prebuilt/components/Notifications/Notifications.tsx +2 -2
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.tsx +13 -11
- /package/dist/{HLSView-RRYP5FV5.js.map → HLSView-C7QKK3HT.js.map} +0 -0
package/dist/meta.esbuild.json
CHANGED
|
@@ -4951,7 +4951,7 @@
|
|
|
4951
4951
|
"format": "cjs"
|
|
4952
4952
|
},
|
|
4953
4953
|
"../hms-video-store/dist/index.js": {
|
|
4954
|
-
"bytes":
|
|
4954
|
+
"bytes": 356187,
|
|
4955
4955
|
"imports": [
|
|
4956
4956
|
{
|
|
4957
4957
|
"path": "../../node_modules/reselect/es/index.js",
|
|
@@ -10974,7 +10974,7 @@
|
|
|
10974
10974
|
],
|
|
10975
10975
|
"format": "esm"
|
|
10976
10976
|
},
|
|
10977
|
-
"../../../../../../../tmp/tmp-
|
|
10977
|
+
"../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa6923/tldraw.css": {
|
|
10978
10978
|
"bytes": 80111,
|
|
10979
10979
|
"imports": [
|
|
10980
10980
|
{
|
|
@@ -11024,7 +11024,7 @@
|
|
|
11024
11024
|
}
|
|
11025
11025
|
]
|
|
11026
11026
|
},
|
|
11027
|
-
"../../../../../../../tmp/tmp-
|
|
11027
|
+
"../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa62a1/index.css": {
|
|
11028
11028
|
"bytes": 597,
|
|
11029
11029
|
"imports": [
|
|
11030
11030
|
{
|
|
@@ -11033,7 +11033,7 @@
|
|
|
11033
11033
|
"external": true
|
|
11034
11034
|
},
|
|
11035
11035
|
{
|
|
11036
|
-
"path": "../../../../../../../tmp/tmp-
|
|
11036
|
+
"path": "../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa6923/tldraw.css",
|
|
11037
11037
|
"kind": "import-rule",
|
|
11038
11038
|
"original": "@tldraw/tldraw/tldraw.css"
|
|
11039
11039
|
}
|
|
@@ -11108,7 +11108,7 @@
|
|
|
11108
11108
|
"original": "../../common/constants"
|
|
11109
11109
|
},
|
|
11110
11110
|
{
|
|
11111
|
-
"path": "../../../../../../../tmp/tmp-
|
|
11111
|
+
"path": "../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa62a1/index.css",
|
|
11112
11112
|
"kind": "import-statement",
|
|
11113
11113
|
"original": "@100mslive/hms-whiteboard/index.css"
|
|
11114
11114
|
},
|
|
@@ -13195,7 +13195,7 @@
|
|
|
13195
13195
|
"imports": []
|
|
13196
13196
|
},
|
|
13197
13197
|
"src/Prebuilt/components/Notifications/PermissionErrorModal.tsx": {
|
|
13198
|
-
"bytes":
|
|
13198
|
+
"bytes": 4913,
|
|
13199
13199
|
"imports": [
|
|
13200
13200
|
{
|
|
13201
13201
|
"path": "react",
|
|
@@ -13406,7 +13406,7 @@
|
|
|
13406
13406
|
"format": "esm"
|
|
13407
13407
|
},
|
|
13408
13408
|
"src/Prebuilt/components/Notifications/Notifications.tsx": {
|
|
13409
|
-
"bytes":
|
|
13409
|
+
"bytes": 8058,
|
|
13410
13410
|
"imports": [
|
|
13411
13411
|
{
|
|
13412
13412
|
"path": "react",
|
|
@@ -14409,7 +14409,7 @@
|
|
|
14409
14409
|
"format": "esm"
|
|
14410
14410
|
},
|
|
14411
14411
|
"src/Diagnostics/AudioTest.tsx": {
|
|
14412
|
-
"bytes":
|
|
14412
|
+
"bytes": 5792,
|
|
14413
14413
|
"imports": [
|
|
14414
14414
|
{
|
|
14415
14415
|
"path": "react",
|
|
@@ -14426,6 +14426,11 @@
|
|
|
14426
14426
|
"kind": "import-statement",
|
|
14427
14427
|
"external": true
|
|
14428
14428
|
},
|
|
14429
|
+
{
|
|
14430
|
+
"path": "src/Prebuilt/components/Notifications/PermissionErrorModal.tsx",
|
|
14431
|
+
"kind": "import-statement",
|
|
14432
|
+
"original": "../Prebuilt/components/Notifications/PermissionErrorModal"
|
|
14433
|
+
},
|
|
14429
14434
|
{
|
|
14430
14435
|
"path": "src/Diagnostics/components.tsx",
|
|
14431
14436
|
"kind": "import-statement",
|
|
@@ -14582,7 +14587,7 @@
|
|
|
14582
14587
|
"format": "esm"
|
|
14583
14588
|
},
|
|
14584
14589
|
"src/Diagnostics/VideoTest.tsx": {
|
|
14585
|
-
"bytes":
|
|
14590
|
+
"bytes": 2521,
|
|
14586
14591
|
"imports": [
|
|
14587
14592
|
{
|
|
14588
14593
|
"path": "react",
|
|
@@ -14599,6 +14604,11 @@
|
|
|
14599
14604
|
"kind": "import-statement",
|
|
14600
14605
|
"external": true
|
|
14601
14606
|
},
|
|
14607
|
+
{
|
|
14608
|
+
"path": "src/Prebuilt/components/Notifications/PermissionErrorModal.tsx",
|
|
14609
|
+
"kind": "import-statement",
|
|
14610
|
+
"original": "../Prebuilt/components/Notifications/PermissionErrorModal"
|
|
14611
|
+
},
|
|
14602
14612
|
{
|
|
14603
14613
|
"path": "src/Diagnostics/components.tsx",
|
|
14604
14614
|
"kind": "import-statement",
|
|
@@ -14961,7 +14971,7 @@
|
|
|
14961
14971
|
"dist/index.js": {
|
|
14962
14972
|
"imports": [
|
|
14963
14973
|
{
|
|
14964
|
-
"path": "dist/chunk-
|
|
14974
|
+
"path": "dist/chunk-EODBFJ5Y.js",
|
|
14965
14975
|
"kind": "import-statement"
|
|
14966
14976
|
}
|
|
14967
14977
|
],
|
|
@@ -15037,16 +15047,16 @@
|
|
|
15037
15047
|
"inputs": {},
|
|
15038
15048
|
"bytes": 1882
|
|
15039
15049
|
},
|
|
15040
|
-
"dist/HLSView-
|
|
15050
|
+
"dist/HLSView-C7QKK3HT.js.map": {
|
|
15041
15051
|
"imports": [],
|
|
15042
15052
|
"exports": [],
|
|
15043
15053
|
"inputs": {},
|
|
15044
15054
|
"bytes": 100275
|
|
15045
15055
|
},
|
|
15046
|
-
"dist/HLSView-
|
|
15056
|
+
"dist/HLSView-C7QKK3HT.js": {
|
|
15047
15057
|
"imports": [
|
|
15048
15058
|
{
|
|
15049
|
-
"path": "dist/chunk-
|
|
15059
|
+
"path": "dist/chunk-EODBFJ5Y.js",
|
|
15050
15060
|
"kind": "import-statement"
|
|
15051
15061
|
},
|
|
15052
15062
|
{
|
|
@@ -15224,7 +15234,7 @@
|
|
|
15224
15234
|
"default"
|
|
15225
15235
|
],
|
|
15226
15236
|
"entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
|
|
15227
|
-
"cssBundle": "dist/HLSView-
|
|
15237
|
+
"cssBundle": "dist/HLSView-UMOI3RZE.css",
|
|
15228
15238
|
"inputs": {
|
|
15229
15239
|
"src/Prebuilt/layouts/HLSView.jsx": {
|
|
15230
15240
|
"bytesInOutput": 27671
|
|
@@ -15283,13 +15293,13 @@
|
|
|
15283
15293
|
},
|
|
15284
15294
|
"bytes": 61702
|
|
15285
15295
|
},
|
|
15286
|
-
"dist/chunk-
|
|
15296
|
+
"dist/chunk-EODBFJ5Y.js.map": {
|
|
15287
15297
|
"imports": [],
|
|
15288
15298
|
"exports": [],
|
|
15289
15299
|
"inputs": {},
|
|
15290
|
-
"bytes":
|
|
15300
|
+
"bytes": 3895547
|
|
15291
15301
|
},
|
|
15292
|
-
"dist/chunk-
|
|
15302
|
+
"dist/chunk-EODBFJ5Y.js": {
|
|
15293
15303
|
"imports": [
|
|
15294
15304
|
{
|
|
15295
15305
|
"path": "react",
|
|
@@ -17772,7 +17782,7 @@
|
|
|
17772
17782
|
"external": true
|
|
17773
17783
|
},
|
|
17774
17784
|
{
|
|
17775
|
-
"path": "dist/HLSView-
|
|
17785
|
+
"path": "dist/HLSView-C7QKK3HT.js",
|
|
17776
17786
|
"kind": "dynamic-import"
|
|
17777
17787
|
},
|
|
17778
17788
|
{
|
|
@@ -18356,7 +18366,7 @@
|
|
|
18356
18366
|
],
|
|
18357
18367
|
"inputs": {
|
|
18358
18368
|
"<define:process.env>": {
|
|
18359
|
-
"bytesInOutput":
|
|
18369
|
+
"bytesInOutput": 17887
|
|
18360
18370
|
},
|
|
18361
18371
|
"../../node_modules/lodash/lodash.js": {
|
|
18362
18372
|
"bytesInOutput": 224414
|
|
@@ -18839,7 +18849,7 @@
|
|
|
18839
18849
|
"bytesInOutput": 9484
|
|
18840
18850
|
},
|
|
18841
18851
|
"../hms-video-store/dist/index.js": {
|
|
18842
|
-
"bytesInOutput":
|
|
18852
|
+
"bytesInOutput": 459085
|
|
18843
18853
|
},
|
|
18844
18854
|
"../../node_modules/reselect/es/index.js": {
|
|
18845
18855
|
"bytesInOutput": 2550
|
|
@@ -19237,7 +19247,7 @@
|
|
|
19237
19247
|
"src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
|
|
19238
19248
|
"bytesInOutput": 2797
|
|
19239
19249
|
},
|
|
19240
|
-
"../../../../../../../tmp/tmp-
|
|
19250
|
+
"../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa62a1/index.css": {
|
|
19241
19251
|
"bytesInOutput": 0
|
|
19242
19252
|
},
|
|
19243
19253
|
"src/Prebuilt/common/PeersSorter.ts": {
|
|
@@ -19298,7 +19308,7 @@
|
|
|
19298
19308
|
"bytesInOutput": 27
|
|
19299
19309
|
},
|
|
19300
19310
|
"src/Prebuilt/components/Notifications/Notifications.tsx": {
|
|
19301
|
-
"bytesInOutput":
|
|
19311
|
+
"bytesInOutput": 8128
|
|
19302
19312
|
},
|
|
19303
19313
|
"src/Prebuilt/components/Notifications/AutoplayBlockedModal.tsx": {
|
|
19304
19314
|
"bytesInOutput": 1053
|
|
@@ -19322,7 +19332,7 @@
|
|
|
19322
19332
|
"bytesInOutput": 1428
|
|
19323
19333
|
},
|
|
19324
19334
|
"src/Prebuilt/components/Notifications/PermissionErrorModal.tsx": {
|
|
19325
|
-
"bytesInOutput":
|
|
19335
|
+
"bytesInOutput": 4527
|
|
19326
19336
|
},
|
|
19327
19337
|
"src/Prebuilt/images/android-perm-1.png": {
|
|
19328
19338
|
"bytesInOutput": 10443
|
|
@@ -19391,7 +19401,7 @@
|
|
|
19391
19401
|
"bytesInOutput": 237
|
|
19392
19402
|
},
|
|
19393
19403
|
"src/Diagnostics/AudioTest.tsx": {
|
|
19394
|
-
"bytesInOutput":
|
|
19404
|
+
"bytesInOutput": 5835
|
|
19395
19405
|
},
|
|
19396
19406
|
"src/Diagnostics/DeviceSelector.jsx": {
|
|
19397
19407
|
"bytesInOutput": 2155
|
|
@@ -19403,10 +19413,10 @@
|
|
|
19403
19413
|
"bytesInOutput": 12614
|
|
19404
19414
|
},
|
|
19405
19415
|
"src/Diagnostics/VideoTest.tsx": {
|
|
19406
|
-
"bytesInOutput":
|
|
19416
|
+
"bytesInOutput": 2376
|
|
19407
19417
|
}
|
|
19408
19418
|
},
|
|
19409
|
-
"bytes":
|
|
19419
|
+
"bytes": 1851849
|
|
19410
19420
|
},
|
|
19411
19421
|
"dist/index.css.map": {
|
|
19412
19422
|
"imports": [],
|
|
@@ -19468,22 +19478,22 @@
|
|
|
19468
19478
|
}
|
|
19469
19479
|
],
|
|
19470
19480
|
"inputs": {
|
|
19471
|
-
"../../../../../../../tmp/tmp-
|
|
19481
|
+
"../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa6923/tldraw.css": {
|
|
19472
19482
|
"bytesInOutput": 75223
|
|
19473
19483
|
},
|
|
19474
|
-
"../../../../../../../tmp/tmp-
|
|
19484
|
+
"../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa62a1/index.css": {
|
|
19475
19485
|
"bytesInOutput": 401
|
|
19476
19486
|
}
|
|
19477
19487
|
},
|
|
19478
19488
|
"bytes": 75901
|
|
19479
19489
|
},
|
|
19480
|
-
"dist/HLSView-
|
|
19490
|
+
"dist/HLSView-UMOI3RZE.css.map": {
|
|
19481
19491
|
"imports": [],
|
|
19482
19492
|
"exports": [],
|
|
19483
19493
|
"inputs": {},
|
|
19484
19494
|
"bytes": 122402
|
|
19485
19495
|
},
|
|
19486
|
-
"dist/HLSView-
|
|
19496
|
+
"dist/HLSView-UMOI3RZE.css": {
|
|
19487
19497
|
"imports": [
|
|
19488
19498
|
{
|
|
19489
19499
|
"path": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",
|
|
@@ -19537,10 +19547,10 @@
|
|
|
19537
19547
|
}
|
|
19538
19548
|
],
|
|
19539
19549
|
"inputs": {
|
|
19540
|
-
"../../../../../../../tmp/tmp-
|
|
19550
|
+
"../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa6923/tldraw.css": {
|
|
19541
19551
|
"bytesInOutput": 75223
|
|
19542
19552
|
},
|
|
19543
|
-
"../../../../../../../tmp/tmp-
|
|
19553
|
+
"../../../../../../../tmp/tmp-2968-7h0gdY75JTYT/1903acfa62a1/index.css": {
|
|
19544
19554
|
"bytesInOutput": 401
|
|
19545
19555
|
}
|
|
19546
19556
|
},
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"prebuilt",
|
|
11
11
|
"roomkit"
|
|
12
12
|
],
|
|
13
|
-
"version": "0.3.14-alpha.
|
|
13
|
+
"version": "0.3.14-alpha.8",
|
|
14
14
|
"author": "100ms",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"react": ">=17.0.2 <19.0.0"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@100mslive/hls-player": "0.3.14-alpha.
|
|
77
|
+
"@100mslive/hls-player": "0.3.14-alpha.8",
|
|
78
78
|
"@100mslive/hms-noise-cancellation": "0.0.1",
|
|
79
|
-
"@100mslive/hms-virtual-background": "1.13.14-alpha.
|
|
80
|
-
"@100mslive/hms-whiteboard": "0.0.4-alpha.
|
|
81
|
-
"@100mslive/react-icons": "0.10.14-alpha.
|
|
82
|
-
"@100mslive/react-sdk": "0.10.14-alpha.
|
|
79
|
+
"@100mslive/hms-virtual-background": "1.13.14-alpha.8",
|
|
80
|
+
"@100mslive/hms-whiteboard": "0.0.4-alpha.8",
|
|
81
|
+
"@100mslive/react-icons": "0.10.14-alpha.8",
|
|
82
|
+
"@100mslive/react-sdk": "0.10.14-alpha.8",
|
|
83
83
|
"@100mslive/types-prebuilt": "0.12.9",
|
|
84
84
|
"@emoji-mart/data": "^1.0.6",
|
|
85
85
|
"@emoji-mart/react": "^1.0.1",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"uuid": "^8.3.2",
|
|
116
116
|
"worker-timers": "^7.0.40"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "16a110b525265ba74c72960c828e6ce933df52cf"
|
|
119
119
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
+
HMSException,
|
|
4
5
|
selectDevices,
|
|
5
6
|
selectLocalAudioTrackID,
|
|
6
7
|
selectLocalMediaSettings,
|
|
@@ -8,7 +9,8 @@ import {
|
|
|
8
9
|
useHMSActions,
|
|
9
10
|
useHMSStore,
|
|
10
11
|
} from '@100mslive/react-sdk';
|
|
11
|
-
import { MicOnIcon, SpeakerIcon } from '@100mslive/react-icons';
|
|
12
|
+
import { MicOnIcon, SpeakerIcon, StopIcon } from '@100mslive/react-icons';
|
|
13
|
+
import { PermissionErrorModal } from '../Prebuilt/components/Notifications/PermissionErrorModal';
|
|
12
14
|
import { TestContainer, TestFooter } from './components';
|
|
13
15
|
import { Button } from '../Button';
|
|
14
16
|
import { Box, Flex } from '../Layout';
|
|
@@ -24,11 +26,10 @@ const SelectContainer = ({ children }: { children: React.ReactNode }) => (
|
|
|
24
26
|
<Box css={{ w: 'calc(50% - 0.75rem)', '@lg': { w: '100%' } }}>{children}</Box>
|
|
25
27
|
);
|
|
26
28
|
|
|
27
|
-
const MicTest = () => {
|
|
29
|
+
const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<Error | undefined>> }) => {
|
|
28
30
|
const devices = useHMSStore(selectDevices);
|
|
29
31
|
const [isRecording, setIsRecording] = useState(false);
|
|
30
|
-
const
|
|
31
|
-
const [selectedMic, setSelectedMic] = useState(audioInputDeviceId || devices.audioInput[0]?.deviceId);
|
|
32
|
+
const [selectedMic, setSelectedMic] = useState(devices.audioInput[0]?.deviceId || 'default');
|
|
32
33
|
const trackID = useHMSStore(selectLocalAudioTrackID);
|
|
33
34
|
const audioLevel = useHMSStore(selectTrackAudioByID(trackID));
|
|
34
35
|
const { audioOutputDeviceId } = useHMSStore(selectLocalMediaSettings);
|
|
@@ -46,26 +47,33 @@ const MicTest = () => {
|
|
|
46
47
|
onChange={(deviceId: string) => {
|
|
47
48
|
setSelectedMic(deviceId);
|
|
48
49
|
hmsDiagnostics.stopMicCheck();
|
|
49
|
-
setIsRecording(false);
|
|
50
50
|
}}
|
|
51
51
|
/>
|
|
52
52
|
<Flex css={{ gap: '$6', alignItems: 'center' }}>
|
|
53
53
|
<Button
|
|
54
54
|
variant="standard"
|
|
55
55
|
icon
|
|
56
|
-
onClick={() =>
|
|
57
|
-
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
onClick={() => {
|
|
57
|
+
isRecording
|
|
58
|
+
? hmsDiagnostics.stopMicCheck()
|
|
59
|
+
: hmsDiagnostics
|
|
60
|
+
.startMicCheck({
|
|
61
|
+
inputDevice: selectedMic,
|
|
62
|
+
onError: (err: Error) => {
|
|
63
|
+
setError(err);
|
|
64
|
+
},
|
|
65
|
+
onStop: () => {
|
|
66
|
+
setIsRecording(false);
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
.then(() => {
|
|
70
|
+
setIsRecording(true);
|
|
71
|
+
});
|
|
72
|
+
}}
|
|
73
|
+
disabled={devices.audioInput.length === 0 || playing}
|
|
66
74
|
>
|
|
67
|
-
<MicOnIcon />
|
|
68
|
-
{isRecording ? 'Recording
|
|
75
|
+
{isRecording ? <StopIcon /> : <MicOnIcon />}
|
|
76
|
+
{isRecording ? 'Stop Recording' : 'Record'}
|
|
69
77
|
</Button>
|
|
70
78
|
|
|
71
79
|
<Button
|
|
@@ -157,11 +165,12 @@ export const AudioTest = () => {
|
|
|
157
165
|
},
|
|
158
166
|
}}
|
|
159
167
|
>
|
|
160
|
-
|
|
168
|
+
<MicTest setError={setError} />
|
|
161
169
|
<SpeakerTest />
|
|
162
170
|
</Flex>
|
|
163
171
|
</TestContainer>
|
|
164
172
|
<TestFooter error={error} ctaText="Does your audio sound good?" />
|
|
173
|
+
<PermissionErrorModal error={error as HMSException} />
|
|
165
174
|
</>
|
|
166
175
|
);
|
|
167
176
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
HMSException,
|
|
4
|
+
selectDevices,
|
|
5
|
+
selectLocalMediaSettings,
|
|
6
|
+
selectLocalVideoTrackID,
|
|
7
|
+
useHMSStore,
|
|
8
|
+
} from '@100mslive/react-sdk';
|
|
3
9
|
import { VideoOnIcon } from '@100mslive/react-icons';
|
|
10
|
+
import { PermissionErrorModal } from '../Prebuilt/components/Notifications/PermissionErrorModal';
|
|
4
11
|
import { TestContainer, TestFooter } from './components';
|
|
5
12
|
import { Flex } from '../Layout';
|
|
6
13
|
import { Text } from '../Text';
|
|
@@ -15,7 +22,7 @@ export const VideoTest = () => {
|
|
|
15
22
|
const { videoInput } = allDevices;
|
|
16
23
|
const trackID = useHMSStore(selectLocalVideoTrackID);
|
|
17
24
|
const sdkSelectedDevices = useHMSStore(selectLocalMediaSettings);
|
|
18
|
-
const [error, setError] = useState<
|
|
25
|
+
const [error, setError] = useState<HMSException | undefined>();
|
|
19
26
|
|
|
20
27
|
useEffect(() => {
|
|
21
28
|
hmsDiagnostics.startCameraCheck().catch(err => setError(err));
|
|
@@ -55,6 +62,7 @@ export const VideoTest = () => {
|
|
|
55
62
|
</Flex>
|
|
56
63
|
</TestContainer>
|
|
57
64
|
<TestFooter error={error} ctaText="Does your video look good?" />
|
|
65
|
+
<PermissionErrorModal error={error} />
|
|
58
66
|
</>
|
|
59
67
|
);
|
|
60
68
|
};
|
|
@@ -24,7 +24,7 @@ import { ChatNotifications } from './ChatNotifications';
|
|
|
24
24
|
import { HandRaisedNotifications } from './HandRaisedNotifications';
|
|
25
25
|
import { InitErrorModal } from './InitErrorModal';
|
|
26
26
|
import { PeerNotifications } from './PeerNotifications';
|
|
27
|
-
import {
|
|
27
|
+
import { PermissionErrorNotificationModal } from './PermissionErrorModal';
|
|
28
28
|
import { ReconnectNotifications } from './ReconnectNotifications';
|
|
29
29
|
import { TrackBulkUnmuteModal } from './TrackBulkUnmuteModal';
|
|
30
30
|
import { TrackNotifications } from './TrackNotifications';
|
|
@@ -197,7 +197,7 @@ export function Notifications() {
|
|
|
197
197
|
{roomState === HMSRoomState.Connected ? <PeerNotifications /> : null}
|
|
198
198
|
<ReconnectNotifications />
|
|
199
199
|
<AutoplayBlockedModal />
|
|
200
|
-
<
|
|
200
|
+
<PermissionErrorNotificationModal />
|
|
201
201
|
<InitErrorModal />
|
|
202
202
|
<ChatNotifications />
|
|
203
203
|
<HandRaisedNotifications />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { useMedia } from 'react-use';
|
|
3
|
-
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
|
3
|
+
import { HMSException, HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
|
4
4
|
import { Button, config as cssConfig, Dialog, Flex, Text } from '../../..';
|
|
5
5
|
// @ts-ignore: No implicit Any
|
|
6
6
|
import androidPermissionAlert from '../../images/android-perm-1.png';
|
|
@@ -9,22 +9,24 @@ import iosPermissions from '../../images/ios-perm-0.png';
|
|
|
9
9
|
// @ts-ignore: No implicit Any
|
|
10
10
|
import { isAndroid, isIOS } from '../../common/constants';
|
|
11
11
|
|
|
12
|
-
export function
|
|
12
|
+
export function PermissionErrorNotificationModal() {
|
|
13
13
|
const notification = useHMSNotifications(HMSNotificationTypes.ERROR);
|
|
14
|
+
return <PermissionErrorModal error={notification?.data} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const PermissionErrorModal = ({ error }: { error?: HMSException }) => {
|
|
14
18
|
const [deviceType, setDeviceType] = useState('');
|
|
15
19
|
const [isSystemError, setIsSystemError] = useState(false);
|
|
16
20
|
const isMobile = useMedia(cssConfig.media.md);
|
|
17
|
-
|
|
18
21
|
useEffect(() => {
|
|
19
22
|
if (
|
|
20
|
-
!
|
|
21
|
-
(
|
|
22
|
-
(
|
|
23
|
+
!error ||
|
|
24
|
+
(error?.code !== 3001 && error?.code !== 3011) ||
|
|
25
|
+
(error?.code === 3001 && error?.message.includes('screen'))
|
|
23
26
|
) {
|
|
24
27
|
return;
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
const errorMessage = notification.data?.message;
|
|
29
|
+
const errorMessage = error?.message;
|
|
28
30
|
const hasAudio = errorMessage.includes('audio');
|
|
29
31
|
const hasVideo = errorMessage.includes('video');
|
|
30
32
|
const hasScreen = errorMessage.includes('screen');
|
|
@@ -37,8 +39,8 @@ export function PermissionErrorModal() {
|
|
|
37
39
|
} else if (hasScreen) {
|
|
38
40
|
setDeviceType('screen');
|
|
39
41
|
}
|
|
40
|
-
setIsSystemError(
|
|
41
|
-
}, [
|
|
42
|
+
setIsSystemError(error.code === 3011);
|
|
43
|
+
}, [error]);
|
|
42
44
|
|
|
43
45
|
return deviceType ? (
|
|
44
46
|
<Dialog.Root open={!!deviceType}>
|
|
@@ -131,4 +133,4 @@ export function PermissionErrorModal() {
|
|
|
131
133
|
</Dialog.Portal>
|
|
132
134
|
</Dialog.Root>
|
|
133
135
|
) : null;
|
|
134
|
-
}
|
|
136
|
+
};
|
|
File without changes
|