ReferenceDisplay
Poster
Poster image component that displays a thumbnail until video playback starts
Import
Anatomy
Behavior
The poster shows before playback starts. Once the user plays or seeks, it hides; pausing does not bring it back. Loading a new source shows it again.
You can set the poster URL on the player. This is useful when you want to change the poster from inside a skin, or keep all your media metadata in one place:
Supply your own image
The component fills in a source only when you leave one out. srcset, sizes, loading, <picture>, and framework image components all stay available.
Poster.Root owns visibility and loading state. Image attributes go on Poster.Image:
To render a different image component, use render on Poster.Image. It receives the poster URL as src, undefined until one resolves:
Inside a skin, pass the same function as renderPoster. The skin draws your image in place of its own:
A skin styles the <img> it draws directly. Render something that is not an <img> and its sizing is yours.
Styling
The three load attributes track the image on screen, including one you supplied yourself.
React renders a root <div> around the <img>. The state attributes are on Poster.Root, so other presentation layers can use the same lifecycle:
Accessibility
Unlike the native <video poster> attribute, this component lets you describe the poster for screen readers.
The image is decorative by default (alt=""), since a URL says nothing about what the image shows. When the poster carries meaning, say so:
Whether a poster is informative or decorative is your judgment, per the WAI guidelines.
Examples
Basic Usage
API Reference
Root
Manages poster visibility and image loading state.
Renders a div and exposes data-visible, data-loading, data-loaded, and data-error for styling every layer
in the poster presentation. Render Poster.Image inside it for the image that supplies the loading lifecycle.
State
render, className, and style props.