fix: Improve audio channel detection for WebRTC (#2280)

- Related: #2191
This commit is contained in:
Dermot Duffy
2025-12-11 05:48:43 -08:00
committed by GitHub
parent f64690335b
commit 588ed6c98a
2 changed files with 35 additions and 1 deletions
+4
View File
@@ -16,5 +16,9 @@ export const mayHaveAudio = (video: HTMLVideoElement & AudioProperties): boolean
if (video.audioTracks !== undefined) {
return Boolean(video.audioTracks?.length);
}
// Check MediaStream audio tracks (reliable for WebRTC at load time)
if (typeof MediaStream !== 'undefined' && video.srcObject instanceof MediaStream) {
return video.srcObject.getAudioTracks().length > 0;
}
return true;
};