diff --git a/src/room/CallEventAudioRenderer.tsx b/src/room/CallEventAudioRenderer.tsx index 51c0de7a..5c727f98 100644 --- a/src/room/CallEventAudioRenderer.tsx +++ b/src/room/CallEventAudioRenderer.tsx @@ -25,7 +25,7 @@ import { useLatest } from "../useLatest"; export const MAX_PARTICIPANT_COUNT_FOR_SOUND = 8; export const THROTTLE_SOUND_EFFECT_MS = 500; -const sounds = prefetchSounds({ +export const callEventAudioSounds = prefetchSounds({ join: { mp3: joinCallSoundMp3, ogg: joinCallSoundOgg, @@ -46,7 +46,7 @@ export function CallEventAudioRenderer({ vm: CallViewModel; }): ReactNode { const audioEngineCtx = useAudioContext({ - sounds, + sounds: callEventAudioSounds, latencyHint: "interactive", }); const audioEngineRef = useLatest(audioEngineCtx); diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 39b8a2c5..86f9badc 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -42,7 +42,7 @@ import { useUrlParams } from "../UrlParams"; import { E2eeType } from "../e2ee/e2eeType"; import { Link } from "../button/Link"; import { useAudioContext } from "../useAudioContext"; -import { CallEventAudioSounds } from "./CallEventAudioRenderer"; +import { callEventAudioSounds } from "./CallEventAudioRenderer"; import { useLatest } from "../useLatest"; declare global { @@ -76,7 +76,7 @@ export const GroupCallView: FC = ({ const isJoined = useMatrixRTCSessionJoinState(rtcSession); const leaveSoundContext = useLatest( useAudioContext({ - sounds: CallEventAudioSounds, + sounds: callEventAudioSounds, latencyHint: "interactive", }), ); @@ -227,6 +227,7 @@ export const GroupCallView: FC = ({ // therefore we want the event to be sent instantly without getting queued/batched. const sendInstantly = !!widget; setLeaveError(leaveError); + setLeft(true); PosthogAnalytics.instance.eventCallEnded.track( rtcSession.room.roomId, rtcSession.memberships.length, @@ -241,7 +242,6 @@ export const GroupCallView: FC = ({ ) // Only sends matrix leave event. The Livekit session will disconnect once the ActiveCall-view unmounts. .then(() => { - setLeft(true); if ( !isPasswordlessUser && !confineToRoom &&