|
@@ -40,11 +40,13 @@ export default async function init() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
document.body.addEventListener('keydown', event => { |
|
|
document.body.addEventListener('keydown', event => { |
|
|
if (event.target !== document.body) return; |
|
|
|
|
|
|
|
|
// Pressing spacebar triggers play/pause. |
|
|
if (event.code === 'Space') { |
|
|
if (event.code === 'Space') { |
|
|
playpause(); |
|
|
playpause(); |
|
|
|
|
|
event.stopPropagation(); |
|
|
|
|
|
event.preventDefault(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
}, { capture: true }); |
|
|
|
|
|
|
|
|
// Load the file |
|
|
// Load the file |
|
|
await playlist.load([{ |
|
|
await playlist.load([{ |
|
|