INNER CODE UNIT · JavaScript
setKeyListener
presenta-software/presenta-lib · src/blocks/video/index.js:36
const setKeyListener = e => {
if (e.key === ' ') {
toggleVideo()
e.stopPropagation()
e.preventDefault()
}
if (e.key === 'r') {
if (video) {
video.currentTime = 0
}
}
if (e.key === 'm') {
if (video) {
video.volume = !video.volume ? 1 : 0
}
}
if (e.key === '+') {
if (video) {