I have my app successfully streaming an MP3 via AVPlayer. I implemented a MPVolumeView to pull in AirPlay support which works great but I notice that the title info on my apple tv, does not show anything from the streamed MP3 but rather just "Unknown" info. Is there anyway to control this info from the app or is this an issue caused by the MP3 being streamed? Any help would be much appreciated!!
Asked
Active
Viewed 2,797 times
3
-
Did you find a way to do this? I am trying to do the same thing. I have the meta data as decoded in the timedMetaData property of the player but I'm not sure how to make it show on the Apple TV. – Ben Jun 10 '11 at 13:57
-
Not yet. I will post a comment if I find anything. – stitz Jun 10 '11 at 16:02
-
Can you please post the code you have used. – Nir Aug 02 '11 at 08:41
2 Answers
3
I wanted to update this question in case someone else needed to control what is seen on their Apple TV during AirPlay. This functionality is for iOS5 yet the code sample below will compile properly on an app that includes iOS4 support.
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if (playingInfoCenter) {
UIImage *albumArtImage = [UIImage imageNamed:@"Album-Image-Name.png"];
MPMediaItemArtwork *artwork = [[MPMediaItemArtwork alloc] initWithImage:albumArtImage];
MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter];
NSDictionary *songInfo = [NSDictionary dictionaryWithObjectsAndKeys:
@"Artist Name", MPMediaItemPropertyArtist,
@"Title Name", MPMediaItemPropertyTitle,
@"Album Name", MPMediaItemPropertyAlbumTitle,
artwork, MPMediaItemPropertyArtwork,
nil];
center.nowPlayingInfo = songInfo;
}
This is all setup when you call the play method on your media player, such as AVPlayer.

stitz
- 1,429
- 1
- 16
- 33
0
If you are using iOS 5 take a look at MPNowPlayingInfoCenter. It is simple to use and get metadata to the AppleTv and other devices. You may need to implement support for remote control as well. The only thing I do not have working properly yet is the duration and current position.
-
Hi. You can improve your post quality by providing a link to the library you are suggesting, and the description the developer gives of it. – rdurand Oct 26 '12 at 09:16