Browse Source

Spacebar pauses

tags/v0.1.0
Gerben 5 years ago
parent
commit
2a129ae44a
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      app/audio-player/contentscript.js

+ 7
- 0
app/audio-player/contentscript.js View File

@@ -39,6 +39,13 @@ async function init() {
eventEmitter.emit('mastervolumechange', event.target.value); eventEmitter.emit('mastervolumechange', event.target.value);
} }


document.body.addEventListener('keydown', event => {
if (event.target !== document.body) return;
if (event.code === 'Space') {
playpause();
}
});

// Load the file // Load the file
await playlist.load([{ await playlist.load([{
src: document.URL, src: document.URL,


Loading…
Cancel
Save