Skip to content

Commit d68d5bb

Browse files
committed
feat: enable keyboard shortcuts to toggle video play/pause
1 parent 33f0a50 commit d68d5bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ window.addEventListener('load', function() {
1717
}
1818
stickyNavbarElement.classList.remove('visible');
1919
}
20-
var player = new Plyr('#player');
20+
var player = new Plyr('#player', {
21+
keyboard: {
22+
global: true,
23+
},
24+
});
2125
player.once('play', function() {
2226
var videoWrapper = document.querySelector('.plyr__video-wrapper');
2327
videoWrapper.classList.add('hidden-poster');

0 commit comments

Comments
 (0)