From eb9aed441b0e32ada256baabea906f8bd18a7c4f Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 13 Nov 2022 23:35:01 -0800 Subject: [PATCH] Make video fill up space --- src/components/Viewer.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index 3b268ddb..df06ffd4 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -534,10 +534,21 @@ export default class Viewer extends Mixins(GlobalMixin) { previewUrl = generateUrl(getDownloadLink(photo)); } + // Get height and width + let w = photo.w; + let h = photo.h; + + if (isvideo && w && h) { + // For videos, make sure the screen is filled up, + // by scaling up the video by a maximum of 4x + w *= 4; + h *= 4; + } + return { src: previewUrl, - width: photo.w || undefined, - height: photo.h || undefined, + width: w || undefined, + height: h || undefined, thumbCropped: true, photo: photo, type: isvideo ? "video" : "image",