From 4962fd3220a9535cd317370b037c69278da4a2a2 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Wed, 28 Jan 2026 23:42:24 +0100 Subject: [PATCH] fix: android tv video controls focus on start --- lib/screens/video_player_screen.dart | 4 ++-- lib/widgets/video_controls/video_controls.dart | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index 607b01fa..25583d6c 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -1891,8 +1891,8 @@ class VideoPlayerScreenState extends State with WidgetsBindin builder: (context, hasFrame, child) { if ((!isBuffering && hasFrame) || _isExiting.value) return const SizedBox.shrink(); // Show spinner only - controls overlay provides its own black background during loading - return IgnorePointer( - child: Positioned.fill( + return Positioned.fill( + child: IgnorePointer( child: Center( child: Container( padding: const EdgeInsets.all(20), diff --git a/lib/widgets/video_controls/video_controls.dart b/lib/widgets/video_controls/video_controls.dart index 0a535315..887d6d78 100644 --- a/lib/widgets/video_controls/video_controls.dart +++ b/lib/widgets/video_controls/video_controls.dart @@ -426,6 +426,12 @@ class _PlexVideoControlsState extends State with WindowListen _clickVideoTogglesPlayback = settingsService.getClickVideoTogglesPlayback(); }); + // Focus play/pause if navigation is now enabled and controls are visible + // (handles case where initState focus attempt failed due to async settings load) + if (_videoPlayerNavigationEnabled && _showControls) { + _focusPlayPauseIfKeyboardMode(); + } + // Apply rotation lock setting if (_isRotationLocked) { SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);