From f403f492d69c1ea93d5fe16c32a2ac69e4705eb3 Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Thu, 14 Dec 2023 12:25:34 +0100 Subject: [PATCH] New: Set image sizes for preview --- Resources/Private/Fusion/Content.Video.fusion | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Resources/Private/Fusion/Content.Video.fusion b/Resources/Private/Fusion/Content.Video.fusion index 560611d..7caea05 100644 --- a/Resources/Private/Fusion/Content.Video.fusion +++ b/Resources/Private/Fusion/Content.Video.fusion @@ -84,6 +84,8 @@ prototype(Jonnitto.PrettyEmbedVideoPlatforms:Content.Video) < prototype(Jonnitto // Internal videoID.@process.getIDFromUrl = ${this.metadata.videoID ? this.metadata.videoID : (value && this.platform ? Jonnitto.PrettyEmbedHelper.platformID(value, this.platform) : value)} + _posterThumbnail = ${Jonnitto.PrettyEmbedHelper.createThumbnail(this.image || this.metadata.thumbnail, this.maximumWidth)} + _posterThumbnail.@if.noCustomPreview = ${!this.content && (this.image || this.metadata.thumbnail)} renderer = Neos.Fusion:Component { @apply.props = ${props} @@ -104,8 +106,17 @@ prototype(Jonnitto.PrettyEmbedVideoPlatforms:Content.Video) < prototype(Jonnitto aspectRatio = ${props.aspectRatio} preview = ${props.content || null} posterSrcset = ${props.posterSrcset} + + posterWidth = ${props._posterThumbnail ? props._posterThumbnail.width : null} + posterHeight = ${props._posterThumbnail ? props._posterThumbnail.height : null} poster = Neos.Fusion:Case { @if.noCustomPreview = ${!props.content} + hasThumbnail { + condition = ${props._posterThumbnail} + renderer = Neos.Fusion:ResourceUri { + resource = ${props._posterThumbnail.resource} + } + } hasPersistentResource { condition = ${props.image || props.metadata.thumbnail} renderer = Neos.Neos:ImageUri {