Skip to content

Commit f403f49

Browse files
committed
New: Set image sizes for preview
1 parent c68be52 commit f403f49

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Resources/Private/Fusion/Content.Video.fusion

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ prototype(Jonnitto.PrettyEmbedVideoPlatforms:Content.Video) < prototype(Jonnitto
8484

8585
// Internal
8686
[email protected] = ${this.metadata.videoID ? this.metadata.videoID : (value && this.platform ? Jonnitto.PrettyEmbedHelper.platformID(value, this.platform) : value)}
87+
_posterThumbnail = ${Jonnitto.PrettyEmbedHelper.createThumbnail(this.image || this.metadata.thumbnail, this.maximumWidth)}
88+
[email protected] = ${!this.content && (this.image || this.metadata.thumbnail)}
8789

8890
renderer = Neos.Fusion:Component {
8991
@apply.props = ${props}
@@ -104,8 +106,17 @@ prototype(Jonnitto.PrettyEmbedVideoPlatforms:Content.Video) < prototype(Jonnitto
104106
aspectRatio = ${props.aspectRatio}
105107
preview = ${props.content || null}
106108
posterSrcset = ${props.posterSrcset}
109+
110+
posterWidth = ${props._posterThumbnail ? props._posterThumbnail.width : null}
111+
posterHeight = ${props._posterThumbnail ? props._posterThumbnail.height : null}
107112
poster = Neos.Fusion:Case {
108113
@if.noCustomPreview = ${!props.content}
114+
hasThumbnail {
115+
condition = ${props._posterThumbnail}
116+
renderer = Neos.Fusion:ResourceUri {
117+
resource = ${props._posterThumbnail.resource}
118+
}
119+
}
109120
hasPersistentResource {
110121
condition = ${props.image || props.metadata.thumbnail}
111122
renderer = Neos.Neos:ImageUri {

0 commit comments

Comments
 (0)