My app involves music(iPodMusic), and there is a UISwitch toggling play/pause. My goal is to be able to detect if music is playing, so that therefore the play/pause switch can say 'play' when music is playing and 'pause' if it isn't.
if ([[MPMusicPlayerController iPodMusicPlayer] playbackState] == MPMusicPlaybackStatePlaying) ...
If the music is from your own app, check AVAudioPlayer's playing
property.
If the music is from iPod, check MPMusicPlayerController's nowPlayingItem
or playbackState
property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With