Фикс звуков из ресурсов
This commit is contained in:
@@ -14,7 +14,7 @@ export function useSound() {
|
||||
audioRef.current.load();
|
||||
};
|
||||
|
||||
const playSound = (sound : string, loop: boolean = false) => {
|
||||
const playSound = async (sound : string, loop: boolean = false) => {
|
||||
try {
|
||||
if(loop){
|
||||
if (!loopingAudioRef.current) {
|
||||
@@ -24,7 +24,7 @@ export function useSound() {
|
||||
loopingAudioRef.current.loop = true;
|
||||
}
|
||||
|
||||
const url = window.mediaApi.getSoundUrl(sound);
|
||||
const url = await window.mediaApi.getSoundUrl(sound);
|
||||
const player = loopingAudioRef.current;
|
||||
|
||||
player.src = url;
|
||||
@@ -43,7 +43,7 @@ export function useSound() {
|
||||
audioRef.current.loop = loop;
|
||||
}
|
||||
|
||||
const url = window.mediaApi.getSoundUrl(sound);
|
||||
const url = await window.mediaApi.getSoundUrl(sound);
|
||||
const player = audioRef.current;
|
||||
|
||||
stopSound();
|
||||
|
||||
Reference in New Issue
Block a user