This commit is contained in:
mm 2024-10-30 16:34:52 +05:00
parent b0a5c378db
commit 830faee3f7

View File

@ -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(); // Вызовите callback после завершения аудио if (callback) callback();
}); }, 7000);
}); });
} }