- added framework for playing uploaded music files. need to permanently store and retreive files

This commit is contained in:
2025-10-21 12:52:14 +01:00
parent 1ffad51503
commit 78905b09e0
7 changed files with 52 additions and 12 deletions

View File

@@ -43,9 +43,9 @@ export function useSightingFeed(url: string | undefined) {
}, [audioArmed, latestRef]);
const soundSrc = useMemo(() => {
if (state?.sightingSound?.includes(".mp3")) {
if (state?.sightingSound?.includes(".mp3") || state.sightingSound?.includes(".wav")) {
const file = state.soundOptions?.find((item) => item.name === state.sightingSound);
return file?.soundUrl;
return file?.soundUrl ?? switchSound;
}
return getSoundFileURL(state?.sightingSound) ?? switchSound;
}, [state.sightingSound, state.soundOptions]);