Refactor playback selection strategy into dedicated service

Extracted the complex playback logic from `js/app/playbackCoordinator.js` into a new `js/services/playbackStrategyService.js`.
This improves maintainability by separating the orchestration logic from the application glue code.
The coordinator now delegates to the service, passing a context object for UI interactions and state synchronization.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-10 04:27:31 +00:00
1 parent fc25801811
commit 0da9401235
3 files changed
+422 -267

No files matched your search

+5
View File
@@ -6,6 +6,7 @@ import { createWatchHistoryRenderer } from "../historyView.js";
import WatchHistoryController from "./watchHistoryController.js";
import WatchHistoryTelemetry from "../services/watchHistoryTelemetry.js";
import PlaybackService from "../services/playbackService.js";
import PlaybackStrategyService from "../services/playbackStrategyService.js";
import AuthService from "../services/authService.js";
import DiscussionCountService from "../services/discussionCountService.js";
import CommentThreadService from "../services/commentThreadService.js";
@@ -350,6 +351,10 @@ export default class ApplicationBootstrap {
},
},
});
app.playbackStrategyService = new PlaybackStrategyService({
playbackService: app.playbackService,
logger: devLogger,
});
app.activePlaybackResultPromise = null;
app.activePlaybackSession = null;