1
我想在我的應用程序中使用avplayer播放設備歌曲。在NSLog的即時得到數組值===> 「18023427656013653237」, 「15946441828903552798」, 「10791915036547881152」, 「17986655796364263078」 //現在我想這些是什麼值.....如何在AVPlayer中將MPMediaItemCollection提取到NSData?
我有試過這.....
-(IBAction)SelectSongs:(id)sender
{
MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeAny];
picker.delegate = self;
picker.allowsPickingMultipleItems =YES;
picker.prompt = @"Select songs from the list";
[self presentViewController:picker animated:YES completion:^(void) {}];
}
-(void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection
{
if (mediaItemCollection)
{
NSMutableArray *medialibraryArray;
medialibraryArray=[[NSMutableArray alloc]init];
[medialibraryArray addObject:mediaItemCollection.items];// Modified
NSLog(@"%@=========>",medialibraryArray);
}
[self dismissViewControllerAnimated:YES completion:^(void) {}];}
-(void) mediaPickerDidCancel: (MPMediaPickerController *) mediaPicker
{
[self dismissViewControllerAnimated:YES completion:^(void) {}];
}
// Thanks in Advance
非常感謝您的寶貴意見 – NextStep