HTML Video Sources Should Be Responsive

Scott Jehl doesn’t mince words here:

Removing media support from HTML video was a mistake. It means that for every video we embed in HTML, we’re stuck with the choice of serving source files that are potentially too large or


The post HTML Video Sources Should Be Responsive appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

Scott Jehl doesn’t mince words here:

Removing media support from HTML video was a mistake. It means that for every video we embed in HTML, we’re stuck with the choice of serving source files that are potentially too large or small for many users’ devices (resulting in poor performance, wasteful data consumption, and even sub-optimal quality on larger screens), or resorting to more complicated server-side or scripted or third-party solutions to deliver a correct size.

I remember when responsive images were just starting to come out. One way to explain it was to say it’s like <video> in that you can have multiple <source> elements inside which (in supporting browsers) allowed you to specify attributes like type (e.g. video format) and media (e.g. screen size). But then

Despite being implemented in multiple browsers, the feature was removed from browsers and the HTML specification, without any proposed replacement for the functionality it once provided. One exception is the feature was never removed from Webkit, so it still works in Safari browsers, which is great.

I don’t remember that. That feels like a big WTF moment (some background). I think of the web as being tremendous at backwards compatibility. It’s a rare day when we just yank stuff, and even more rare is a yanking with no alternative whatsoever.

So now with responsive images being a success (it’s a success, right? I can’t imagine how incredibly much bandwidth it has saved the world)… can’t we… put it back?

When I have an immediate need for this, I always think of Cloudinary, because I can alter the size and format of video by changing the URL. Like here’s a video URL where the video codec is automatically determined and the size is forced down to 400px:

https://res.cloudinary.com/css-tricks/video/upload/c_scale,q_auto,vc_auto,w_400/v1612795501/intro-patreon_jpd8er.mp4

It’s nice to have tools like this, but that doesn’t mean the platform shouldn’t be helping.

Direct Link to ArticlePermalink


The post HTML Video Sources Should Be Responsive appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.


Print Share Comment Cite Upload Translate
APA
Chris Coyier | Sciencx (2024-03-28T10:38:14+00:00) » HTML Video Sources Should Be Responsive. Retrieved from https://www.scien.cx/2021/02/10/html-video-sources-should-be-responsive-2/.
MLA
" » HTML Video Sources Should Be Responsive." Chris Coyier | Sciencx - Wednesday February 10, 2021, https://www.scien.cx/2021/02/10/html-video-sources-should-be-responsive-2/
HARVARD
Chris Coyier | Sciencx Wednesday February 10, 2021 » HTML Video Sources Should Be Responsive., viewed 2024-03-28T10:38:14+00:00,<https://www.scien.cx/2021/02/10/html-video-sources-should-be-responsive-2/>
VANCOUVER
Chris Coyier | Sciencx - » HTML Video Sources Should Be Responsive. [Internet]. [Accessed 2024-03-28T10:38:14+00:00]. Available from: https://www.scien.cx/2021/02/10/html-video-sources-should-be-responsive-2/
CHICAGO
" » HTML Video Sources Should Be Responsive." Chris Coyier | Sciencx - Accessed 2024-03-28T10:38:14+00:00. https://www.scien.cx/2021/02/10/html-video-sources-should-be-responsive-2/
IEEE
" » HTML Video Sources Should Be Responsive." Chris Coyier | Sciencx [Online]. Available: https://www.scien.cx/2021/02/10/html-video-sources-should-be-responsive-2/. [Accessed: 2024-03-28T10:38:14+00:00]
rf:citation
» HTML Video Sources Should Be Responsive | Chris Coyier | Sciencx | https://www.scien.cx/2021/02/10/html-video-sources-should-be-responsive-2/ | 2024-03-28T10:38:14+00:00
https://github.com/addpipe/simple-recorderjs-demo