mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-17 14:59:35 +00:00
播放逻辑修改
This commit is contained in:
parent
420438c0df
commit
50a27fdf67
33 changed files with 788 additions and 761 deletions
|
|
@ -21,12 +21,12 @@ class AudiobookPlayerPlayPauseButton extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
Widget _getIcon(PlayerState playerState, BuildContext context) {
|
||||
Widget _getIcon(AbsPlayerState playerState, BuildContext context) {
|
||||
if (playerState.playing) {
|
||||
return Icon(size: iconSize, Icons.pause);
|
||||
} else {
|
||||
switch (playerState.processingState) {
|
||||
case ProcessingState.loading || ProcessingState.buffering:
|
||||
case AbsProcessingState.loading || AbsProcessingState.buffering:
|
||||
return CircularProgressIndicator();
|
||||
default:
|
||||
return Icon(size: iconSize, Icons.play_arrow);
|
||||
|
|
@ -34,13 +34,13 @@ class AudiobookPlayerPlayPauseButton extends HookConsumerWidget {
|
|||
}
|
||||
}
|
||||
|
||||
void _actionButtonPressed(PlayerState playerState, WidgetRef ref) async {
|
||||
void _actionButtonPressed(AbsPlayerState playerState, WidgetRef ref) async {
|
||||
final player = ref.read(absAudioPlayerProvider);
|
||||
if (playerState.playing) {
|
||||
await player.pause();
|
||||
} else {
|
||||
switch (playerState.processingState) {
|
||||
case ProcessingState.completed:
|
||||
case AbsProcessingState.completed:
|
||||
await player.seekInBook(const Duration(seconds: 0));
|
||||
await player.play();
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue