feat: new shortcuts to increase and decrease playback rate

This commit is contained in:
Trizotto 2025-09-07 15:02:34 +02:00
parent ee0fb85eb5
commit 838c5b3485
5 changed files with 27 additions and 0 deletions

View file

@ -69,6 +69,15 @@ class VideoPlayerSettingsProviderNotifier extends StateNotifier<VideoPlayerSetti
ref.read(videoPlayerProvider).setVolume(value);
}
void steppedSpeed(double i) {
final value = double.parse(
((ref.read(playbackRateProvider) + i).clamp(0.25, 3))
.toStringAsFixed(2),
);
ref.read(playbackRateProvider.notifier).state = value;
ref.read(videoPlayerProvider).setSpeed(value);
}
void toggleOrientation(Set<DeviceOrientation>? orientation) =>
state = state.copyWith(allowedOrientations: orientation);