//js/webtorrent.js /** * js/webtorrent.js * * This module wraps the WebTorrent client and manages the Service Worker integration. * It is responsible for the "Torrent" half of the playback strategy. * * Key Responsibilities: * - Singleton WebTorrent client: It ensures we reuse a single client instance to * avoid resource leaks and connection churn. * - Service Worker Registration: It registers and manages `/sw.min.js`. This is critical * because WebTorrent in the browser streams data via a Service Worker "proxy" that * intercepts HTTP requests from the