mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-10 23:25:52 +00:00
review play sounds does not throw
This commit is contained in:
@@ -209,7 +209,9 @@ export function useAudioContext<S extends string>(
|
|||||||
},
|
},
|
||||||
playSoundLooping: (name, delayS: number): (() => Promise<void>) => {
|
playSoundLooping: (name, delayS: number): (() => Promise<void>) => {
|
||||||
if (!audioBuffers[name]) {
|
if (!audioBuffers[name]) {
|
||||||
throw Error(`Tried to play a sound that wasn't buffered (${name})`);
|
// We do not throw here. Instead we log and let the component life. Its not a fatal error if sounds are missing.
|
||||||
|
logger.debug(`Tried to play a sound that wasn't buffered (${name})`);
|
||||||
|
return async () => {};
|
||||||
}
|
}
|
||||||
return playSoundLooping(
|
return playSoundLooping(
|
||||||
audioContext,
|
audioContext,
|
||||||
|
|||||||
Reference in New Issue
Block a user