-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add height:auto
to video
in Video block
#37052
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +21 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
Perhaps we could do something similar to what we did in the twentytwentyone theme? |
But relying on a script to obtain the width/height on the frontend is not optimal for performance, right? That will result in layout shift when the script runs. I thought the point of browsers implementing a default The AMP plugin is obtaining the In any case, I'm seeing some strange browser behavior for |
I think we could combine the 2... A PHP implementation makes more sense than a JS one as it will be more performant and will avoid layout shifts like you said. |
My understanding is that only setting the |
The reason I'm a bit hesitant with using |
This amends #30092 which added
height:auto
to somevideo
elements but didn't include the video in the Video block.Description
In the AMP plugin we add
width
andheight
attributes to videos in order to prevent layout shifts, which are currently a reality with videos in the Video block since no dimensions are provided as they are forimg
elements:video-layout-shift.mov
However, at the moment adding the
width
andheight
is currently causing the video to be stretched. By addingheight:auto
, the stretching is eliminated.height:auto
height:auto
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).