use skip mediaCtr instead

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-01 16:30:01 +08:00
parent 2fbc5ff58e
commit b99e2366bd

View File

@@ -74,34 +74,30 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
) {
final AudioProcessingState processingState;
if (status.isCompleted) {
processingState = AudioProcessingState.completed;
processingState = .completed;
} else if (isBuffering) {
processingState = AudioProcessingState.buffering;
processingState = .buffering;
} else {
processingState = AudioProcessingState.ready;
processingState = .ready;
}
final playing = status.isPlaying;
playbackState.add(
playbackState.value.copyWith(
processingState: isBuffering
? AudioProcessingState.buffering
: processingState,
processingState: isBuffering ? .buffering : processingState,
controls: [
if (!isLive)
MediaControl.rewind.copyWith(
MediaControl.skipToPrevious.copyWith(
androidIcon: 'drawable/ic_baseline_replay_10_24',
),
if (playing) MediaControl.pause else MediaControl.play,
if (!isLive)
MediaControl.fastForward.copyWith(
MediaControl.skipToNext.copyWith(
androidIcon: 'drawable/ic_baseline_forward_10_24',
),
],
playing: playing,
systemActions: const {
MediaAction.seek,
},
systemActions: const {MediaAction.seek},
),
);
if (Platform.isAndroid && AndroidHelper.isPipMode) {
@@ -113,6 +109,12 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
}
}
@override
Future<void> skipToPrevious() => rewind();
@override
Future<void> skipToNext() => fastForward();
void onStatusChange(PlayerStatus status, bool isBuffering, isLive) {
if (_item.isEmpty) return;
setPlaybackState(status, isBuffering, isLive);