diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 35b93a73..7b5995f0 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -21,4 +21,10 @@ declare global { // TODO: https://gitlab.matrix.org/matrix-org/olm/-/issues/10 OLM_OPTIONS: Record; } + + // TypeScript doesn't know about the experimental setSinkId method, so we + // declare it ourselves + interface MediaElement extends HTMLMediaElement { + setSinkId: (id: string) => void; + } } diff --git a/src/video-grid/useMediaStream.ts b/src/video-grid/useMediaStream.ts index 37095040..5565ab21 100644 --- a/src/video-grid/useMediaStream.ts +++ b/src/video-grid/useMediaStream.ts @@ -26,17 +26,11 @@ declare global { } } -// TypeScript doesn't know about the experimental setSinkId method, so we -// declare it ourselves -interface MediaElement extends HTMLMediaElement { - setSinkId: (id: string) => void; -} - export const useMediaStream = ( stream: MediaStream, audioOutputDevice: string, mute = false -): RefObject => { +): RefObject => { const mediaRef = useRef(); useEffect(() => { @@ -182,7 +176,7 @@ export const useSpatialMediaStream = ( audioContext: AudioContext, audioDestination: AudioNode, mute = false -): [RefObject, RefObject] => { +): [RefObject, RefObject] => { const tileRef = useRef(); const [spatialAudio] = useSpatialAudio(); // If spatial audio is enabled, we handle audio separately from the video element