maybe a good fix this time...
This commit is contained in:
@@ -59,6 +59,7 @@
|
|||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const volumeData = localStorage.getItem('volume');
|
const volumeData = localStorage.getItem('volume');
|
||||||
volume = volumeData ? parseFloat(volumeData) : 0.67;
|
volume = volumeData ? parseFloat(volumeData) : 0.67;
|
||||||
|
setVolume(volume);
|
||||||
});
|
});
|
||||||
|
|
||||||
$: updateCurrentSong(currentTime, $currentSongIndex);
|
$: updateCurrentSong(currentTime, $currentSongIndex);
|
||||||
@@ -77,9 +78,6 @@
|
|||||||
} 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
|
||||||
@@ -154,14 +152,7 @@
|
|||||||
<button
|
<button
|
||||||
class="material-icons"
|
class="material-icons"
|
||||||
style="--icon-color:{iconColor}"
|
style="--icon-color:{iconColor}"
|
||||||
on:click={() => {
|
on:click={() => (audio.paused ? audio.play() : audio.pause())}
|
||||||
if (audio.paused) {
|
|
||||||
console.log(audio.volume);
|
|
||||||
audio.play();
|
|
||||||
} else {
|
|
||||||
audio.pause();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{#if paused}
|
{#if paused}
|
||||||
play_arrow
|
play_arrow
|
||||||
|
|||||||
Reference in New Issue
Block a user