removes unused function callbacks and moves wakelock

This commit is contained in:
Marty Fuhry
2024-03-05 12:13:40 -05:00
parent 11d4945ce8
commit 40eab06ca3
5 changed files with 11 additions and 39 deletions
@@ -7,7 +7,6 @@ import 'package:immich_mobile/shared/models/asset.dart';
import 'package:immich_mobile/shared/models/store.dart';
import 'package:video_player/video_player.dart';
import 'package:immich_mobile/shared/models/store.dart' as store;
import 'package:wakelock_plus/wakelock_plus.dart';
/// Provides the initialized video player controller
/// If the asset is local, use the local file
@@ -138,24 +137,6 @@ class _ChewieControllerHookState
);
}
videoPlayerController!.addListener(() {
final value = videoPlayerController!.value;
if (value.isPlaying) {
WakelockPlus.enable();
hook.onPlaying?.call();
} else if (!value.isPlaying) {
WakelockPlus.disable();
hook.onPaused?.call();
}
if (value.position != const Duration() &&
value.position == value.duration) {
WakelockPlus.disable();
hook.onVideoEnded?.call();
}
});
await videoPlayerController!.initialize();
chewieController = ChewieController(