this post was submitted on 01 Jan 2026
61 points (98.4% liked)

Programming

24153 readers
354 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Glitchvid@lemmy.world 1 points 9 hours ago* (last edited 9 hours ago)

I typically just specify the height of the video and let the browser figure out the width and aspect ratio. The most annoying layout shift is the vertical kind anyway, so that solves it to my satisfaction.

That said, I also use the poster feature of the video tag and set preload to none, this produces vastly faster page loading, as images are a fast-path compared to browsers loading a video chunk and then decoding it just to display a cover image. I have a set of scripts that generate the poster images for me, I just specify the frame number I want to use in the video and ffmpeg produces an avif.