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 = (
|
||||
stream: MediaStream
|
||||
): [number, number] => {
|
||||
const [audioTrackCount, setAudioTrackCount] = useState(0);
|
||||
const [videoTrackCount, setVideoTrackCount] = useState(0);
|
||||
const [audioTrackCount, setAudioTrackCount] = useState(
|
||||
stream.getAudioTracks().length
|
||||
);
|
||||
const [videoTrackCount, setVideoTrackCount] = useState(
|
||||
stream.getVideoTracks().length
|
||||
);
|
||||
|
||||
const tracksChanged = useCallback(() => {
|
||||
setAudioTrackCount(stream.getAudioTracks().length);
|
||||
|
|
Loading…
Reference in a new issue