Basically, I have in-app play/pause controls, which I'd like to animate using animated button in a stateful widget once player's state is changed.
Widget code:
audioPlayer.onPlayerStateChanged?.listen((state) {
if (state == AudioPlayerState.PLAYING) {
_controller.forward();
} else if ((state == AudioPlayerState.PAUSED)) {
_controller.reverse();
}
Everything works great except the bluetooth controls on ios. For example, when I pause the remote audio by headphone controls, seems like it doesn't trigger onPlayerStateChanged and the in-app controls stay the same (but the actual audio is paused). Is it possible to intecept that events?
I have same issue with the headphone. when I unplug my headphone from the phone. trigger onPlayerStateChange doesn't work and I can't catch event change State to switch icon pause and play. pls fix this!
Basically, I have in-app play/pause controls, which I'd like to animate using animated button in a stateful widget once player's state is changed.
Widget code:
Everything works great except the bluetooth controls on ios. For example, when I pause the remote audio by headphone controls, seems like it doesn't trigger onPlayerStateChanged and the in-app controls stay the same (but the actual audio is paused). Is it possible to intecept that events?