AVAudioPlayer Metadata for iTunes integration


/ Published in: Objective C
Save to your folder(s)

Metadata of Playing Media
*iOS5 Only*

Use this for integration with Accessories and Apple TV


Copy this code and paste it in your HTML
  1. // iOS5 Only
  2. - (void) setMediaInfo {
  3. NSMutableDictionary * dict = [[NSMutableDictionary alloc] init];
  4. NSString * imName = @"imagetest.png"; // Artwork image
  5. [dict setObject:NSLocalizedString(@"My Music", @"") forKey:MPMediaItemPropertyTitle];
  6. [dict setObject:NSLocalizedString(@"Myself Artist", @"") forKey:MPMediaItemPropertyArtist];
  7. MPMediaItemArtwork * mArt = [[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:imName]];
  8. [dict setObject:mArt forKey:MPMediaItemPropertyArtwork];
  9. [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = nil;
  10. [[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:dict];
  11. [dict release];
  12. }

URL: http://www.netfilter.com.br

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.