feat: video player keyboard navigation toggle

This commit is contained in:
edde746
2025-12-12 17:05:01 +01:00
parent 263eddbdba
commit b0ee43d8cd
10 changed files with 7227 additions and 14147 deletions
+15
View File
@@ -4,6 +4,7 @@ import 'package:hotkey_manager/hotkey_manager.dart';
import 'package:plezy/utils/app_logger.dart';
import '../i18n/strings.g.dart';
import 'base_shared_preferences_service.dart';
import 'tv_detection_service.dart';
enum ThemeMode { system, light, dark }
@@ -48,6 +49,8 @@ class SettingsService extends BaseSharedPreferencesService {
static const String _keyCustomDownloadPath = 'custom_download_path';
static const String _keyCustomDownloadPathType = 'custom_download_path_type';
static const String _keyDownloadOnWifiOnly = 'download_on_wifi_only';
static const String _keyVideoPlayerNavigationEnabled =
'video_player_navigation_enabled';
SettingsService._();
@@ -444,6 +447,17 @@ class SettingsService extends BaseSharedPreferencesService {
await setKeyboardHotkeys(getDefaultKeyboardHotkeys());
}
// Video Player Navigation (use arrow keys to navigate video player controls)
Future<void> setVideoPlayerNavigationEnabled(bool enabled) async {
await prefs.setBool(_keyVideoPlayerNavigationEnabled, enabled);
}
bool getVideoPlayerNavigationEnabled() {
// Default: enabled on Android TV, disabled elsewhere
return prefs.getBool(_keyVideoPlayerNavigationEnabled) ??
TvDetectionService.isTVSync();
}
// Helper methods for HotKey serialization
Map<String, dynamic> _serializeHotKey(HotKey hotKey) {
return {
@@ -915,6 +929,7 @@ class SettingsService extends BaseSharedPreferencesService {
prefs.remove(_keyCustomDownloadPath),
prefs.remove(_keyCustomDownloadPathType),
prefs.remove(_keyDownloadOnWifiOnly),
prefs.remove(_keyVideoPlayerNavigationEnabled),
]);
}