mpmediapickercontroller

MPMediaPicker does not show

元气小坏坏 提交于 2019-12-08 10:39:51
问题 In a sample app that I'm making for Apple, I cannot get the MPMediaPickerController to show. I've already added the NSAppleMusicUsageDescription key in the info.plist file, and this is what makes my post different from any other answers found online. I've also tried adding CoreMedia.framework. I'm using XCode 10 beta 4 The app never asks for permissions to access the media library, and when I present the picker, the mediaPickerDidCancel method is called right away. What am I doing wrong?

MPMediaPickerController orientation on iPad

£可爱£侵袭症+ 提交于 2019-12-05 05:59:32
How can I set correct orientation of MPMediaPickerController ? I've return YES in shouldAutorotateToInterfaceOrientation, but i have bad frame for Landscape (if show MPMediaPickerController in Portrait first, and conversely). I've rotating my device chaotically and sometime frame set to correct himself! I've find the method to set frame by rotating - need rotate to 180 degreess. For example, if you have good frame in Portrait, when you rotate to Landscape - you have bad frame (from Portatait), but if you rotate to other landscape (to 180 degreess), then frame set to Landscape... Why ? How can

Get audio file size without export

醉酒当歌 提交于 2019-12-04 06:59:23
i'm developing an app that export audio file stored in the iPod library, but i should verify the file size before export and upload (server has a fixed max upload size): i know that after exporting file, the size will not be the same: is there any method to estimate the new size ? main question : can i know the original file size before export (using MPMediaItem or something else), so i can tell user that this file can't be uploaded (the export can take a while). thanks. I have not tested but AVAssetExportSession can help you with this. MPMediaItem *curItem = musicPlayer.nowPlayingItem; NSURL

URL to MPMediaItem

筅森魡賤 提交于 2019-12-03 00:36:47
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. amleszk Saving: NSNumber* persistentID = [mediaItem valueForProperty:MPMediaItemPropertyPersistentID]; Loading: MPMediaPropertyPredicate * predicate = [MPMediaPropertyPredicate predicateWithValue:persistentID forProperty:MPMediaItemPropertyPersistentID]; Another example:

MPMediaPickerController with video media types not working

牧云@^-^@ 提交于 2019-11-30 10:04:12
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, MPMediaTypeMusicVideo = 1 << 11, MPMediaTypeVideoITunesU = 1 << 12, MPMediaTypeAnyVideo = 0xff00, Can you

Pick Music from iOS Library and Send / Save

夙愿已清 提交于 2019-11-30 07:17:45
I have a query regarding Music Files. I want to select 1/more Music files from the Music Library of iPhone/iTouch/iPad and Save in my Documents Folder or Send it to Server. I roughly went through MPMediaPickerController and AddMusic(Sample Code) . But, I could only get details of selecting Songs and Playing it. Is it possible to Save those selected Songs , which I can also use to Send to Server ? Thanks Is it possible to save those selected songs, which I can also use to send to server? No, you can only play songs from the iTunes library. The raw audio files are not accessible, probably due to

Pick Music from iOS Library and Send / Save

此生再无相见时 提交于 2019-11-29 09:27:44
问题 I have a query regarding Music Files. I want to select 1/more Music files from the Music Library of iPhone/iTouch/iPad and Save in my Documents Folder or Send it to Server. I roughly went through MPMediaPickerController and AddMusic(Sample Code). But, I could only get details of selecting Songs and Playing it. Is it possible to Save those selected Songs , which I can also use to Send to Server ? Thanks 回答1: Is it possible to save those selected songs, which I can also use to send to server?

How to get NSData of mp3 using MPMediaPickerController?

十年热恋 提交于 2019-11-29 08:45:05
I want to upload mp3 from my phone to server, for this i am using MPMediaPickerController . After getting URL of MPMediaItem , i want to get NSData of this url , but i am getting null in NSData. - (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection { [self dismissViewControllerAnimated:YES completion:nil]; MPMediaItem *item=[[mediaItemCollection items] objectAtIndex:0]; NSURL *url = [item valueForProperty: MPMediaItemPropertyAssetURL]; NSString *path = [NSString stringWithFormat:@"%@",url]; NSData *data = [[NSFileManager

Access device music files from iPhone app programmatically

最后都变了- 提交于 2019-11-29 02:37:07
I want to access music files which are available on the iPhone and get it listed (or) get the file into my iPhone application some delegats and start playing it. Is it possible to do it ? Similar to how we access images from device photo album using UIImagePickerController delegate methods. Thank you! You can reference MPMediaPickerController class . It functions same as UIImagePickerController class. Samrat Pramanik -(void)loadDeviceMusic{ MPMediaQuery *everything = [[MPMediaQuery alloc] init]; [everything addFilterPredicate:[MPMediaPropertyPredicate predicateWithValue:[NSNumber

How to get NSData of mp3 using MPMediaPickerController?

。_饼干妹妹 提交于 2019-11-28 02:06:51
问题 I want to upload mp3 from my phone to server, for this i am using MPMediaPickerController . After getting URL of MPMediaItem , i want to get NSData of this url , but i am getting null in NSData. - (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection { [self dismissViewControllerAnimated:YES completion:nil]; MPMediaItem *item=[[mediaItemCollection items] objectAtIndex:0]; NSURL *url = [item valueForProperty: