A string representing the video URL, a file upload ID, or an options object.
The URL for the video.
The ID of the file upload.
The caption as a string, an array of strings, or an array of rich text objects.
A video block object compatible with Notion's API, or null if the URL/ID is invalid.
// Use with a video URL
const externalVideo = block.video.createBlock("https://www.youtube.com/watch?v=ec5m6t77eYM");
// Use with a file upload ID
const fileUploadVideo = block.video.createBlock("123e4567-e89b-12d3-a456-426614174000");
// Use with options object for external video
const externalVideo = block.video.createBlock({
url: "https://www.youtube.com/watch?v=ec5m6t77eYM",
caption: "Never gonna give you up"
});
// Use with options object for file upload
const fileUploadVideo = block.video.createBlock({
id: "123e4567-e89b-12d3-a456-426614174000",
caption: "Never gonna give you up"
});
Creates a video block.