mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-31 07:00:26 +00:00
Remove debug bits.
This commit is contained in:
@@ -24,7 +24,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,
|
||||
@@ -45,7 +45,7 @@ export function CallEventAudioRenderer({
|
||||
vm: CallViewModel;
|
||||
}): ReactNode {
|
||||
const audioEngineCtx = useAudioContext({
|
||||
sounds: Sounds,
|
||||
sounds: CallEventAudioSounds,
|
||||
latencyHint: "interactive",
|
||||
});
|
||||
const audioEngineRef = useLatest(audioEngineCtx);
|
||||
|
||||
@@ -226,7 +226,6 @@ export const GroupCallView: FC<Props> = ({
|
||||
// In embedded/widget mode the iFrame will be killed right after the call ended prohibiting the posthog event from getting sent,
|
||||
// therefore we want the event to be sent instantly without getting queued/batched.
|
||||
const sendInstantly = !!widget;
|
||||
console.log("hangup!", sendInstantly);
|
||||
setLeaveError(leaveError);
|
||||
PosthogAnalytics.instance.eventCallEnded.track(
|
||||
rtcSession.room.roomId,
|
||||
|
||||
@@ -24,18 +24,21 @@ type SoundDefinition = { mp3?: string; ogg: string };
|
||||
* @param volume The volume to play at.
|
||||
* @param ctx The context to play through.
|
||||
* @param buffer The buffer to play.
|
||||
* @returns A promise that resolves when the sound has finished playing.
|
||||
*/
|
||||
function playSound(
|
||||
ctx: AudioContext,
|
||||
buffer: AudioBuffer,
|
||||
volume: number,
|
||||
): void {
|
||||
): Promise<void> {
|
||||
const gain = ctx.createGain();
|
||||
gain.gain.setValueAtTime(volume, 0);
|
||||
const src = ctx.createBufferSource();
|
||||
src.buffer = buffer;
|
||||
src.connect(gain).connect(ctx.destination);
|
||||
const p = new Promise<void>((r) => src.addEventListener("ended", () => r()));
|
||||
src.start();
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -163,7 +166,7 @@ export function useAudioContext<S extends string>(
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
playSound: (name): void => {
|
||||
playSound: (name): Promise<void> => {
|
||||
if (!audioBuffers[name]) {
|
||||
logger.debug(`Tried to play a sound that wasn't buffered (${name})`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user