Overview
TheResumeDialog component prompts users to resume playback from their last position or start over. It displays progress information with a visual timeline and supports keyboard shortcuts.
Component Interface
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:14-26
Features
- Progress Visualization: Animated progress bar with percentage and time remaining
- Keyboard Shortcuts:
Enter/Rto resume,Sto start over - Streaming Mode: Simplified UI when progress is in browser localStorage
- Time Formatting: Human-readable timestamps (HH:MM:SS)
- Poster Background: Blurred poster image backdrop
Usage
Basic Resume Dialog
TV Show Episode
Streaming Mode
For cloud streaming where progress is in browser:Time Formatting
Format Seconds to Timestamp
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:28-38
Examples:
formatTime(125)→"2:05"formatTime(3665)→"1:01:05"
Format Time Remaining
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:41-55
Examples:
formatTimeRemaining(1800, 3600)→"30 minutes"formatTimeRemaining(1800, 7200)→"1 hour 30 mins"
Progress Visualization
Progress Calculation
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:70-72
Animated Progress Bar
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:167-184
Keyboard Shortcuts
| Key | Action |
|---|---|
Enter / R | Resume playback |
S | Start over from beginning |
Esc | Close dialog (via Dialog component) |
Implementation
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:85-100
UI Modes
With Progress Data
Shows detailed progress visualization:- Current time / Total duration
- Animated progress bar
- Percentage watched
- Time remaining
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:134-198
Streaming Mode
Simplified UI for cloud streaming:- Play icon instead of progress bar
- Generic “You’ve watched this before” message
- Note about browser localStorage
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:201-226
Button Labels
Resume Button
- With progress: “Resume at 12:34”
- Streaming: “Continue Watching”
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:249-258
Start Over Button
/home/daytona/workspace/source/src/components/ResumeDialog.tsx:238-248
Integration Example
Complete Flow
Styling
The dialog uses Tailwind CSS with glassmorphism effects:/home/daytona/workspace/source/src/components/ResumeDialog.tsx:104
Related Components
- VideoPlayer - Built-in HTML5 player
- VideasyPlayer - Streaming player
- MPV Integration - External MPV player