web.dev icon indicating copy to clipboard operation
web.dev copied to clipboard

Allow custom aspect ratio on <video>

Open jakearchibald opened this issue 1 year ago • 4 comments

This is part of https://github.com/GoogleChrome/webdev-infra/issues/28, to allow custom aspect ratios on video elements and reduce CLS.

jakearchibald avatar Jul 25 '22 08:07 jakearchibald

Deploy Preview for web-dev-staging ready!

Name Link
Latest commit 88d34440b1f6177700e941d03ebba0a4429940b7
Latest deploy log https://app.netlify.com/sites/web-dev-staging/deploys/6305e4327672a00008e96b13
Deploy Preview https://deploy-preview-8399--web-dev-staging.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jul 25 '22 08:07 netlify[bot]

I haven't tested this btw, so it'll need an eyeball to check that it works with existing video content.

jakearchibald avatar Aug 24 '22 08:08 jakearchibald

Thanks for adding this, @jakearchibald! I did run a Percy test for this to see if any existing videos break.

What I did: check out this branch, merge latest changes from main and manually update the web-infra package with the changes from https://github.com/GoogleChrome/webdev-infra/pull/32.

There's only one slight change, with the Mishipay case study (https://web.dev/mishipay/#scanning-products, just above this headline). The second portrait video now renders slightly smaller. Jake, are you fine with me committing to your branch with a potential fix for this?

matthiasrohmer avatar Aug 29 '22 20:08 matthiasrohmer

I did run a Percy test for this to see if any existing videos break.

Nice!

There's only one slight change, with the Mishipay case study (https://web.dev/mishipay/#scanning-products, just above this headline). The second portrait video now renders slightly smaller.

Ohh, good catch! Here's the source for that embed:

{% Video
  src="video/8WbTDNrhLsU0El80frMBGE4eMCD3/NqyMBZGYzGSNqLE7soXR.mp4",
  autoplay=true,
  muted=true,
  playsinline=true,
  loop=true,
  width=1296,
  height=600
%}

Whereas the video resource is 600x1296, so this is author error, although due to the forced 16:9 ratio, it wasn't spotted. Correcting the width & height will fix this.

Jake, are you fine with me committing to your branch with a potential fix for this?

Yep!

jakearchibald avatar Aug 30 '22 10:08 jakearchibald

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To prevent this from happening, leave a comment.

stale[bot] avatar Dec 21 '22 01:12 stale[bot]

Not stale

tunetheweb avatar Dec 21 '22 09:12 tunetheweb

Now really stale.

devnook avatar Oct 11 '23 07:10 devnook