dev
This commit is contained in:
parent
b0a5c378db
commit
830faee3f7
@ -86,13 +86,12 @@ function playAudio(audioUrl, widgetID, callback) {
|
|||||||
audio.play().catch(error => {
|
audio.play().catch(error => {
|
||||||
console.error('Ошибка при воспроизведении:', error);
|
console.error('Ошибка при воспроизведении:', error);
|
||||||
});
|
});
|
||||||
|
setTimeout(() => {
|
||||||
audio.addEventListener('ended', () => {
|
audio.pause();
|
||||||
audio.pause();
|
audio.remove()
|
||||||
audio.remove();
|
console.log('Воспроизведение остановлено');
|
||||||
console.log('Музыка закончила играть');
|
if (callback) callback();
|
||||||
if (callback) callback(); // Вызовите callback после завершения аудио
|
}, 7000);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user