Fix spatial audio

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2022-08-15 15:11:51 +02:00
parent e5432ef260
commit c7ce689739
No known key found for this signature in database
GPG key ID: D1D45825D60C24D2

View file

@ -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);