Skip to main content
Video(props: VideoProps): Component;
The VideoProps type requires either a url or video source, plus optional playback settings:
type VideoProps = { autoplay?: boolean; muted?: boolean; controls?: boolean; loop?: boolean; contentMode?: "fit" | "fill" } &
    ({ url: string } | { video: string });
url
string
URL of a remote video to load.
video
string
Local video asset name.
autoplay
boolean
Whether the video starts playing automatically. Defaults to false.
muted
boolean
Whether the video is muted. Defaults to false.
controls
boolean
Whether playback controls are shown. Defaults to true.
loop
boolean
Whether the video loops continuously. Defaults to false.
contentMode
"fit" | "fill"
How the video is scaled within its frame. Defaults to "fit".

Support

Usage

Basic video

Video({ url: "https://example.com/video.mp4" })

Autoplay background video

Video({
    url: "https://example.com/hero.mp4",
    autoplay: true,
    muted: true,
    loop: true,
    controls: false,
    contentMode: "fill"
})
    .frame({ height: 300 })
    .cornerRadius(12)

Local video asset

Video({ video: "intro.mp4" })

Fit vs fill

Video({ url: "https://example.com/video.mp4", contentMode: "fit" })
    .frame({ width: 400, height: 300 })
Video({ url: "https://example.com/video.mp4", contentMode: "fill" })
    .frame({ width: 400, height: 300 })
    .clipped()

See Also