feat: performance overlay

This commit is contained in:
edde746
2025-12-19 13:06:58 +01:00
parent c6727baf07
commit 8db30c1568
7 changed files with 817 additions and 2 deletions
+11
View File
@@ -49,6 +49,7 @@ class SettingsService extends BaseSharedPreferencesService {
static const String _keyCustomDownloadPathType = 'custom_download_path_type';
static const String _keyDownloadOnWifiOnly = 'download_on_wifi_only';
static const String _keyVideoPlayerNavigationEnabled = 'video_player_navigation_enabled';
static const String _keyShowPerformanceOverlay = 'show_performance_overlay';
SettingsService._();
@@ -431,6 +432,15 @@ class SettingsService extends BaseSharedPreferencesService {
return prefs.getBool(_keyVideoPlayerNavigationEnabled) ?? TvDetectionService.isTVSync();
}
// Performance Overlay (show debug stats on video player)
Future<void> setShowPerformanceOverlay(bool enabled) async {
await prefs.setBool(_keyShowPerformanceOverlay, enabled);
}
bool getShowPerformanceOverlay() {
return prefs.getBool(_keyShowPerformanceOverlay) ?? false; // Default: disabled
}
// Helper methods for HotKey serialization
static const _modifierMap = <String, HotKeyModifier>{
'alt': HotKeyModifier.alt,
@@ -830,6 +840,7 @@ class SettingsService extends BaseSharedPreferencesService {
prefs.remove(_keyCustomDownloadPathType),
prefs.remove(_keyDownloadOnWifiOnly),
prefs.remove(_keyVideoPlayerNavigationEnabled),
prefs.remove(_keyShowPerformanceOverlay),
]);
}