From 5bad648fe075df36000dee276dbc643ef69ae2b8 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 22 Oct 2021 10:56:05 +0100 Subject: [PATCH] fix play button --- app/static/js/film.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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() })