Add audios to DOM to avoid some playback errors

This commit is contained in:
Nils Maier 2019-09-21 09:41:40 +02:00
parent b68245f4f0
commit 5f5deb09f3

View File

@ -221,6 +221,9 @@ export class Manager extends EventEmitter {
if (SOUNDS.value) {
const audio = new Audio(runtime.getURL("/style/done.opus"));
audio.addEventListener("canplaythrough", () => audio.play());
audio.addEventListener("ended", () => document.body.removeChild(audio));
audio.addEventListener("error", () => document.body.removeChild(audio));
document.body.appendChild(audio);
}
if (FINISH_NOTIFICATION.value) {
new Notification(null, _("queue-finished"));