An MPMediaLibrary object, or media library, represents the state of the set of synced media items (such as songs) on a device. The complete library of media items itself is called the iPod library.
Questions tagged [mpmedialibrary]
34 questions
                    
                    18
                    
            votes
                
                2 answers
            
        Can I add a music library to the Xcode iOS Simulator?
I'm trying to create a music player for iPhone and iPad.
I get it working perfectly on my iPhone and iPad because those actually have a music library. However I want to use fastlane and some other tools with tests so I need to be able to see/add a…
        
        NoSixties
        
- 2,443
 - 2
 - 28
 - 65
 
                    11
                    
            votes
                
                5 answers
            
        Can i access iPod Library on simulator?
I am trying some code to open the iPod Library using the simulator but the app crashes with this error:
MPMediaLibrary: Unable to launch iPod library server: application not found
Do I need an actual iPhone to test this code?
        
        coure2011
        
- 40,286
 - 83
 - 216
 - 349
 
                    8
                    
            votes
                
                1 answer
            
        Request authorization to Media Library programmatically fails
iOS 10 now requires the user's permission to access the Media Library. We check if we have access to the Media Library before we use it, and if not we then use [MPMediaLibrary requestAuthorization: to request authorization again from the user.
I'm…
        
        Jim Leask
        
- 6,159
 - 5
 - 21
 - 31
 
                    7
                    
            votes
                
                1 answer
            
        How to I get the copyright meta-data field from an MPMediaItem or AVAsset?
Apple's Music App shows meta data like "℗ 2007 Deutsche Grammophon GmbH, Hamburg". I would like to get this field.I do not see a copyright field in MPMediItem properties. There is an AV constant AVMetadataiTunesMetadataKeyCopyright which I tried to…
        user3821934
                    4
                    
            votes
                
                1 answer
            
        Apple Music API - Create a Playlist
I have been exploring the Apple Music API to see what kind of functionality I can expect to be able to use in an iOS app. I have created a little test app that gains permission from the user and outputs the playlists I have (and songs) to…
        
        scgough
        
- 5,099
 - 3
 - 30
 - 48
 
                    4
                    
            votes
                
                2 answers
            
        How to get MPMediaPlaylist's user defined cover image and description?
I know how to get MPMediaQuery's title by:
MPMediaQuery *playlistsQuery = [MPMediaQuery playlistsQuery];
NSArray *items = [playlistsQuery collections];
MPMediaPlaylist *myPlaylist = items.firstObject;
NSLog(@"%@",myPlaylist.name); //"New playlist…
        
        Zuyin XU
        
- 43
 - 1
 - 5
 
                    3
                    
            votes
                
                1 answer
            
        MPMediaLibrary.requestAuthorization not responding on Xcode 10.2 simulator
I just noticed that after having updated Xcode to version 10.2.1, I'm unable to see the permission request for Library and Apple Music when launching a couple of projects of mine on the simulator.
Debugging, I realised that the authorization request…
        
        Eil88
        
- 121
 - 5
 
                    3
                    
            votes
                
                2 answers
            
        Get Video Data in Videos Application
I want my player to play videos that are in Video app.
I access Media Library, and want to get list of videos, and when user selected a video, my player get the video data and play it on my own player.
How can I get the video data?
Notice that I…
        
        rick
        
- 1,009
 - 2
 - 10
 - 28
 
                    3
                    
            votes
                
                1 answer
            
        How to get artwork from MPMediaItemCollection
My goal is to get the cover picture for the playlists in iPod library. And I did something like
 playlistMediaItemCollections = MPMediaQuery.playlistsQuery().collections ?? []
 let artworks = playlistMediaItemCollections.map {…
        
        bunnyshell
        
- 253
 - 4
 - 12
 
                    2
                    
            votes
                
                0 answers
            
        MPMusicPlayerController.applicationQueuePlayer not updating start and end times using MPMusicPlayerMediaItemQueueDescriptor
I'm experiencing an issue with the MPMusicPlayerController.applicationQueuePlayer when setting the queue using an MPMusicPlayerMediaItemQueueDescriptor with specific start and end times. Instead of updating to the new start and end times, the…
        
        Joshua Hart
        
- 772
 - 1
 - 21
 - 31
 
                    2
                    
            votes
                
                1 answer
            
        Observe Media Library changes in iOS
I would like to know if it is possible to observe Media Library changes in iOS.
I would like to be notified every time a user adds, remove or edit a Media Item (Song, Artist or Album item).
I have still not found a way to do that.
        
        Augusto Carmo
        
- 4,386
 - 2
 - 28
 - 61
 
                    2
                    
            votes
                
                2 answers
            
        Checking authorizations for MPMediaLibrary in Swift 3
I am using the following code to check the MPMediaLibrary authorizations:
func handlePermissions() {
    let permissionStatus = MPMediaLibrary.authorizationStatus()
    switch (permissionStatus) {
    case…
        
        rocketman240
        
- 119
 - 12
 
                    1
                    
            vote
                
                1 answer
            
        MPMusicController play/pause API functions regardless Media Library permission accepted or denied
We are using MPMusicController in order to play short sound, but from iOS 13.4 onwards the application started crashing due to missing NSAppleMusicUsageDescription key in the info.plist.
However, after adding the key in info.plist, play/pause API of…
        
        Aman.Samghani
        
- 2,151
 - 3
 - 12
 - 27
 
                    1
                    
            vote
                
                0 answers
            
        Apple Music Api SkiptoNextItemnot working
Trying to skip to the next item in the queue, but when applicationMusicPlayer.skipToNextItem() is called, the place in the queue doesn't change, the current track just starts over. The queue is composed of an array of string item IDs.
  …
        
        The Swift Coder
        
- 390
 - 3
 - 13
 
                    1
                    
            vote
                
                1 answer
            
        How to wait for MPMediaLibrary requestAuthorization response
Im checking the response the user gives when prompted for accessing the media-library. I want to know how can i wait for the response of the user before continuing 
static func getAuthrization(completionHandler:@escaping (Bool) -> Void)  {
       …
        
        SujithaW
        
- 440
 - 5
 - 16