fix play button

This commit is contained in:
j 2021-10-22 10:56:05 +01:00
parent 6ed4aa02d8
commit 5bad648fe0

View file

@ -1,3 +1,5 @@
var videoExtension
function setVideoSrc(video, src) {
var ext
if (!videoExtension) {
@ -15,9 +17,12 @@ function setVideoSrc(video, src) {
}
document.querySelector('a#play-fullscreen').addEventListener('click', event => {
event.preventDefault()
event.stopPropagation()
var video = document.createElement('video')
video.classList.add('player')
setVideoSrc(video, 'https://pad.ma/' + film.id + '/480p.webm')
console.log(video.src)
video.controls = true
document.querySelector('main').appendChild(video)
video.style.display = 'none'
@ -48,7 +53,4 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => {
}
});
video.play()
event.preventDefault()
event.stopPropagation()
})