Media Optimization for the Web
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. See the section bibliography for the reference material consulted while preparing these pages. |
The backend produces optimized variants, see Media Optimization for the backend. This sub-section is the other half: how a web page asks for the right variant, shows something useful while it loads, and plays video that adapts to the connection. It is current as of 2026-10-07, and each page names the versions it was checked against.
Pages
| Page | What it covers |
|---|---|
img with srcset, sizes, width and height, decoding, picture with AVIF and WebP, loading lazy, fetchpriority, and the video element. |
|
Decoding into a canvas or data URL, react-blurhash, unlazy, punch, ThumbHash and server-side placeholders. |
|
sizes and fill, placeholder blur with a BlurHash, custom loaders for image CDNs, formats and remotePatterns, and preload replacing priority. |
|
react-lazyload, react-image, react-lazy-load-image-component, an IntersectionObserver hook, and a recommendation table with status. |
|
ngSrc, priority, placeholder, built-in loaders, a custom loader and BlurHash with the blurhash package. |
|
The video element, native HLS, hls.js, dash.js, Shaka Player, Video.js, Media Source Extensions and ManagedMediaSource. |
|
A one-page summary of attributes, loaders, placeholder code and players. |
Related pages
-
HTML and CSS: Performance and Loading and Next.js: Images, Fonts and Scripts are the general references.
-
BlurHash: The Algorithm explains what the placeholder string contains.
-
Media Optimization in apps is the native and cross-platform counterpart.
-
Managed image and video services: AWS, Google Cloud and Azure.
Bibliography
Every source below is the official site, repository or documentation page of the library, service or standard it supports. Links were checked from an authoring environment with restricted outbound access. Entries marked (unverified) could not be opened from there (the site refused or blocked the request), so open them and confirm the content, version and status before you rely on them. Entries without the mark were opened successfully, or, for package pages, confirmed through the package registry.
Native HTML, formats and performance
-
MDN ManagedMediaSource (unverified)
-
MDN putImageData (unverified)
-
MDN, fetchpriority attribute (unverified)
-
MDN, HTMLImageElement loading (unverified)
-
MDN, image file type and format guide (unverified)
-
MDN, Intersection Observer API (unverified)
-
MDN, responsive images (unverified)
-
Media Source Extensions (unverified)
-
web.dev, optimize Largest Contentful Paint (unverified)
BlurHash and placeholders
-
react-blurhash (unverified)
-
ThumbHash (unverified)
-
unlazy (unverified)
-
unlazy, placeholders guide (unverified)
Next.js and image CDNs
-
Cloudinary (unverified)
-
Image component reference (unverified)
-
imgix (unverified)
React
-
react-image (unverified)
-
react-lazy-load-image-component (unverified)
-
react-lazyload (unverified)
Angular
-
Angular image optimization guide (unverified)
-
NgOptimizedImage API reference (unverified)
Video players and streaming
-
dash.js (unverified)
-
dash.js, documentation (unverified)
-
hls.js (unverified)
-
hls.js, API documentation (unverified)
-
Shaka Player (unverified)
-
Shaka Player, basic usage tutorial (unverified)
-
Video.js (unverified)