mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
播放逻辑修改
This commit is contained in:
parent
420438c0df
commit
50a27fdf67
33 changed files with 788 additions and 761 deletions
|
|
@ -12,20 +12,23 @@ class AbsMpvAudioPlayer extends AbsAudioPlayer {
|
|||
state.copyWith(
|
||||
playing: playing,
|
||||
processingState: playing
|
||||
? state.processingState == ProcessingState.idle
|
||||
? ProcessingState.ready
|
||||
? state.processingState == AbsProcessingState.idle
|
||||
? AbsProcessingState.ready
|
||||
: state.processingState
|
||||
: player.state.buffering
|
||||
? ProcessingState.buffering
|
||||
? AbsProcessingState.buffering
|
||||
: player.state.completed
|
||||
? ProcessingState.completed
|
||||
: ProcessingState.ready,
|
||||
? AbsProcessingState.completed
|
||||
: AbsProcessingState.ready,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
@override
|
||||
Stream<Duration> get bufferedPositionInBookStream => player.stream.buffer;
|
||||
Duration get bufferedPosition => player.state.buffer;
|
||||
|
||||
@override
|
||||
Stream<Duration> get bufferedPositionStream => player.stream.buffer;
|
||||
|
||||
@override
|
||||
int get currentIndex => player.state.playlist.index;
|
||||
|
|
@ -45,6 +48,9 @@ class AbsMpvAudioPlayer extends AbsAudioPlayer {
|
|||
await player.playOrPause();
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<bool> get playingStream => player.stream.playing;
|
||||
|
||||
@override
|
||||
Duration get position => player.state.position;
|
||||
|
||||
|
|
@ -91,17 +97,5 @@ class AbsMpvAudioPlayer extends AbsAudioPlayer {
|
|||
}
|
||||
|
||||
@override
|
||||
Stream<bool> get playingStream => player.stream.playing;
|
||||
|
||||
@override
|
||||
// TODO: implement speed
|
||||
double get speed => player.state.rate;
|
||||
|
||||
@override
|
||||
// TODO: implement bufferedPosition
|
||||
Duration get bufferedPosition => player.state.buffer;
|
||||
|
||||
@override
|
||||
// TODO: implement bufferedPositionStream
|
||||
Stream<Duration> get bufferedPositionStream => player.stream.buffer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue