mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-08 03:54:49 +08:00
use skip mediaCtr instead
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -74,34 +74,30 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
|||||||
) {
|
) {
|
||||||
final AudioProcessingState processingState;
|
final AudioProcessingState processingState;
|
||||||
if (status.isCompleted) {
|
if (status.isCompleted) {
|
||||||
processingState = AudioProcessingState.completed;
|
processingState = .completed;
|
||||||
} else if (isBuffering) {
|
} else if (isBuffering) {
|
||||||
processingState = AudioProcessingState.buffering;
|
processingState = .buffering;
|
||||||
} else {
|
} else {
|
||||||
processingState = AudioProcessingState.ready;
|
processingState = .ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
final playing = status.isPlaying;
|
final playing = status.isPlaying;
|
||||||
playbackState.add(
|
playbackState.add(
|
||||||
playbackState.value.copyWith(
|
playbackState.value.copyWith(
|
||||||
processingState: isBuffering
|
processingState: isBuffering ? .buffering : processingState,
|
||||||
? AudioProcessingState.buffering
|
|
||||||
: processingState,
|
|
||||||
controls: [
|
controls: [
|
||||||
if (!isLive)
|
if (!isLive)
|
||||||
MediaControl.rewind.copyWith(
|
MediaControl.skipToPrevious.copyWith(
|
||||||
androidIcon: 'drawable/ic_baseline_replay_10_24',
|
androidIcon: 'drawable/ic_baseline_replay_10_24',
|
||||||
),
|
),
|
||||||
if (playing) MediaControl.pause else MediaControl.play,
|
if (playing) MediaControl.pause else MediaControl.play,
|
||||||
if (!isLive)
|
if (!isLive)
|
||||||
MediaControl.fastForward.copyWith(
|
MediaControl.skipToNext.copyWith(
|
||||||
androidIcon: 'drawable/ic_baseline_forward_10_24',
|
androidIcon: 'drawable/ic_baseline_forward_10_24',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
playing: playing,
|
playing: playing,
|
||||||
systemActions: const {
|
systemActions: const {MediaAction.seek},
|
||||||
MediaAction.seek,
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (Platform.isAndroid && AndroidHelper.isPipMode) {
|
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) {
|
void onStatusChange(PlayerStatus status, bool isBuffering, isLive) {
|
||||||
if (_item.isEmpty) return;
|
if (_item.isEmpty) return;
|
||||||
setPlaybackState(status, isBuffering, isLive);
|
setPlaybackState(status, isBuffering, isLive);
|
||||||
|
|||||||
Reference in New Issue
Block a user