Skip to content
FrameworkStyle

background-video

Decorative background video element with automatic muting and looping

Decorative background video for a source the browser can play natively. By default it’s muted, looped, and autoplaying — use the opt-out attributes below to change that. It renders a <video> inside a shadow DOM and fills the box you give the component.

An HLS URL only works where the browser has native HLS playback. See Add a background video to choose a cross-browser HLS or Mux path and set up layout, poster, and decorative semantics.

Examples

Basic Usage

<div class="container">
    <background-video
        src="https://stream.mux.com/601n4w1fq88NJiVpzvrQQeQfNnnjjfKMIN7dCGAEarTs/highest.mp4"
    ></background-video>
</div>

API Reference

Attributes

AttributeDescription
srcURL of a video the browser can play directly, such as an MP4 or WebM file.
nomutedOpt out of muted playback. By default the video is muted.
noloopOpt out of looped playback. By default the video loops.
noautoplayOpt out of autoplay. By default the video autoplays.

CSS Custom Properties

VariableDefaultDescription
–media-object-fitinheritControls how the video fits its container.
–media-object-position50% 50%Controls the position of the video within its container.