Files
Julian Lechner f5d8f6f11b
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
feat(skills): reworked skills and rules
2026-11-18 14:17:49 +01:00

37 lines
2.6 KiB
Markdown

# 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.
```html
<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 `playsinline` for inline autoplay on iOS Safari. Never autoplay audio.
- Keep `controls` unless the design provides its own accessible controls, and give users a way to pause any moving content.
- Set `preload="none"` or `metadata` for videos the user may not play, and add `loading="lazy"` for offscreen videos where supported.
- Give every video a poster and intrinsic `width` and `height` to 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, use `MediaElement` from `CommunityToolkit.Maui.MediaElement`, initialized with `UseMauiCommunityToolkitMediaElement` (enable the Android foreground service only when background playback or media notifications are required).
References: [MDN video codecs](https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Video_codecs), [MDN autoplay](https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Autoplay), [web.dev lazy-loading video](https://web.dev/articles/lazy-loading-video), [WCAG 2.2](https://www.w3.org/TR/WCAG22/).