Skip to content
FrameworkStyle

BackgroundVideo

Decorative background video element with automatic muting and looping

Decorative background video. By default it’s muted, looped, and autoplaying — use the opt-out attributes below to change that. Renders a <video> inside a shadow DOM, positioned to fill its container.

Examples

Basic Usage

import { BackgroundVideo } from '@videojs/react/media/background-video';

export default function BasicUsage() {
  return (
    <div className="container">
      <BackgroundVideo src="https://stream.mux.com/601n4w1fq88NJiVpzvrQQeQfNnnjjfKMIN7dCGAEarTs/highest.mp4" />
    </div>
  );
}

API Reference

Attributes

AttributeDescription
srcURL of the video source.
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.