Current playback time (in seconds).
The currently resolved signed URL for the active video.
Whether to resume from a saved time (true) or start from 0:00 (false) for the current video session.
Currently active video (or null if none).
Quality manager (network-adaptive and manual switching).
Begin playback for a given video from the very beginning (0:00). This disables resume for the current session and forces a fresh URL fetch.
Use-case:
The video to start.
Load a persisted playback position from localStorage for a given video ID.
Sets both currentTime and startSavedTime (true if a saved time exists).
The video identifier.
Reset all runtime state so the next playback session starts clean. Safe for reuse across the app; does not affect other components unless called.
Persist the current playback position to localStorage for a given video ID.
Uses a deterministic key: videoProgress_<id>.
The video identifier.
Switch the target quality by index (0..3). Mapping: 0 → 120p, 1 → 360p, 2 → 720p, 3 → 1080p.
Quality index (clamped to 0..3).
Update the current playback time (usually bound to timeupdate).
Current playback position in seconds.
VideoProgressService
Centralized state and behavior for video playback across the app.
Responsibilities:
Compatibility:
beginFromStart(video).