sylvainjule / kirby-embed

Embed field for Kirby 3 and 4.
74 stars 3 forks source link

Feature idea: option for a bigger preview #8

Closed malvese closed 2 years ago

malvese commented 2 years ago

Issue: Video previews are quite small, at least for Youtube, because they use the iframe in 'code' which is only 200 pixels wide. Sometimes a bigger preview is more practical to check easily if the correct video is added.

Suggestion: A "cover" option could force a bigger preview size, while keeping the correct aspect ratio for any video.

My workaround: For my needs I was able to achieve this in panel.css, as I only needed a single aspect-ratio:

.k-field-name-video_presentation .preview-content {
  padding: 0;
}
.k-field-name-video_presentation .preview-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

Result with my panel.css:

image

tristantbg commented 2 years ago

Good idea. I have made the changes so it can have a better display for Vimeo and Youtube. https://github.com/sylvainjule/kirby-embed/commit/29b00faef123a97bb0fd2f0a20b0cd0e125913e2

@sylvainjule can you create a new tag release when you have some time ?