vimeo-video
Video component that plays Vimeo videos and live events through the Vimeo player
Video component that plays Vimeo videos and live events through the Vimeo player SDK. Vimeo’s own chrome stays hidden by default, so it drops into a player skin like any other media component; set controls to use Vimeo’s UI instead.
Of the embed-backed media components, this one comes closest to a native <video>: volume, mute, playback rate, seeking, looping, and picture-in-picture all work, and the embed pushes real events instead of being polled.
Load a source
src takes a numeric video id or a Vimeo URL. Watch (vimeo.com/<id>), embed (player.vimeo.com/video/<id>), and event (vimeo.com/event/<id>) URLs all work.
<VimeoVideo src="https://vimeo.com/76979871" /><vimeo-video src="https://vimeo.com/76979871"></vimeo-video>Collection URLs aren’t supported: channels, showcases, albums, groups, on-demand pages, and user-scoped paths carry no id the player can load. Link to a specific video instead. #t= fragments are ignored as well; use engine.vimeo.start_time to start partway in.
Unlisted videos
An unlisted video needs the hash Vimeo issues alongside its id. Pass it the way Vimeo writes it, either as a trailing path segment or as an h parameter:
https://vimeo.com/76979871/abc123def
https://vimeo.com/76979871?h=abc123defBoth reach the embed as its h parameter. When a URL carries the hash in both places, the h parameter wins.
Live events
A vimeo.com/event/<id> URL plays that event through Vimeo’s event embed, and its unlisted hash becomes a path segment rather than a parameter. The media reports no stream type or live window, so a player skin renders it with the same controls as an on-demand video rather than a live UI.
Behavior
- Fullscreen goes through the Vimeo player, so Vimeo’s own fullscreen chrome appears and the player reports the state back.
- Captions round-trip by name only: the embed’s track list appears in
textTracksand selecting one enables it, but no cues cross over. Vimeo draws captions inside the iframe. posterhas no effect. The embed shows its own thumbnail, whichengine.vimeo.thumbnail_idpicks.playbackRateis limited to Vimeo’s supported range, 0.5 through 2.playsInlineandpreloadare read when the embed URL is built, so changing them later doesn’t take effect.- The video’s Vimeo title arrives as content data, so a player skin can show it without fetching anything yourself.
Examples
Basic Usage
import { VimeoVideo } from '@videojs/react/media/vimeo-video';
export default function BasicUsage() {
return (
<div className="vimeo-video">
<VimeoVideo src="https://vimeo.com/76979871" controls />
</div>
);
}
.vimeo-video {
width: 100%;
aspect-ratio: 16 / 9;
}
<vimeo-video
class="vimeo-video"
src="https://vimeo.com/76979871"
controls
></vimeo-video>
.vimeo-video {
width: 100%;
aspect-ratio: 16 / 9;
}
import '@videojs/html/media/vimeo-video';
API Reference
Attributes
These attributes configure the embedded media adapter:
| Attribute | Type | Default | Details |
|---|---|---|---|
autoplay | boolean | false | |
controls | boolean | false | |
disablepictureinpicture | boolean | — | |
loop | boolean | false | |
muted | boolean | false | |
playsinline | boolean | true | |
poster | string | '' | |
preload | MediaPreloadType | 'metadata' | |
src | string | '' |
Properties
| Property | Type | Default | Details |
|---|---|---|---|
autoplay | boolean | false | |
buffered | TimeRangeLike | — | |
| |||
contentData | MediaContentData | — | |
| |||
controls | boolean | false | |
currentSrc | string | — | |
| |||
currentTime | number | — | |
defaultMuted | boolean | false | |
disablePictureInPicture | boolean | — | |
duration | number | — | |
| |||
ended | boolean | — | |
| |||
engine | Player | null | — | |
| |||
error | ErrorLike | null | — | |
| |||
isFullscreen | boolean | — | |
| |||
isPictureInPicture | boolean | — | |
| |||
loop | boolean | false | |
muted | boolean | false | |
paused | boolean | — | |
| |||
playbackRate | number | — | |
playsInline | boolean | true | |
poster | string | '' | |
preload | MediaPreloadType | 'metadata' | |
readyState | number | — | |
| |||
seekable | TimeRangeLike | — | |
| |||
seeking | boolean | — | |
| |||
source | VimeoSource | null | null | |
| |||
src | string | '' | |
textTracks | TextTrackListLike | — | |
| |||
videoHeight | number | — | |
| |||
videoWidth | number | — | |
| |||
volume | number | — | |
Engine options
source.engine.vimeo
Pass Vimeo embed parameters under source.engine.vimeo, spelled exactly as Vimeo spells them. Media Sources covers how engine options fit into a structured source.
These options are typed from Vimeo’s own SDK, so your editor completes every parameter and rejects one Vimeo doesn’t have. That also means the list covers Vimeo’s oEmbed API alongside the player: id and url both override the video src names, and width, height, maxwidth, maxheight, and responsive size an oEmbed response rather than this element. Pass the video through src, and size the element with CSS.
autoplay, controls, loop, muted, playsinline, and preload come from the props of the same name. Setting them here overrides the prop, which is worth knowing when a value seems to be ignored. The element also sends transparent: false, where Vimeo’s default is true.
<VimeoVideo
source={{
src: 'https://vimeo.com/76979871',
engine: { vimeo: { color: 'f03e3e', start_time: 30, speed: true } },
}}
/>const video = document.querySelector('vimeo-video');
video.source = {
src: 'https://vimeo.com/76979871',
engine: { vimeo: { color: 'f03e3e', start_time: 30, speed: true } },
};| Option | Type | Details |
|---|---|---|
airplay | boolean | |
| ||
audio_tracks | boolean | |
| ||
audiotrack | string | |
| ||
autopause | boolean | |
| ||
autoplay | boolean | |
| ||
background | boolean | |
| ||
byline | boolean | |
| ||
cc | boolean | |
| ||
chapter_id | string | |
| ||
chapters | boolean | |
| ||
chromecast | boolean | |
| ||
color | string | |
| ||
colors | VimeoColors | |
| ||
controls | boolean | |
| ||
disable_context_menu | boolean | |
| ||
dnt | boolean | |
| ||
end_time | number | |
| ||
fullscreen | boolean | |
| ||
height | number | |
| ||
id | VideoId | |
| ||
initial_quality | string | |
| ||
interactive_markers | boolean | |
| ||
interactive_params | Record<string, string> | |
| ||
keyboard | boolean | |
| ||
loop | boolean | |
| ||
max_quality | string | |
| ||
maxheight | number | |
| ||
maxwidth | number | |
| ||
min_quality | string | |
| ||
muted | boolean | |
| ||
pip | boolean | |
| ||
play_button_position | "auto" | "bottom" | "center" | |
| ||
playsinline | boolean | |
| ||
portrait | boolean | |
| ||
prefer_mms | boolean | |
| ||
preload | "metadata" | "none" | "auto" | "metad... | |
| ||
progress_bar | boolean | |
| ||
quality | string | |
| ||
quality_selector | boolean | |
| ||
referrerPolicy | ReferrerPolicy | |
| ||
responsive | boolean | |
| ||
skipping_forward | boolean | |
| ||
speed | boolean | |
| ||
start_time | number | |
| ||
texttrack | string | |
| ||
thumbnail_id | string | |
| ||
title | boolean | |
| ||
transcript | boolean | |
| ||
transparent | boolean | |
| ||
unmute_button | boolean | |
| ||
url | VimeoUrl | |
| ||
vimeo_logo | boolean | |
| ||
volume | boolean | |
| ||
watch_full_video | boolean | |
| ||
width | number | |
| ||
Methods
Supports these media methods: exitFullscreenexitPictureInPictureloadpauseplayrequestFullscreenrequestPictureInPicture
Events
Implements these standard media events through the embedded player: durationchangeemptiedendedenterpictureinpictureerrorleavepictureinpictureloadedmetadataloadstartpauseplayplayingprogressratechangeresizeseekedseekingtimeupdatevolumechangewaiting
Also emits these Video.js-specific events:
| Event | Description |
|---|---|
contentdatachange | Fired when the embed reports a title and when that title is cleared. Read `contentData` for the new value. |
fullscreenchange | |
loadcomplete | |
sourcechange | Fired when `source` changes, either directly or by resolving a new `src`. Read `source` for the new value. |