InlineVideo

Full-width autoplay video

stable v1.0.0

Preview

Behavior

StateBehavior
In viewportAutoplay, muted, loop, playsinline
Out of viewportPaused (IntersectionObserver, threshold 0.2)
prefers-reduced-motionPaused; shows the poster if there is one
No JSThe native autoplay muted loop attributes still apply

Spacing

spacingResultUse
prose (default)space-2xl above and belowInside prose: matches standalone images
noneNo vertical marginStandalone block; spacing is up to whoever uses it

Constraints

  • Always muted (a precondition for autoplay on mobile).
  • Decorative: no controls, no PiP.
  • Poster with alt="": a visual fallback, not content.
  • No hardcoded colors; radius and spacing by token.

Decisions

DecisionWhy
Spacing as a prop, prose by defaultprose.css doesn't target .inline-video; the margin lives here, but it can be overridden
Pause off-screenAn invisible loop burns battery and main thread for nothing
Respects prefers-reduced-motionMotion is an accessibility matter; the static poster is the honest fallback
Muted, no controls or PiPIt is a moving image, not a player