I have an AudioPlayer in my Flutter code, and I have noticed that if I played another audio(for example a YouTube video), the player will automatically stop. I checked it using this code: player.playing, which returns true while I'm playing the audio in the app, and false after I play a YouTube video. What I wanna do is, listen to the player's state, to check if it's playing or not. I couldn't find any listener methods in AudioPlayer.
I considered using StateFullWidget, but I'm not sure how to do that, because my AudioPlayer is an API class, which is different from my StateFull UI.