Toggle audio/video playback with spacebar

This commit is contained in:
2024-04-11 20:32:55 +02:00
parent 5f6cc3f90f
commit a0ccbb55be
13 changed files with 67 additions and 28 deletions

View File

@@ -48,7 +48,9 @@ export const set_file = async f => {
}
}
const toggle_play = () => playing ? player.pause() : player.play()
export const toggle_playback = () => {
playing ? player.pause() : player.play()
}
</script>
@@ -63,7 +65,7 @@ const toggle_play = () => playing ? player.pause() : player.play()
<button on:click={() => player.currentTime -= 10 }>
<i class="icon">replay_10</i>
</button>
<button on:click={toggle_play}>
<button on:click={toggle_playback}>
{#if playing}
<i class="icon">pause</i>
{:else}