Skip to content

Instantly share code, notes, and snippets.

@cyndibaby905
Created January 20, 2014 09:11
Show Gist options
  • Save cyndibaby905/8517192 to your computer and use it in GitHub Desktop.
Save cyndibaby905/8517192 to your computer and use it in GitHub Desktop.
Get iPod's current playing info. Do not use `MPNowPlayingInfoCenter`, since it works only for your current application.
MPMusicPlayerController* player = [MPMusicPlayerController iPodMusicPlayer];
//get now playing item
if (player.playbackState == MPMusicPlaybackStatePlaying) {
MPMediaItem*item = [player nowPlayingItem];
NSLog(@"playing %@",[item valueForProperty:MPMediaItemPropertyTitle]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment