Merge branch 'main' of git.0x2620.org:0x2620/aab21 into main

This commit is contained in:
imohkay 2021-10-24 19:13:09 +05:30
commit e318c1d42b
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,5 @@
var videoExtension var videoExtension
var continueTimecode
function setVideoSrc(video, src) { function setVideoSrc(video, src) {
var ext var ext
@ -25,6 +26,9 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => {
video.controls = true video.controls = true
document.querySelector('main').appendChild(video) document.querySelector('main').appendChild(video)
video.style.display = 'none' video.style.display = 'none'
if (continueTimecode) {
video.currentTime = continueTimecode
}
function enterFullscreen(event) { function enterFullscreen(event) {
video.requestFullscreen().catch(err => { video.requestFullscreen().catch(err => {
console.log(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`); console.log(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
@ -37,7 +41,8 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => {
} }
video.addEventListener('play', enterFullscreen); video.addEventListener('play', enterFullscreen);
video.addEventListener('fullscreenchange', event => { video.addEventListener('fullscreenchange', event => {
if (!document.fullscreen) { if (document.fullscreenElement === null) {
continueTimecode = video.currentTime
video.remove() video.remove()
if (document.fullscreenElement) { if (document.fullscreenElement) {
document.exitFullscreen(); document.exitFullscreen();
@ -47,6 +52,7 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => {
video.addEventListener('pause', event => { video.addEventListener('pause', event => {
}) })
video.addEventListener('ended', event => { video.addEventListener('ended', event => {
continueTimecode = 0
video.remove() video.remove()
if (document.fullscreenElement) { if (document.fullscreenElement) {
document.exitFullscreen(); document.exitFullscreen();

View file

@ -33,7 +33,7 @@ body {
</div> </div>
<div class="video-block"> <div class="video-block">
<video src="{{ settings.TIMELINE_PREFIX }}{{ film.padma_id }}/loop.mp4" autoplay loop muted playsinline></video> <video src="{{ settings.TIMELINE_PREFIX }}{{ film.padma_id }}/loop.mp4" poster="{{ settings.TIMELINE_PREFIX }}{{ film.padma_id }}/loop.jpg" autoplay loop muted playsinline></video>
</div> </div>
<div class="summary-block"> <div class="summary-block">
<p>{{ film.data.summary|safe }}</p> <p>{{ film.data.summary|safe }}</p>