I want media query support in video
source
elements
#182
aarongustafson
started this conversation in
Wants
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
picture
element lets you provide different images to the user based on a media query attached to asource
element. It's a great way to save user bandwidth when your image differs at different viewports (for example, serving a wide image on desktop and a square one on mobile). However, attaching a media query to avideo
source
does not do the same thing, it just plays whicheversource
is specified first. We are using muted, autoplay videos more and more and right now we have to render an emptydiv
tag then fill with avideo
via JavaScript after page load.Here’s an example published from the <cite>New York Times</cite> and another on Glitch.
It would be amazing to not have to script this at all and just let the
video
element work it out for us.https://webwewant.fyi/wants/8/
Beta Was this translation helpful? Give feedback.
All reactions