fix: backward and forward issue

This commit is contained in:
22
2025-06-02 18:52:32 +08:00
parent a1c0fb53a7
commit 155bebbbfb
2 changed files with 14 additions and 6 deletions

View File

@@ -289,13 +289,17 @@ FvpPlayer useFvpPlayer(BuildContext context) {
}
Future<void> stepBackward() async {
await controller.step(frames: -1);
logger('Step backward');
if (file?.type == ContentType.video) {
await controller.step(frames: -1);
logger('Step backward');
}
}
Future<void> stepForward() async {
await controller.step(frames: 1);
logger('Step forward');
if (file?.type == ContentType.video) {
await controller.step(frames: 1);
logger('Step forward');
}
}
Future<void> saveProgress() async {

View File

@@ -302,11 +302,15 @@ MediaKitPlayer useMediaKitPlayer(BuildContext context) {
: await player.seek(newPosition);
Future<void> backward(int seconds) async {
await seekTo(Duration(seconds: position.value.inSeconds - seconds));
if (file?.type == ContentType.video) {
await seekTo(Duration(seconds: position.value.inSeconds - seconds));
}
}
Future<void> forward(int seconds) async {
await seekTo(Duration(seconds: position.value.inSeconds + seconds));
if (file?.type == ContentType.video) {
await seekTo(Duration(seconds: position.value.inSeconds + seconds));
}
}
Future<void> stepBackward() async {