diff --git a/app/static/js/film.js b/app/static/js/film.js index 9810714..6d2a206 100644 --- a/app/static/js/film.js +++ b/app/static/js/film.js @@ -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() })