more debug

This commit is contained in:
2024-01-05 02:39:58 +01:00
parent f3eaecfc5a
commit 2869de4861

View File

@@ -77,6 +77,9 @@
} else { } else {
audio.volume = volume; audio.volume = volume;
} }
console.log(volume);
console.log(audio.volume);
} }
// workaround for bug https://github.com/sveltejs/svelte/issues/5347 // workaround for bug https://github.com/sveltejs/svelte/issues/5347
@@ -89,8 +92,6 @@
// workaround for bug https://github.com/sveltejs/svelte/issues/5914 // workaround for bug https://github.com/sveltejs/svelte/issues/5914
audio.addEventListener('loadedmetadata', (event) => { audio.addEventListener('loadedmetadata', (event) => {
paused = audio.paused; paused = audio.paused;
console.log(volume);
console.log(audio.volume);
}); });
} }
} }
@@ -153,7 +154,14 @@
<button <button
class="material-icons" class="material-icons"
style="--icon-color:{iconColor}" style="--icon-color:{iconColor}"
on:click={() => (audio.paused ? audio.play() : audio.pause())} on:click={() => {
if (audio.paused) {
console.log(audio.volume);
audio.play();
} else {
audio.pause();
}
}}
> >
{#if paused} {#if paused}
play_arrow play_arrow