Posted By

ppaulojr on 12/23/11


Tagged

player itunes media iphone integration AVAudioPlayer


Versions (?)

AVAudioPlayer Metadata for iTunes integration


 / Published in: Objective C
 

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

Metadata of Playing Media iOS5 Only

Use this for integration with Accessories and Apple TV

  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. }

Report this snippet  

You need to login to post a comment.