Overview
The Video plugin provides a complete solution for adding videos to your content. It supports file uploads, embedding from video providers (YouTube, Vimeo, Dailymotion, Loom, Wistia), video resizing, and various playback options.Installation
Basic Usage
Pass the plugin tocreateYooptaEditor; do not pass plugins to <YooptaEditor>.
Features
- File Upload: Upload videos from device
- Provider Embedding: Embed videos from YouTube, Vimeo, Dailymotion, Loom, and Wistia
- URL Insertion: Insert videos via URL (automatically detects provider)
- Custom Upload Functions: Direct uploads to Cloudinary, S3, Firebase, Mux, etc.
- Video Resizing: Resize videos while maintaining aspect ratio
- Size Limits: Set maximum width and height
- Object Fit: Control how videos fit their container
- Playback Settings: Configure controls, loop, muted, and autoplay
- Poster Images: Set custom poster/thumbnail images
- Video Deletion: Optional deletion handling with custom functions (if not configured, deletion only removes from editor)
- Responsive: Automatically adapts to screen size
Configuration
The Video plugin supports two approaches for upload and delete operations:- Endpoint-based: Configure an API endpoint and the plugin handles the request
- Custom function: Provide your own async function for complete control (useful for direct uploads to Cloudinary, S3, Firebase, Mux, etc.)
Endpoint-based Upload (Backend API)
Custom Upload Function (Direct to Cloud)
For direct uploads to third-party services like Cloudinary, AWS S3, Firebase Storage, or Mux, you can provide a custom async function:Provider URL Embedding
The Video plugin automatically detects and embeds videos from supported providers when you paste a URL:- YouTube:
youtube.com,youtu.be - Vimeo:
vimeo.com - Dailymotion:
dailymotion.com,dai.ly - Loom:
loom.com - Wistia:
wistia.com,wistia.net
- Detects the provider
- Extracts the video ID
- Generates the embed URL
- Optionally fetches the thumbnail
Options
upload
Can be either an object (endpoint-based) or a function (custom upload):- Endpoint Object
- Custom Function
object
delete (optional)
Can be either an object (endpoint-based) or a function (custom delete). If not provided, deleting a video block will only remove it from the editor without calling any storage deletion logic.- Endpoint Object
- Custom Function
object
object | function
Optional. Upload function for poster/thumbnail images. Can be endpoint-based or custom function, similar to
upload.object
object
array
Optional. Array of allowed video provider types. If not set, all providers are allowed.Supported values:
'youtube' | 'vimeo' | 'dailymotion' | 'loom' | 'wistia'string
default:"video/*"
Accepted video file types (e.g., “video/mp4,video/webm,video/ogg”)
number
Maximum file size in bytes
Element Props
string | null
Video source URL (for direct video files) or embed URL (for provider videos)
object | null
Provider information for embedded videos:
object
Video playback settings:
object
Video dimensions:
{ width: number | string, height: number | string }'contain' | 'cover' | 'fill' | null
How the video should fit its container
string | null
URL of the poster/thumbnail image to display before video loads
string | null
Responsive video source set
string | null
Background color for video container
Commands
Provider Utilities
The Video plugin exports utility functions for working with video providers:Upload Response Format
Your upload endpoint should return:Custom Rendering
Parsers
HTML Deserialization
The plugin automatically deserializes<video> tags:
HTML Serialization
Markdown Serialization
Use Cases
Blog Posts
Embed tutorial videos and demonstrations
Documentation
Video guides and walkthroughs
Portfolios
Showcase project videos and reels
Product Demos
Feature product videos and tutorials
Educational Content
Course videos and lectures
Social Media
Embed YouTube and Vimeo content
Best Practices
Optimize Video Files
Optimize Video Files
Compress videos before uploading to reduce file size and improve load times
Use Poster Images
Use Poster Images
Set a poster image to improve user experience while video loads
Set Size Limits
Set Size Limits
Configure appropriate maxWidth and maxHeight for your design
Consider Autoplay Policies
Consider Autoplay Policies
Browser autoplay policies may require videos to be muted for autoplay to work
Provide Fallbacks
Provide Fallbacks
Handle upload errors gracefully with user feedback
Use Provider Embedding
Use Provider Embedding
For large videos, consider using provider embedding (YouTube, Vimeo) instead of direct uploads
Hooks
useVideoUpload
Supports both endpoint-based and custom function approaches:- Endpoint-based
- Custom Function
useVideoDelete
Supports both endpoint-based and custom function approaches:- Endpoint-based
- Custom Function
useVideoPreview
Generate a preview URL for a video file before uploading:useVideoPosterUpload
Upload poster/thumbnail images separately:Troubleshooting
Error: Upload options are not configured
Error: Upload options are not configured
This error occurs when you’re using a theme but haven’t configured the
upload option.Solution: Add an upload configuration to your Video plugin:Video not deleted from storage
Video not deleted from storage
If you want to delete videos from your storage when removed from the editor, you need to configure the Note: The
delete option.Solution: Add a delete configuration to your Video plugin:delete option is optional. Without it, videos are only removed from the editor.Error: Missing 'endpoint' in upload/delete options
Error: Missing 'endpoint' in upload/delete options
This error occurs when using endpoint-based configuration without providing the
endpoint URL.Solution: Make sure to include the endpoint property:Provider URL not detected
Provider URL not detected
If a provider URL is not being detected, check:
- The URL format matches supported patterns
- The provider is in the
allowedProviderslist (if configured) - The URL is from a supported provider (YouTube, Vimeo, Dailymotion, Loom, Wistia)
parseVideoUrl utility to debug:Video not autoplaying
Video not autoplaying
Many browsers block autoplay unless the video is muted. Make sure to set
muted: true when using autoPlay: true.Solution:Related Plugins
- Image Plugin - For image content
- File Plugin - For file attachments
- Carousel Plugin - For media galleries

