Open sirreal opened 3 days ago
Hey @sirreal,
I was able to reproduce the same issue and can confirm that the issue was resolved when I applied the patch provided -
@supports (position: sticky) {
[poster] {
object-fit: contain;
}
}
https://github.com/user-attachments/assets/93e2a4a2-c7c0-4e48-8081-d3611c18c5dd
https://github.com/user-attachments/assets/15e83b02-9f0b-4c83-8783-ce70cedbee8f
Description
When expanded to fullscreen, video blocks with poster images expand to
cover
. This overrides the default sizing ofcontain
.This is caused by these lines:
https://github.com/WordPress/gutenberg/blob/a750125b0210b9d906efcec2d807477590e4412f/packages/block-library/src/video/style.scss#L9-L13
Unfortunately, this targets the
video
element itself, regardless of whether the poster is shown. I noticed problems in fullscreen, but there may be other issues.I'll share a possible fix for fullscreen videos at least:
Step-by-step reproduction instructions
I noticed this on the WordPress 6.7 release page.
Depending on screen dimensions, the video may be cropped.
Screenshots, screen recording, code snippet
Environment info
WordPress 6.7 Chrome 131
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.