mpmediapickercontroller

iPhone sdk, save MPMediaItemCollection?

你。 提交于 2019-12-20 14:20:25
问题 I have my application displaying a MPMediaPickerController . I would like to save the MediaItem and start it playing again on startup. I think this is doable using the MPMediaQuery . It seems, I should be using the MPMediaItemPropertyPersistentID but I am not sure how to query for it. Any thoughts? 回答1: Man, you dont need to save mediaCollection. media collection it is just array of MPMediaItem objects. So you'd better save persistentIds of this items. it's quite easy //it's how to know

URL to MPMediaItem

帅比萌擦擦* 提交于 2019-12-20 10:53:46
问题 I have a simple question but i can't found a right answer. I have a song url saved to my database. An path Like this. aSound.path = [[item valueForProperty: MPMediaItemPropertyAssetURL] absoluteString]; How to convert back to a MPMediaItem object wich has songname artist and artwork? Is it possible? Thanks the answers. 回答1: Saving: NSNumber* persistentID = [mediaItem valueForProperty:MPMediaItemPropertyPersistentID]; Loading: MPMediaPropertyPredicate * predicate = [MPMediaPropertyPredicate

Trying to make a file copy from MPMediaPickerController but …?

旧时模样 提交于 2019-12-20 07:07:57
问题 I am accessing some audio files from my iTunes library using MPMediaPickerController , inside an iOS application. I would like to copy those files into my app Document Directory for local processing. But I am wondering if this is meant to be possible. Here is the relevant code that I use: func mediaPicker(_ mediaPicker: MPMediaPickerController, didPickMediaItems mediaItemCollection: MPMediaItemCollection) { guard let theMediaItem = mediaItemCollection.items.first else {return} let newFileName

MPMediaPickerController with video media types not working

时光怂恿深爱的人放手 提交于 2019-12-18 13:31:47
问题 I am trying to browse video stored in my iPod library using the new video media types. With any video type I get this error on the console: Warning: Unsupported media types (1024), using MPMediaTypeAny. After this error, the picker only shows audio types. For reference, these are the new media types available in iOS5.0 (defined in MediaPlayer.framework/MediaItem.h): // video (available in iOS 5.0) MPMediaTypeMovie = 1 << 8, MPMediaTypeTVShow = 1 << 9, MPMediaTypeVideoPodcast = 1 << 10,

MPMediaItems raw song data

孤人 提交于 2019-12-17 07:03:36
问题 I was wondering how to access an MPMediaItem's raw data. Any ideas? 回答1: you can obtain the media item's data in such way: -(void)mediaItemToData { // Implement in your project the media item picker MPMediaItem *curItem = musicPlayer.nowPlayingItem; NSURL *url = [curItem valueForProperty: MPMediaItemPropertyAssetURL]; AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil]; AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset: songAsset presetName:

MPMediaPickerController background colors of icons, when aren´t selected

混江龙づ霸主 提交于 2019-12-11 08:15:21
问题 I need change the gray color of the icons in MPMediaPickerController, when they are not selected, and the background is opaque, like faded, i need remove this too. i'm using ios7.1 and the next code to show MPMediaPickerController element, on my viewController. - (IBAction)addSongs:(id)sender { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; [self presentViewController

How to get path of file selected using MPMediaPickerController?

狂风中的少年 提交于 2019-12-11 02:48:57
问题 This is how I've code to open media picker list - (void)viewDidLoad { [super viewDidLoad]; player=[MPMusicPlayerController iPodMusicPlayer]; picker=[[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeAnyAudio]; [picker setDelegate:self]; picker.prompt=@"Add an audio to application"; } I've also implemented its delegate method - (void)mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection { /*I know only here I can get path

Use MPMediaPicker selections as AVAudioPlayer inputs

旧时模样 提交于 2019-12-11 02:48:46
问题 I'm programming an application for the hearing-impaired. I'm hoping to take tracks from the iTunes library, and in my app have a slider for panning. I don't want to use OpenAL (this isn't a game - I repeat this is a media player). So since AVAudioPlayer has the easy pan method, can I take selections from the MPMediaPicker and feed them into the AVAudioPlayer so I can pan them? 回答1: I dont do a lot of iOS development, but I believe there are two ways. Method #1 You need to add /System/Library

Accessing users iTunes Library without MPMediaPickerController

笑着哭i 提交于 2019-12-11 01:27:40
问题 Is there another way to access the users iTunes Library than MPMediaPickerController? Can the UITableView which is used to present the MPMediaPickerController be customized? 回答1: Is there another way to access the users itunes library than MPMediaPickerController ? Sure, there's MPMediaQuery to query the iPod library programmatically. Once you havwe the data, you can display it any way you want. See the iPod Library Access Programming Guide. 来源: https://stackoverflow.com/questions/5221549

MPMediaPickerController.showsCloudItems seems to do nothing

别来无恙 提交于 2019-12-09 08:38:46
问题 Posted this on Apple with no luck, but now that the iOS 6 NDA is up, hoping more eyes will see it here. I am attempting to modify an app to only allow a user to select music that has been downloaded locally. I have the following code under iOS 6 GM: MPMediaPickerController* mpc = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAnyAudio]; mpc.allowsPickingMultipleItems = YES; mpc.modalPresentationStyle = UIModalPresentationCurrentContext; mpc.showsCloudItems = NO; [self