Merge pull request #90 from an-lee/main

Fix space to play or pause
This commit is contained in:
an-lee
2024-01-11 08:21:01 +08:00
committed by GitHub

View File

@@ -501,9 +501,11 @@ export const MediaPlayer = (props: {
};
useHotkeys(
" ",
() => {
"Space",
(keyboardEvent, _hotkeyEvent) => {
if (!wavesurfer) return;
keyboardEvent.preventDefault();
onPlayClick();
},
[wavesurfer]