Skip to main content

Sample contract · AUP cross-device · ARC 2.0.0-beta.28

`media` primitive

Bind image, video, audio, or avatar media as a portable media primitive with a docs-safe live image sample.

media is an AUP cross-device primitive, not a Web Device layout component and not a Web-only widget. It is one of the 18 names in AUP_PRIMITIVES and appears in every target's DeviceCaps.primitives map as native, webview, partial, or unsupported.

Contract

FieldValue
Primitive namemedia
LayerAUP cross-device primitive (AUP_PRIMITIVES)
Public statusreleased
Document capabilitynative
Shared degradation chainNone (document reports native)
Author entryAUP tree · generic Markdown directive ::media{…} · Markdown images (separate img path)
Document renderer / notesrenderer/primitives/media.ts
Showcase evidenceMarkdown image path; Showcase media-heavy pages

When to use

You need a semantic media node with type (image / video / audio / avatar) and optional caption.

When not to use

Do not treat unrestricted third-party embeds as trusted media. Same-site / whitelist rules for frames are separate (embed). Inline Markdown ![alt](src) is a different structure path (image).

Sample contract

FieldValue
PurposeDocument-target media image with caption
BoundariesNo video/audio product promise on this page; trust/whitelist for arbitrary embeds is separate; missing src → placeholder
Author entryGeneric leaf directive ::media{…} (Markdown → AUP type: media)
SurfaceWeb Device document
Public statusreleased
Fallback / failureMissing src → empty placeholder figure; unsupported type falls through to image rendering
VerificationRoutes below · arc --version = 2.0.0-beta.28

Document sample (image)

This sample uses the generic Markdown → AUP path (::media → type: media). The asset is a static documentation image URL used elsewhere on this site. It is not evidence of video, audio, avatar, or unrestricted third-party embedding.

Source:

markdown
::media{id="docs-prim-media-img" type="image" src="https://media.arcblock.io/lib/2f/2f757138def2b3fc.w1600.webp" alt="Illustrative documentation asset" caption="Document-target media illustration"}

Rendered:

Illustrative documentation asset
Document-target media illustration

Failure and limits

SituationExpected result
Missing srcEmpty aup-media placeholder (no broken remote load as the sample contract)
Unknown typeFalls through to image rendering path
Expecting frame / iframe embed APIWrong surface — use ::embed / frame rules
Inline ![alt](src)Separate MD structure path, not this AUP media node sample

Source (missing src — placeholder only):

markdown
::media{id="docs-prim-media-empty" type="image" alt="Missing source becomes a placeholder"}

Rendered:

Minimal AUP JSON shape (interactive / full-web authoring; same renderer keys):

json
{
  "id": "hero-shot",
  "type": "media",
  "props": {
    "type": "image",
    "src": "/assets/example.png",
    "alt": "Example",
    "caption": "Caption"
  }
}

Verification evidence

ItemValue
Baseline2026-08-09 · arc --version → 2.0.0-beta.28
Capability rowdocs/aup/capability-matrix.md (internal, non-routed) · media
Implementationcontent-reader.ts (generic directive → type name); renderer/primitives/media.ts
Public routes/en/docs/aup/primitives/media/ · /zh/docs/aup/primitives/media/
Local runarc service start --blocklet blocklets/arcblock --port 4900 · open routes; confirm figure + caption and empty placeholder
AcceptImage sample shows figure/caption; empty src is placeholder; page does not claim video/audio/frame

Evidence anchors

ItemValue
Registrypackages/aup/src/aup-types.ts · AUP_PRIMITIVES
Document capsproviders/runtime/web-device/src/device-caps.ts · DEVICE_CAPS_DOCUMENT
Degradationpackages/aup/src/degradation.ts · DEGRADATION_CHAINS
Internal matrixdocs/aup/capability-matrix.md (internal, non-routed)
Taxonomy hubPrimitive taxonomy and evidence
Sample contract rulesLive examples: scope and contract

Nearby pages