From 209c3dc2fd41b4907b76be9ce1af3a68084522c4 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Sun, 24 Oct 2021 14:31:55 +0530 Subject: [PATCH 1/3] remember video last time-code and set to that when user clicks play again on film page --- app/static/js/film.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/static/js/film.js b/app/static/js/film.js index 2bb69e7..ed49e7d 100644 --- a/app/static/js/film.js +++ b/app/static/js/film.js @@ -1,4 +1,5 @@ var videoExtension +var continueTimecode function setVideoSrc(video, src) { var ext @@ -25,6 +26,9 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => { video.controls = true document.querySelector('main').appendChild(video) video.style.display = 'none' + if (continueTimecode) { + video.currentTime = continueTimecode + } function enterFullscreen(event) { video.requestFullscreen().catch(err => { console.log(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`); @@ -38,6 +42,7 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => { video.addEventListener('play', enterFullscreen); video.addEventListener('fullscreenchange', event => { if (!document.fullscreen) { + continueTimecode = video.currentTime video.remove() if (document.fullscreenElement) { document.exitFullscreen(); @@ -47,6 +52,7 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => { video.addEventListener('pause', event => { }) video.addEventListener('ended', event => { + continueTimecode = 0 video.remove() if (document.fullscreenElement) { document.exitFullscreen(); From 34c1a993f262f735a89e1856785b88c7858f5a10 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Sun, 24 Oct 2021 17:50:17 +0530 Subject: [PATCH 2/3] dont use document.fullscreen, fixes #18 --- app/static/js/film.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/film.js b/app/static/js/film.js index ed49e7d..570caff 100644 --- a/app/static/js/film.js +++ b/app/static/js/film.js @@ -41,7 +41,7 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => { } video.addEventListener('play', enterFullscreen); video.addEventListener('fullscreenchange', event => { - if (!document.fullscreen) { + if (document.fullscreenElement === null) { continueTimecode = video.currentTime video.remove() if (document.fullscreenElement) { From 3bbff48b49224b78c470444131fe6249809b617f Mon Sep 17 00:00:00 2001 From: j Date: Sun, 24 Oct 2021 14:00:35 +0100 Subject: [PATCH 3/3] load poster frame, #19 --- app/templates/film.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/film.html b/app/templates/film.html index 8f88ad2..afe0af0 100755 --- a/app/templates/film.html +++ b/app/templates/film.html @@ -33,7 +33,7 @@ body {
- +

{{ film.data.summary|safe }}