/ Published in: iPhone
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// instantiate a music player MPMusicPlayerController *iPodMediaPlayer; iPodMediaPlayer = [MPMusicPlayerController iPodMusicPlayer]; // Check if it is now playing if([iPodMediaPlayer nowPlayingItem]){ NSLog(@"iPod is playing"); // Get the now playing item MPMediaItem *nowPlayingMediaItem = [iPodMediaPlayer nowPlayingItem]; // Get info of the item } else { NSLog(@"iPod is not plaing"); }