diff --git a/js/services/playbackService.js b/js/services/playbackService.js index 933ee2cf..c0c0247d 100644 --- a/js/services/playbackService.js +++ b/js/services/playbackService.js @@ -1,6 +1,23 @@ import { userLogger } from "../utils/logger.js"; // js/services/playbackService.js +/** + * PlaybackService acts as the central conductor for video playback. + * It manages the lifecycle of a "PlaybackSession", which encapsulates the complex + * logic of attempting to play a video from a direct URL (HTTP/CDN) first, and + * falling back to a WebTorrent (P2P) stream if the URL is unreachable or stalls. + * + * Key Responsibilities: + * - Singleton-ish orchestration (only one active session at a time usually). + * - "Watchdog" monitoring: It attaches listeners to the