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
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.Accessible title for the
<iframe>. Defaults to "Video" if not set.Optional text caption rendered below the video.
Usage in Sanity Studio
- Add a Video Embed block to a page.
- Paste a YouTube or Vimeo URL into the Video URL field.
- 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.