From 95a91ee675592ee9a10ccd710f00f14530440c55 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:06:41 +0000 Subject: [PATCH] Implement video source toggle (CDN vs P2P) - Added source toggle UI in `components/video-modal.html`. - Updated `VideoModal.js` to manage toggle visibility (only when both URL and Magnet exist), update peer/server counts, and dispatch `playback:switch-source` events. - Updated `PlaybackService.js` to support a `forcedSource` option, allowing bypassing of the URL probe when "torrent" is forced. - Updated `app.js` to listen for the toggle event on the video modal and re-initialize playback with the forced source preference. - Updated `tests/ui/helpers/jsdom-test-helpers.mjs` to expose necessary globals for JSDOM testing. - Fixed an issue where the event listener was missing in `app.js`, causing the toggle to be unresponsive.