@100mslive/roomkit-react 0.3.14-alpha.0 → 0.3.14-alpha.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Diagnostics/AudioTest.d.ts +2 -0
- package/dist/Diagnostics/BrowserTest.d.ts +81 -0
- package/dist/Diagnostics/ConnectivityTest.d.ts +7 -0
- package/dist/Diagnostics/Diagnostics.d.ts +2 -0
- package/dist/Diagnostics/VideoTest.d.ts +2 -0
- package/dist/Diagnostics/components.d.ts +18 -0
- package/dist/Diagnostics/hms.d.ts +9 -0
- package/dist/Diagnostics/index.d.ts +1 -0
- package/dist/{HLSView-USRUP6VG.js → HLSView-PL2BEA32.js} +2 -2
- package/dist/{HLSView-7LHIA6HH.css → HLSView-TAAU7UCF.css} +3 -3
- package/dist/{HLSView-7LHIA6HH.css.map → HLSView-TAAU7UCF.css.map} +1 -1
- package/dist/Prebuilt/App.d.ts +1 -0
- package/dist/Prebuilt/components/Notifications/PermissionErrorModal.d.ts +5 -1
- package/dist/Stats/index.d.ts +1 -0
- package/dist/{chunk-DYDYPNYY.js → chunk-EKH2S2VL.js} +13835 -2768
- package/dist/chunk-EKH2S2VL.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +14870 -3708
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -1
- package/dist/meta.cjs.json +972 -197
- package/dist/meta.esbuild.json +984 -205
- package/package.json +7 -7
- package/src/Diagnostics/AudioTest.tsx +176 -0
- package/src/Diagnostics/BrowserTest.tsx +139 -0
- package/src/Diagnostics/ConnectivityTest.tsx +359 -0
- package/src/Diagnostics/DeviceSelector.jsx +71 -0
- package/src/Diagnostics/Diagnostics.tsx +134 -0
- package/src/Diagnostics/VideoTest.tsx +68 -0
- package/src/Diagnostics/components.tsx +96 -0
- package/src/Diagnostics/hms.ts +9 -0
- package/src/Diagnostics/index.ts +1 -0
- package/src/Prebuilt/App.tsx +3 -0
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +20 -3
- package/src/Prebuilt/components/Header/common.jsx +3 -0
- package/src/Prebuilt/components/Notifications/Notifications.tsx +2 -2
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.tsx +13 -11
- package/src/Prebuilt/components/StatsForNerds.jsx +1 -13
- package/src/Stats/index.tsx +1 -0
- package/src/index.ts +1 -0
- package/dist/chunk-DYDYPNYY.js.map +0 -7
- /package/dist/{HLSView-USRUP6VG.js.map → HLSView-PL2BEA32.js.map} +0 -0
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.10",
|
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.10",
|
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.10",
|
80
|
+
"@100mslive/hms-whiteboard": "0.0.4-alpha.10",
|
81
|
+
"@100mslive/react-icons": "0.10.14-alpha.10",
|
82
|
+
"@100mslive/react-sdk": "0.10.14-alpha.10",
|
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": "fe81328f37cd2b5f85c060577475ca0ba7c111cc"
|
119
119
|
}
|
@@ -0,0 +1,176 @@
|
|
1
|
+
/* eslint-disable react/prop-types */
|
2
|
+
import React, { useEffect, useState } from 'react';
|
3
|
+
import {
|
4
|
+
HMSException,
|
5
|
+
selectDevices,
|
6
|
+
selectLocalAudioTrackID,
|
7
|
+
selectLocalMediaSettings,
|
8
|
+
selectTrackAudioByID,
|
9
|
+
useHMSActions,
|
10
|
+
useHMSStore,
|
11
|
+
} from '@100mslive/react-sdk';
|
12
|
+
import { MicOnIcon, SpeakerIcon, StopIcon } from '@100mslive/react-icons';
|
13
|
+
import { PermissionErrorModal } from '../Prebuilt/components/Notifications/PermissionErrorModal';
|
14
|
+
import { TestContainer, TestFooter } from './components';
|
15
|
+
import { Button } from '../Button';
|
16
|
+
import { Box, Flex } from '../Layout';
|
17
|
+
import { Progress } from '../Progress';
|
18
|
+
import { Text } from '../Text';
|
19
|
+
// @ts-ignore: No implicit any
|
20
|
+
import { DeviceSelector } from './DeviceSelector';
|
21
|
+
import { hmsDiagnostics } from './hms';
|
22
|
+
import { useAudioOutputTest } from '../Prebuilt/components/hooks/useAudioOutputTest';
|
23
|
+
import { TEST_AUDIO_URL } from '../Prebuilt/common/constants';
|
24
|
+
|
25
|
+
const SelectContainer = ({ children }: { children: React.ReactNode }) => (
|
26
|
+
<Box css={{ w: 'calc(50% - 0.75rem)', '@lg': { w: '100%' } }}>{children}</Box>
|
27
|
+
);
|
28
|
+
|
29
|
+
const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<Error | undefined>> }) => {
|
30
|
+
const devices = useHMSStore(selectDevices);
|
31
|
+
const [isRecording, setIsRecording] = useState(false);
|
32
|
+
const [selectedMic, setSelectedMic] = useState(devices.audioInput[0]?.deviceId || 'default');
|
33
|
+
const trackID = useHMSStore(selectLocalAudioTrackID);
|
34
|
+
const audioLevel = useHMSStore(selectTrackAudioByID(trackID));
|
35
|
+
const { audioOutputDeviceId } = useHMSStore(selectLocalMediaSettings);
|
36
|
+
const { playing, setPlaying, audioRef } = useAudioOutputTest({
|
37
|
+
deviceId: audioOutputDeviceId || devices.audioOutput[0]?.deviceId,
|
38
|
+
});
|
39
|
+
|
40
|
+
return (
|
41
|
+
<SelectContainer>
|
42
|
+
<DeviceSelector
|
43
|
+
title="Microphone (Input)"
|
44
|
+
devices={devices.audioInput}
|
45
|
+
selection={selectedMic}
|
46
|
+
icon={<MicOnIcon />}
|
47
|
+
onChange={(deviceId: string) => {
|
48
|
+
setSelectedMic(deviceId);
|
49
|
+
hmsDiagnostics.stopMicCheck();
|
50
|
+
}}
|
51
|
+
/>
|
52
|
+
<Flex css={{ gap: '$6', alignItems: 'center' }}>
|
53
|
+
<Button
|
54
|
+
variant="standard"
|
55
|
+
icon
|
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}
|
74
|
+
>
|
75
|
+
{isRecording ? <StopIcon /> : <MicOnIcon />}
|
76
|
+
{isRecording ? 'Stop Recording' : 'Record'}
|
77
|
+
</Button>
|
78
|
+
|
79
|
+
<Button
|
80
|
+
icon
|
81
|
+
variant="standard"
|
82
|
+
outlined={hmsDiagnostics.getRecordedAudio() === TEST_AUDIO_URL}
|
83
|
+
onClick={() => {
|
84
|
+
if (audioRef.current) {
|
85
|
+
audioRef.current.src = hmsDiagnostics.getRecordedAudio() || '';
|
86
|
+
audioRef.current.play();
|
87
|
+
}
|
88
|
+
}}
|
89
|
+
disabled={playing || hmsDiagnostics.getRecordedAudio() === TEST_AUDIO_URL}
|
90
|
+
>
|
91
|
+
<SpeakerIcon />
|
92
|
+
{playing ? 'Playing...' : 'Playback'}
|
93
|
+
</Button>
|
94
|
+
<audio
|
95
|
+
ref={audioRef}
|
96
|
+
onEnded={() => setPlaying(false)}
|
97
|
+
onPlay={() => setPlaying(true)}
|
98
|
+
style={{ display: 'none' }}
|
99
|
+
/>
|
100
|
+
</Flex>
|
101
|
+
|
102
|
+
<Flex align="center" css={{ mt: '$4', maxWidth: '10rem', opacity: isRecording ? '1' : '0', gap: '$4' }}>
|
103
|
+
<Text>
|
104
|
+
<MicOnIcon />
|
105
|
+
</Text>
|
106
|
+
<Progress.Root value={audioLevel} css={{ h: '$2' }}>
|
107
|
+
<Progress.Content
|
108
|
+
style={{
|
109
|
+
transform: `translateX(-${100 - audioLevel}%)`,
|
110
|
+
transition: 'transform 0.3s',
|
111
|
+
}}
|
112
|
+
/>
|
113
|
+
</Progress.Root>
|
114
|
+
</Flex>
|
115
|
+
</SelectContainer>
|
116
|
+
);
|
117
|
+
};
|
118
|
+
|
119
|
+
const SpeakerTest = () => {
|
120
|
+
const actions = useHMSActions();
|
121
|
+
const devices = useHMSStore(selectDevices);
|
122
|
+
const { audioOutputDeviceId } = useHMSStore(selectLocalMediaSettings);
|
123
|
+
|
124
|
+
if (devices.audioOutput.length === 0) {
|
125
|
+
return <></>;
|
126
|
+
}
|
127
|
+
|
128
|
+
return (
|
129
|
+
<SelectContainer>
|
130
|
+
<DeviceSelector
|
131
|
+
title="Speaker (Output)"
|
132
|
+
devices={devices.audioOutput}
|
133
|
+
selection={audioOutputDeviceId || devices.audioOutput[0]?.deviceId}
|
134
|
+
icon={<SpeakerIcon />}
|
135
|
+
onChange={(deviceId: string) => {
|
136
|
+
actions.setAudioOutputDevice(deviceId);
|
137
|
+
}}
|
138
|
+
/>
|
139
|
+
</SelectContainer>
|
140
|
+
);
|
141
|
+
};
|
142
|
+
|
143
|
+
export const AudioTest = () => {
|
144
|
+
const [error, setError] = useState<Error | undefined>();
|
145
|
+
useEffect(() => {
|
146
|
+
hmsDiagnostics.requestPermission({ audio: true }).catch(error => setError(error));
|
147
|
+
}, []);
|
148
|
+
|
149
|
+
return (
|
150
|
+
<>
|
151
|
+
<TestContainer>
|
152
|
+
<Text variant="body2" css={{ c: '$on_primary_medium' }}>
|
153
|
+
Record a 10 second audio clip and play it back to check that your microphone and speaker are working. If they
|
154
|
+
aren't, make sure your volume is turned up, try a different speaker or microphone, or check your bluetooth
|
155
|
+
settings.
|
156
|
+
</Text>
|
157
|
+
|
158
|
+
<Flex
|
159
|
+
css={{
|
160
|
+
mt: '$10',
|
161
|
+
gap: '$10',
|
162
|
+
'@lg': {
|
163
|
+
flexDirection: 'column',
|
164
|
+
gap: '$8',
|
165
|
+
},
|
166
|
+
}}
|
167
|
+
>
|
168
|
+
<MicTest setError={setError} />
|
169
|
+
<SpeakerTest />
|
170
|
+
</Flex>
|
171
|
+
</TestContainer>
|
172
|
+
<TestFooter error={error} ctaText="Does your audio sound good?" />
|
173
|
+
<PermissionErrorModal error={error as HMSException} />
|
174
|
+
</>
|
175
|
+
);
|
176
|
+
};
|
@@ -0,0 +1,139 @@
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
2
|
+
import { parsedUserAgent } from '@100mslive/react-sdk';
|
3
|
+
import { TestContainer, TestFooter } from './components';
|
4
|
+
import { Box, Flex } from '../Layout';
|
5
|
+
import { Text } from '../Text';
|
6
|
+
import { hmsDiagnostics } from './hms';
|
7
|
+
|
8
|
+
const CMS_MEDIA_SERVER = 'https://storage.googleapis.com/100ms-cms-prod/';
|
9
|
+
|
10
|
+
export const operatingSystemIconInfo = {
|
11
|
+
tizen: {
|
12
|
+
key: 'tizen',
|
13
|
+
val: 'Tizen',
|
14
|
+
icon: `${CMS_MEDIA_SERVER}cms/Tizen_b99350214e/Tizen_b99350214e.svg`,
|
15
|
+
},
|
16
|
+
'mac os': {
|
17
|
+
key: 'macos',
|
18
|
+
val: 'Mac OS',
|
19
|
+
icon: `${CMS_MEDIA_SERVER}cms/mac_OS_804456afd8/mac_OS_804456afd8.png`,
|
20
|
+
},
|
21
|
+
windows: {
|
22
|
+
key: 'windows',
|
23
|
+
val: 'Windows',
|
24
|
+
icon: `${CMS_MEDIA_SERVER}cms/Windows_fdfe6749b6/Windows_fdfe6749b6.svg`,
|
25
|
+
},
|
26
|
+
linux: {
|
27
|
+
key: 'linux',
|
28
|
+
val: 'Linux',
|
29
|
+
icon: `${CMS_MEDIA_SERVER}cms/Linux_31f8353a2e/Linux_31f8353a2e.svg`,
|
30
|
+
},
|
31
|
+
chromium: {
|
32
|
+
key: 'chromium',
|
33
|
+
val: 'Chromium',
|
34
|
+
icon: `${CMS_MEDIA_SERVER}cms/Chromium_3df17710bd/Chromium_3df17710bd.svg`,
|
35
|
+
},
|
36
|
+
ubuntu: {
|
37
|
+
key: 'ubuntu',
|
38
|
+
val: 'Ubuntu',
|
39
|
+
icon: `${CMS_MEDIA_SERVER}cms/Ubuntu_966dd923c5/Ubuntu_966dd923c5.svg`,
|
40
|
+
},
|
41
|
+
ios: {
|
42
|
+
key: 'ios',
|
43
|
+
val: 'iOS',
|
44
|
+
icon: `${CMS_MEDIA_SERVER}cms/i_OS_3cdc9d9b71/i_OS_3cdc9d9b71.svg`,
|
45
|
+
},
|
46
|
+
android: {
|
47
|
+
key: 'android',
|
48
|
+
val: 'Android',
|
49
|
+
icon: `${CMS_MEDIA_SERVER}cms/Android_49dcfdc934/Android_49dcfdc934.svg`,
|
50
|
+
},
|
51
|
+
};
|
52
|
+
|
53
|
+
export const browserTypeIconInfo = {
|
54
|
+
brave: {
|
55
|
+
key: 'brave',
|
56
|
+
val: 'Brave',
|
57
|
+
icon: `${CMS_MEDIA_SERVER}cms/Brave_7e66131f09/Brave_7e66131f09.svg`,
|
58
|
+
},
|
59
|
+
chrome: {
|
60
|
+
key: 'chrome',
|
61
|
+
val: 'Chrome',
|
62
|
+
icon: `${CMS_MEDIA_SERVER}cms/Chrome_7bf77fbdd7/Chrome_7bf77fbdd7.svg`,
|
63
|
+
},
|
64
|
+
firefox: {
|
65
|
+
key: 'firefox',
|
66
|
+
val: 'Firefox',
|
67
|
+
icon: `${CMS_MEDIA_SERVER}cms/Firefox_30f3976fb8/Firefox_30f3976fb8.svg`,
|
68
|
+
},
|
69
|
+
safari: {
|
70
|
+
key: 'safari',
|
71
|
+
val: 'Safari',
|
72
|
+
icon: `${CMS_MEDIA_SERVER}cms/Safari_254e74ed94/Safari_254e74ed94.svg`,
|
73
|
+
},
|
74
|
+
'mobile safari': {
|
75
|
+
key: 'safari',
|
76
|
+
val: 'Safari',
|
77
|
+
icon: `${CMS_MEDIA_SERVER}cms/Safari_254e74ed94/Safari_254e74ed94.svg`,
|
78
|
+
},
|
79
|
+
edge: {
|
80
|
+
key: 'edge',
|
81
|
+
val: 'Edge',
|
82
|
+
icon: `${CMS_MEDIA_SERVER}cms/Edge_23add4a83f/Edge_23add4a83f.svg`,
|
83
|
+
},
|
84
|
+
opera: {
|
85
|
+
key: 'opera',
|
86
|
+
val: 'Opera',
|
87
|
+
icon: `${CMS_MEDIA_SERVER}cms/Opera_0f3bf4eb19/Opera_0f3bf4eb19.svg`,
|
88
|
+
},
|
89
|
+
};
|
90
|
+
|
91
|
+
const CheckDetails = ({ title, value, iconURL }: { title: string; value: string; iconURL?: string }) => (
|
92
|
+
<Box css={{ w: '100%', my: '$10', p: '$10', r: '$1', bg: '$surface_default', '@lg': { w: 'auto' } }}>
|
93
|
+
<Text css={{ c: '$on_primary_medium', mb: '$6' }}>{title}</Text>
|
94
|
+
<Flex align="center">
|
95
|
+
{iconURL && (
|
96
|
+
<Box css={{ size: '2rem', r: '$round', bg: '$surface_brighter', mr: '$4' }}>
|
97
|
+
<img style={{ objectFit: 'contain', width: '2rem' }} src={iconURL} alt={value} />
|
98
|
+
</Box>
|
99
|
+
)}
|
100
|
+
<Text>{value}</Text>
|
101
|
+
</Flex>
|
102
|
+
</Box>
|
103
|
+
);
|
104
|
+
|
105
|
+
export const BrowserTest = () => {
|
106
|
+
const [error, setError] = useState<Error | undefined>();
|
107
|
+
useEffect(() => {
|
108
|
+
try {
|
109
|
+
hmsDiagnostics.checkBrowserSupport();
|
110
|
+
} catch (err) {
|
111
|
+
setError(err as Error);
|
112
|
+
}
|
113
|
+
}, []);
|
114
|
+
return (
|
115
|
+
<>
|
116
|
+
<TestContainer css={{ display: 'flex', gap: '$8', '@lg': { display: 'block' } }}>
|
117
|
+
<CheckDetails
|
118
|
+
title="Browser"
|
119
|
+
iconURL={
|
120
|
+
parsedUserAgent.getBrowser().name &&
|
121
|
+
browserTypeIconInfo[parsedUserAgent.getBrowser().name?.toLowerCase() as keyof typeof browserTypeIconInfo]
|
122
|
+
?.icon
|
123
|
+
}
|
124
|
+
value={`${parsedUserAgent.getBrowser().name} ${parsedUserAgent.getBrowser().version}`}
|
125
|
+
/>
|
126
|
+
<CheckDetails
|
127
|
+
title="Operating system"
|
128
|
+
iconURL={
|
129
|
+
parsedUserAgent.getOS().name &&
|
130
|
+
operatingSystemIconInfo[parsedUserAgent.getOS().name?.toLowerCase() as keyof typeof operatingSystemIconInfo]
|
131
|
+
?.icon
|
132
|
+
}
|
133
|
+
value={`${parsedUserAgent.getOS().name} ${parsedUserAgent.getOS().version}`}
|
134
|
+
/>
|
135
|
+
</TestContainer>
|
136
|
+
<TestFooter error={error} ctaText="Is your device information correct?" />
|
137
|
+
</>
|
138
|
+
);
|
139
|
+
};
|