This commit is contained in:
Half-Shot
2024-12-09 11:56:25 +00:00
parent 30ca842d63
commit 950bd330d1
2 changed files with 5 additions and 5 deletions

View File

@@ -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);

View File

@@ -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<Props> = ({
const isJoined = useMatrixRTCSessionJoinState(rtcSession);
const leaveSoundContext = useLatest(
useAudioContext({
sounds: CallEventAudioSounds,
sounds: callEventAudioSounds,
latencyHint: "interactive",
}),
);
@@ -227,6 +227,7 @@ export const GroupCallView: FC<Props> = ({
// 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<Props> = ({
)
// Only sends matrix leave event. The Livekit session will disconnect once the ActiveCall-view unmounts.
.then(() => {
setLeft(true);
if (
!isPasswordlessUser &&
!confineToRoom &&