pause only overlay

This commit is contained in:
j 2021-10-13 16:35:28 +01:00
parent ca28dd6956
commit c851bdca4d

View file

@ -138,25 +138,28 @@ function showOverlay(event) {
overlay.id = 'video-overlay' overlay.id = 'video-overlay'
overlay.style.top = video.style.top overlay.style.top = video.style.top
overlay.style.width = rect.width + 'px' overlay.style.width = rect.width + 'px'
overlay.style.height = (rect.height - 40) + 'px' overlay.style.height = rect.height + 'px'
overlay.style.position = 'absolute' overlay.style.position = 'absolute'
overlay.style.display = 'flex' overlay.style.display = 'flex'
overlay.style.alignItems = 'center' overlay.style.alignItems = 'center'
overlay.style.justifyContent = 'center' overlay.style.justifyContent = 'center'
overlay.style.fontSize = '45px' overlay.style.fontSize = '45px'
video.controls = true video.controls = false
var off = `πŸ”‡`
var on = `πŸ”Š`
if (video.muted) { if (video.muted) {
overlay.innerHTML = `πŸ”‡` overlay.innerHTML = off
} else { } else {
overlay.innerHTML = `πŸ”Š` overlay.innerHTML = on
} }
overlay.addEventListener('click', event=> { overlay.addEventListener('click', event=> {
video.muted = !video.muted video.muted = !video.muted
if (video.muted) { if (video.muted) {
overlay.innerHTML = `πŸ”‡` overlay.innerHTML = off
} else { } else {
overlay.innerHTML = `πŸ”Š` overlay.innerHTML = on
} }
}) })
var timeout = setTimeout(() => { var timeout = setTimeout(() => {