Skip to content

A self-hosted media server and file management system

fix: thumbnails and posters are not centred on tall screens in theatre mode

aminnausinb8f8de802e94
diff --git a/resources/js/components/video/PlayerBackdrop.vue b/resources/js/components/video/PlayerBackdrop.vue
index 9a3994d0..62d7a0cb 100644
--- a/resources/js/components/video/PlayerBackdrop.vue
+++ b/resources/js/components/video/PlayerBackdrop.vue
@@ -8,6 +8,7 @@ import LazyImage from '@/components/lazy/LazyImage.vue';
const props = defineProps<{
isNormalView: boolean;
+ isTheatreView: boolean;
isVisible?: boolean;
aspectRatio: {
isPortrait: boolean;
@@ -40,24 +41,25 @@ const videoPosterStyle = computed<HTMLAttributes['style']>(() => {
<template>
<Transition leave-from-class="opacity-100" leave-to-class="opacity-0" leave-active-class="absolute! inset-0 duration-700 transition-opacity ease-in-out">
- <div v-if="isVisible" :class="['pointer-events-none z-3', { 'aspect-video': aspectRatio.isAspectVideo }, { relative: isVisible }]">
+ <div v-if="isVisible" :class="['pointer-events-none z-3 size-full', { 'aspect-video': aspectRatio.isAspectVideo }, { relative: isVisible }]">
<template v-if="isAudio">
- <div id="audio-poster" class="absolute inset-0 -z-10 scale-105 blur-sm dark:scale-100" :style="audioPosterStyle"></div>
+ <div id="audio-poster" :class="['absolute inset-0 scale-105 blur-sm', { 'dark:scale-100': isNormalView }]" :style="audioPosterStyle"></div>
<LazyImage
:src="audioPosterUrl"
alt="Album Art"
- :class="['mx-auto object-contain select-none md:h-screen', { 'max-h-[71vh]': isNormalView }]"
+ wrapper-class="flex items-center justify-center"
+ :class="['mx-auto object-contain select-none md:h-screen', { 'max-h-[71vh]': isNormalView }, { 'max-h-screen': isTheatreView }]"
loading="eager"
fetchpriority="high"
/>
</template>
<div v-else class="contents">
- <div id="thumbnail-blocker" class="absolute inset-0 -z-10 scale-105 blur-sm" :style="videoPosterStyle"></div>
+ <div id="thumbnail-blocker" class="absolute inset-0 scale-105 blur-sm" :style="videoPosterStyle"></div>
<LazyImage
:src="handleStorageURL(posterUrl) ?? ''"
alt="Thumbnail"
:wrapper-class="[{ 'max-h-[71vh]': !aspectRatio.isAspectVideo && isNormalView }]"
- :class="['z-3 mx-auto h-full object-cover']"
+ :class="['mx-auto h-full object-contain']"
loading="eager"
fetchpriority="high"
/>
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index 74257507..f9e8452c 100755
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -1211,7 +1211,7 @@ defineExpose({
}
"
>
- <div :class="['z-3 h-full', { 'max-h-[71vh]': isNormalView && !aspectRatio.isAspectVideo }, { 'bg-black/10': isLoading }]">
+ <div :class="['z-3 flex h-full items-center justify-center', { 'max-h-[71vh]': isNormalView && !aspectRatio.isAspectVideo }, { 'bg-black/10': isLoading }]">
<video
id="video-source"
type="video/mp4"
@@ -1264,6 +1264,7 @@ defineExpose({
:poster-url="stateVideo.metadata?.poster_url"
:is-visible="isAudio || isThumbnailVisible"
:is-normal-view="isNormalView"
+ :is-theatre-view="isTheatreView"
/>
</div>