CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s
2.6 KiB
2.6 KiB
Video
Formats
- Offer more than one source and let the browser pick: WebM with AV1 video and Opus audio first for the best compression, then MP4 with AVC (H.264) video and AAC audio as the broadly supported fallback. Check licensing for proprietary codecs, and check that the target clients decode AV1 before relying on it alone.
<video controls width="1280" height="720" poster="demo-poster.jpg" preload="metadata">
<source type="video/webm; codecs=av01,opus" src="demo.webm" />
<source type="video/mp4" src="demo.mp4" />
<track kind="captions" src="demo.en.vtt" srclang="en" label="English" default />
</video>
- Replace animated GIFs with a short muted, looping video (
autoplay muted loop playsinline); it is usually far smaller. - For long or large videos, use adaptive streaming (HLS or DASH) through the project's existing player or video service instead of serving one large file.
Playback and loading
- Autoplay only muted video or video without an audio track; browsers block autoplay with sound until the user interacts. Add
playsinlinefor inline autoplay on iOS Safari. Never autoplay audio. - Keep
controlsunless the design provides its own accessible controls, and give users a way to pause any moving content. - Set
preload="none"ormetadatafor videos the user may not play, and addloading="lazy"for offscreen videos where supported. - Give every video a poster and intrinsic
widthandheightto reserve space. When a video is the largest contentful element, preload its poster with high fetch priority and do not lazy-load it.
Accessibility
- Provide captions (WebVTT
<track kind="captions">) for prerecorded video with speech or meaningful sound (WCAG 1.2.2, level A). - When the picture carries information the audio does not, provide audio description or a full text alternative (WCAG 1.2.3 level A; 1.2.5 level AA requires audio description).
- Live video with audio needs live captions (WCAG 1.2.4, level AA).
- Video-only content needs a text or audio alternative (WCAG 1.2.1, level A).
Desktop and mobile apps
- In WPF, play media with
MediaElement; in .NET MAUI, useMediaElementfromCommunityToolkit.Maui.MediaElement, initialized withUseMauiCommunityToolkitMediaElement(enable the Android foreground service only when background playback or media notifications are required).
References: MDN video codecs, MDN autoplay, web.dev lazy-loading video, WCAG 2.2.