diff --git a/lib/blocs/mini_player/mini_player_bloc.dart b/lib/blocs/mini_player/mini_player_bloc.dart index 7e4b6c9..e17a69a 100644 --- a/lib/blocs/mini_player/mini_player_bloc.dart +++ b/lib/blocs/mini_player/mini_player_bloc.dart @@ -1,8 +1,6 @@ // ignore_for_file: public_member_api_docs, sort_constructors_first import 'dart:async'; import 'dart:developer'; - -import 'package:audio_service/audio_service.dart'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:Bloomee/blocs/mediaPlayer/bloomee_player_cubit.dart'; @@ -76,6 +74,7 @@ class MiniPlayerBloc extends Bloc { _playerStateSubscription = playerCubit.bloomeePlayer.audioPlayer.playerStateStream.listen((event) { + log("${event.processingState}", name: "MiniPlayer"); switch (event.processingState) { case ProcessingState.idle: add(MiniPlayerInitialEvent()); @@ -97,6 +96,10 @@ class MiniPlayerBloc extends Bloc { if (event.playing) { add(MiniPlayerPlayedEvent( playerCubit.bloomeePlayer.currentMedia)); + } else if (playerCubit.bloomeePlayer.isLinkProcessing.value == + true) { + add(MiniPlayerProcessingEvent( + playerCubit.bloomeePlayer.currentMedia)); } else { add(MiniPlayerPausedEvent( playerCubit.bloomeePlayer.currentMedia)); @@ -109,11 +112,6 @@ class MiniPlayerBloc extends Bloc { playerCubit.bloomeePlayer.currentMedia)); } catch (e) {} break; - case AudioProcessingState.error: - try { - add(MiniPlayerErrorEvent(playerCubit.bloomeePlayer.currentMedia)); - } catch (e) {} - break; } }); } diff --git a/lib/screens/widgets/mini_player_widget.dart b/lib/screens/widgets/mini_player_widget.dart index 152932f..01837fc 100644 --- a/lib/screens/widgets/mini_player_widget.dart +++ b/lib/screens/widgets/mini_player_widget.dart @@ -46,6 +46,7 @@ class MiniPlayerWidget extends StatelessWidget { ), MiniPlayerWorking() => MiniPlayerCard( state: state, + isProcessing: state.isBuffering, ), MiniPlayerError() => const SizedBox(), MiniPlayerProcessing() => MiniPlayerCard(