Skip to content

Commit

Permalink
New: Set image sizes for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Dec 14, 2023
1 parent c68be52 commit f403f49
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Resources/Private/Fusion/Content.Video.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 {
Expand Down

0 comments on commit f403f49

Please sign in to comment.