@100mslive/roomkit-react 0.2.6 → 0.2.7-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +30 -33
- package/dist/{HLSView-A5DVXKEU.js → HLSView-4B5MUDFR.js} +2 -2
- package/dist/Prebuilt/common/constants.d.ts +4 -3
- package/dist/Prebuilt/components/AudioVideoToggle.d.ts +9 -0
- package/dist/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.d.ts +11 -0
- package/dist/Prebuilt/components/hooks/useAudioOutputTest.d.ts +8 -0
- package/dist/{chunk-KUVM2TEZ.js → chunk-KST24BRA.js} +4227 -3807
- package/dist/chunk-KST24BRA.js.map +7 -0
- package/dist/index.cjs.js +5518 -5092
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +666 -597
- package/dist/meta.esbuild.json +673 -604
- package/package.json +7 -6
- package/src/Prebuilt/common/constants.ts +7 -4
- package/src/Prebuilt/components/AppData/useUISettings.js +1 -1
- package/src/Prebuilt/components/AudioVideoToggle.tsx +308 -0
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +1 -0
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +159 -0
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +0 -2
- package/src/Prebuilt/components/Notifications/HandRaisedNotifications.tsx +13 -2
- package/src/Prebuilt/components/Notifications/Notifications.tsx +1 -18
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +10 -17
- package/src/Prebuilt/components/hooks/useAudioOutputTest.tsx +20 -0
- package/dist/chunk-KUVM2TEZ.js.map +0 -7
- package/src/Prebuilt/components/AudioVideoToggle.jsx +0 -171
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +0 -121
- /package/dist/{HLSView-A5DVXKEU.js.map → HLSView-4B5MUDFR.js.map} +0 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
2
|
+
|
3
|
+
export const useAudioOutputTest = ({ deviceId }: { deviceId: string }) => {
|
4
|
+
const audioRef = useRef<HTMLAudioElement | null>(null);
|
5
|
+
const [playing, setPlaying] = useState(false);
|
6
|
+
useEffect(() => {
|
7
|
+
if (audioRef.current && deviceId) {
|
8
|
+
try {
|
9
|
+
// @ts-ignore
|
10
|
+
if (typeof audioRef.current.setSinkId !== 'undefined') {
|
11
|
+
// @ts-ignore
|
12
|
+
audioRef.current.setSinkId(deviceId);
|
13
|
+
}
|
14
|
+
} catch (error) {
|
15
|
+
console.log(error);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}, [deviceId]);
|
19
|
+
return { playing, setPlaying, audioRef };
|
20
|
+
};
|