# PlaybackService Overview **File:** `js/services/playbackService.js` The `PlaybackService` is the central orchestrator for video playback in bitvid. It implements the "Hybrid Playback Strategy", ensuring users get the fastest possible start (via direct URL) while maintaining the censorship-resistance of P2P (via WebTorrent) as a seamless fallback. ## Key Concepts ### 1. Hybrid Playback Strategy The goal is to play video from a standard HTTPS URL (CDN/Server) first because it offers instant seek and low latency. If that fails (404, blocked, or stalls), the system automatically switches to the WebTorrent engine to stream the content from the P2P network using the magnet link. ### 2. PlaybackSession Each attempt to play a video creates a `PlaybackSession`. This object encapsulates the state machine for that specific video request. - **Request Signature:** A unique ID derived from the URL and Magnet. Used to prevent race conditions (e.g., user clicks the same video twice, or switches videos rapidly). - **Watchdogs:** Event listeners attached to the `