Fix crash on screen share
Don't try to wire up audio nodes if the stream has no audio track, 'cos it'll crash. Fixes https://github.com/vector-im/element-call/issues/421
This commit is contained in:
parent
6d7f52d2d6
commit
56afbe6eb1
1 changed files with 6 additions and 1 deletions
|
@ -202,7 +202,12 @@ export const useSpatialMediaStream = (
|
|||
const sourceRef = useRef<MediaStreamAudioSourceNode>();
|
||||
|
||||
useEffect(() => {
|
||||
if (spatialAudio && tileRef.current && !mute) {
|
||||
if (
|
||||
spatialAudio &&
|
||||
tileRef.current &&
|
||||
!mute &&
|
||||
stream.getAudioTracks().length > 0
|
||||
) {
|
||||
if (!pannerNodeRef.current) {
|
||||
pannerNodeRef.current = new PannerNode(audioContext, {
|
||||
panningModel: "HRTF",
|
||||
|
|
Loading…
Reference in a new issue