pause only overlay
This commit is contained in:
parent
ca28dd6956
commit
c851bdca4d
1 changed files with 9 additions and 6 deletions
|
@ -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(() => {
|
||||||
|
|
Loadingβ¦
Reference in a new issue