refactor: fold single-use helpers into their call sites

Collapses indirection layers and one-caller abstractions across the video
player, shortcut dispatch, shader loading and context-menu code, including
the VideoPIPManager pass-through over PipService.
This commit is contained in:
edde746
2026-07-26 06:09:49 +02:00
parent 7416327d4b
commit 83f4e2a263
15 changed files with 443 additions and 598 deletions
@@ -267,12 +267,11 @@ extension _VideoPlayerPlaybackServiceMethods on VideoPlayerScreenState {
_stopLiveTimelineUpdates();
_detachPipStateListener();
_clearAutoPipEnteringCallback();
final videoPipManager = _videoPIPManager;
_videoPIPManager = null;
if (videoPipManager != null) {
videoPipManager.onBeforeEnterPip = null;
final pipInitialized = _pipInitialized;
_pipInitialized = false;
if (pipInitialized) {
try {
await videoPipManager.disableAutoPip();
await PipService.setAutoPipReady(ready: false);
} catch (e, st) {
appLogger.w('Failed to disable auto-PiP during initialization rollback', error: e, stackTrace: st);
}
@@ -632,7 +631,7 @@ extension _VideoPlayerPlaybackServiceMethods on VideoPlayerScreenState {
// Update auto-PiP readiness
if (_autoPipEnabled) {
_videoPIPManager?.updateAutoPipState(isPlaying: isPlaying);
unawaited(_updateAutoPipState(isPlaying: isPlaying));
}
}