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