Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
HelloMusic
Images
HelloMusic.sln
README.md

README.md

id title brief sdk
7C9D42C9-C8B5-43EA-A905-B0235BA51D70
Query Now Playing
Get information about the song playing in the Music Player.

Recipe

  1. Add a reference to MediaPlayer
  using MediaPlayer;
  1. Create a new MPMusicPlayerController
``` MPMusicPlayerController MyPlayer = new MPMusicPlayerController(); ```
  1. To get information about the currently playing song, use the NowPlaying property:
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;</code></pre>

Additional Information

The MediaPlayer API does not run properly on a simulator. Always test on a device.