Media and JSON export
Provide native media controls, recoverable alternatives and a small explicit export boundary.
Play the captioned example
Visual transcript
A blue circle moves from the left to the centre, then to the right. The silent clip lasts three seconds.
View markup
<div class="spec-stack"><video class="spec-video" controls playsinline preload="none"
width="320" height="180" aria-label="Three positions of a blue circle">
<source src="/design-system/playground/assets/three-positions-vjIMMyQT.mp4" type="video/mp4">
<track src="/design-system/playground/assets/three-positions.en-o7RBRvmy.vtt" kind="captions" srclang="en" label="English" default></video>
<details class="spec-transcript"><summary>Visual transcript</summary><p>A blue circle moves from the left to the centre, then to the right. The silent clip lasts three seconds.</p></details>
<div class="spec-actions"><button type="button" class="ex-button ex-button--secondary" data-export>Download clip details</button></div>
<p class="spec-status" role="status" data-status></p></div>Usage and implementation
Full example
Use and alternatives
Use images when they support the task, a viewer when enlargement helps, and native video controls before building a player. Export only data the user needs and is entitled to receive. A readable table or transcript remains useful when media cannot load.
Anatomy
Images declare intrinsic width and height, useful alternative text and a caption where appropriate. The native-dialog viewer has a title and close/retry controls. The silent three-second example video has user controls, authored descriptive captions and a visible transcript; it contains no speech.
States and recovery
Provide loading, loaded, failure and retry for image/viewer, and truthful media failure/retry. A known viewer-image failure persists after close/reopen until a new attempt succeeds. Downloads distinguish requested from confirmed saved; the browser and user control the destination.
Semantics and focus
Core openDialog manages modal containment and return focus. A closed viewer must not lose its recovery state. Native video owns playback/caption controls and does not autoplay. A download is a named button; generating a Blob does not prove the user saved the file.
Responsive and preferences
Reserve aspect ratio without fixed text heights. Keep a 16px minimum dialog edge and reduce inner gutters at narrow enlarged sizes; action words must remain readable with unchanged text and targets. Keep a transcript reachable without playback. Honor reduced motion and user playback choice.
API and ownership
createCollectionExport and serializeCollectionExport produce format evolutive-x.collection, schema 1.0, with only id/title/type/updated fields. createJsonDownloader owns a temporary object URL and anchor cleanup; dispose releases pending URLs. EXPORT_FIELDS/EXPORT_FILENAME are explicit. The example does not promise CSV formula escaping or an import/migration engine.
Security and data
The illustration and silent video are authored local samples, separate from the reserved Evolutive X identity. Real exports need permission checks and deliberate fields; never serialize a whole server object by convenience. Treat imported files as untrusted. Revoke Blob URLs after the download handoff and on disposal.
Acceptance
Trigger a real image failure, close/reopen and retry successfully; check focus return. Play/pause/replay native video, inspect captions and transcript, and recover from unavailable media. Download and parse the JSON, checking schema, exact fields and exclusions. Device codec, AT and constrained-network acceptance remain separate.
