Overview
TheVideoPlayer component is StreamVault’s built-in video player, providing a full-featured HTML5 video experience with automatic transcoding fallback, progress tracking, and keyboard controls.
Features
- HTML5 Video Controls: Custom UI with play/pause, seek, volume, and fullscreen
- Progress Tracking: Automatic progress updates every 5 seconds
- Transcoding Fallback: Auto-transcode unsupported formats using FFmpeg
- Keyboard Shortcuts: Space/K to play/pause, F for fullscreen, M to mute, Arrow keys to seek
- Large File Support: Chunked loading for files >4GB
- Blob URL Loading: Local files loaded as blob URLs for browser compatibility
Component Interface
VideoPlayer.tsx
/home/daytona/workspace/source/src/components/VideoPlayer.tsx:6-18
Usage
Basic Playback
Resume Playback with Progress
Transcoding Support
The player automatically transcodes unsupported formats using FFmpeg:Auto-Transcode Formats
/home/daytona/workspace/source/src/components/VideoPlayer.tsx:106
Transcode Flow
/home/daytona/workspace/source/src/components/VideoPlayer.tsx:44-74
Keyboard Shortcuts
| Key | Action |
|---|---|
Space / K | Toggle play/pause |
F | Toggle fullscreen |
M | Toggle mute |
← | Seek backward 10 seconds |
→ | Seek forward 10 seconds |
Esc | Exit fullscreen or close player |
/home/daytona/workspace/source/src/components/VideoPlayer.tsx:315-351
Progress Tracking
Automatic Updates
Progress is reported every 5 seconds while playing:/home/daytona/workspace/source/src/components/VideoPlayer.tsx:354-362
Video Loading Strategy
Chunked Loading
For large files, video is loaded in 10MB chunks:/home/daytona/workspace/source/src/components/VideoPlayer.tsx:133-169
MIME Type Detection
/home/daytona/workspace/source/src/components/VideoPlayer.tsx:161-163
VideasyPlayer (Streaming)
For cloud streaming, use theVideasyPlayer component:
VideasyPlayer Interface
/home/daytona/workspace/source/src/components/VideasyPlayer.tsx:6-15
Progress Events
Videasy sends progress updates viapostMessage:
/home/daytona/workspace/source/src/components/VideasyPlayer.tsx:17-25
Error Handling
Video Errors
/home/daytona/workspace/source/src/components/VideoPlayer.tsx:202-225
Controls UI
Auto-Hide Controls
Controls fade out after 3 seconds of inactivity:/home/daytona/workspace/source/src/components/VideoPlayer.tsx:239-248
Related Components
- ResumeDialog - Resume playback dialog
- MPV Integration - External MPV player
- Settings Modal - Configure player preferences