Skip to main content
The VideoEmbed block renders an embedded video player inside a responsive <figure> element. It supports YouTube and Vimeo URLs and uses the video.ts utility for URL normalization.

Props

videoUrl
string
required
The video URL. Supports YouTube (https://youtube.com/watch?v=..., https://youtu.be/...) and Vimeo (https://vimeo.com/...) URLs. Converted to embed format by the getVideoEmbedUrl() utility in src/lib/video.ts.
title
string
Accessible title for the <iframe>. Defaults to "Video" if not set.
caption
string
Optional text caption rendered below the video.

Usage in Sanity Studio

  1. Add a Video Embed block to a page.
  2. Paste a YouTube or Vimeo URL into the Video URL field.
  3. Optionally add a Title (for accessibility) and Caption.
The video URL is sanitized by getVideoEmbedUrl() in src/lib/video.ts before being used as the <iframe> src. Only YouTube and Vimeo domains are accepted.

Example

{
  _type: 'videoEmbed',
  videoUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
  title: 'YWCC Capstone Program Overview',
  caption: 'Watch our 2-minute program overview video.'
}