Merge pull request #516 from robintown/missing-audio

Fix a case where someone's audio could be missing if the audio track arrived late
This commit is contained in:
Robin 2022-08-12 14:28:12 -04:00 committed by GitHub
commit a17b62b14c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,12 +213,7 @@ export const useSpatialMediaStream = (
const sourceRef = useRef<MediaStreamAudioSourceNode>(); const sourceRef = useRef<MediaStreamAudioSourceNode>();
useEffect(() => { useEffect(() => {
if ( if (spatialAudio && tileRef.current && !mute) {
spatialAudio &&
tileRef.current &&
!mute &&
stream.getAudioTracks().length > 0
) {
if (!pannerNodeRef.current) { if (!pannerNodeRef.current) {
pannerNodeRef.current = new PannerNode(audioContext, { pannerNodeRef.current = new PannerNode(audioContext, {
panningModel: "HRTF", panningModel: "HRTF",