Fix spatial audio
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
e5432ef260
commit
c7ce689739
1 changed files with 6 additions and 2 deletions
|
@ -34,8 +34,12 @@ declare global {
|
||||||
export const useMediaStreamTrackCount = (
|
export const useMediaStreamTrackCount = (
|
||||||
stream: MediaStream
|
stream: MediaStream
|
||||||
): [number, number] => {
|
): [number, number] => {
|
||||||
const [audioTrackCount, setAudioTrackCount] = useState(0);
|
const [audioTrackCount, setAudioTrackCount] = useState(
|
||||||
const [videoTrackCount, setVideoTrackCount] = useState(0);
|
stream.getAudioTracks().length
|
||||||
|
);
|
||||||
|
const [videoTrackCount, setVideoTrackCount] = useState(
|
||||||
|
stream.getVideoTracks().length
|
||||||
|
);
|
||||||
|
|
||||||
const tracksChanged = useCallback(() => {
|
const tracksChanged = useCallback(() => {
|
||||||
setAudioTrackCount(stream.getAudioTracks().length);
|
setAudioTrackCount(stream.getAudioTracks().length);
|
||||||
|
|
Loading…
Reference in a new issue