Query Now Playing
- PDF for offline use
- Sample Code:
- Related SDKs:
Let us know how you feel about this
Get information about the song playing in the Music Player.
- Add a reference to
- Create a new
MPMusicPlayerController MyPlayer = new MPMusicPlayerController();
- To get information about the currently playing song, use the
MPMediaItem Now = MyPlayer.NowPlayingItem; UIImage MyArtwork = Now.Artwork.ImageWithSize (new CGSize(100, 100)); Track.Text = Now.Title; Artist.Text = Now.Artist; Album.Text = Now.AlbumTitle; Lyrics.Text = Now.Lyrics; Artwork.Image = MyArtwork;
The MediaPlayer API does not run properly on a simulator. Always test on a device.