Questions tagged [mpmediaitem]

Class form Apple MediaPlayer framework. A media item represents a single piece of media (such as one song or one video podcast) in the iPod library.

A media item represents a single piece of media (such as one song or one video podcast) in the iPod library. A media item has an overall unique identifier, accessed using the MPMediaItemPropertyPersistentID property key, as well as specific identifiers for its metadata. These identifiers persists across application launches.

A media item can have a wide range of metadata associated with it. You access this metadata using the valueForProperty: method along with the property keys described in this document. The You can also access metadata in a batch fashion using the enumerateValuesForProperties:usingBlock: method. In some cases, this is more efficient. Both of these methods are defined in MPMediaEntity, the abstract superclass of MPMediaItemCollection.

266 questions
4
votes
1 answer

MPMusicPlayerController Track Length

Using an MPMusicPlayerController is there a way to query the tracks length? Using .currentPlaybackTime I can figure out how far I am into the track but I have no way of knowing how long the track is. My [MPMediaItem…
TurqMage
  • 3,321
  • 2
  • 31
  • 52
4
votes
5 answers

Not able to get the UIImage from MPMediaItemPropertyArtWork

I have the following code to get the UIImage from MPMediaItemPropertyArtWork to display the coverArt in my view. I get a non-NULL artwork from the mediaItem, however, when I try to extract the UIImage from the artwork, it returns NULL and I don't…
Balaji Krishnan
  • 101
  • 3
  • 5
4
votes
1 answer

URL to show in MPMediaItemPropertyArtwork

So I want to show an image from a URL. I know I would first need to make it friendly URL encoded - .addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! for example if var strUrl = nowplaying.data.first?.track.imageurl { strUrl =…
RussellHarrower
  • 6,470
  • 21
  • 102
  • 204
4
votes
1 answer

How to properly add predicate for Music Compilations in MPMediaItem

In my app I'm checking if the currently playing song is part of an album. I am able to do this but I have found that if an album is part of a compilation my code does not work as expected. What I want to do is if the currently playing song is part…
RubberDucky4444
  • 2,330
  • 5
  • 38
  • 70
4
votes
3 answers

iOS 13: MPMediaPickerController - Internal Error / The requested app extension could not be found

It seems that the general MPMediaPicker is not working anymore on ios13 (ipad air 2, iphone SE) The example 1:1 copied from there is not showing up the media…
Martin Mlostek
  • 2,755
  • 1
  • 28
  • 57
4
votes
0 answers

iOS MPMediaItem: Options as set in iTunes

When loading MPMediaItems via the MPMediaLibrary (MediaPlayer Framework), I'm looking for a way to access the start, stop, and volume properties as they can be set in iTunes via right click on a song => Get Info => Options. These properties are not…
Oscar
  • 668
  • 6
  • 12
4
votes
1 answer

Using MPMusicPlayerController play a MPMediaItemCollection, how to get the event of at end of playing

I'm using the MPMusicPlayerController to play MPMediaItems in a MPMediaItemCollection. How can I fire an event when the MPMediaItems are done playing?
arachide
  • 8,006
  • 18
  • 71
  • 134
4
votes
3 answers

MPMediaItemPropertyAssetURL returning nil

I am working on a project where I need to play songs from iTunes Library in AVPlayer. For that, I am taking URL "ipod-library://item/item.mp3?id=1577682869916034242" of selected songs from iTunes Library and playing same in AVPlayer. Almost all…
Sanchit Paurush
  • 6,114
  • 17
  • 68
  • 107
4
votes
2 answers

Bug: MPMediaItem Download Status on iOS & MPMediaPropertyPredicate using assetURL

Fun bug in the MPMedia API I have had an ongoing bug in my music app that I have finally tracked down now (now that I am re-writing it in swift). It has a few facets. (using systemMusicPlayer) I think I have narrowed the issues down to an…
solenoid
  • 954
  • 1
  • 9
  • 20
4
votes
0 answers

MPMediaPickerController and iOS 8.4

From iOS 8.4 i can't get assetURL from MPMediaItem (nil for songs from Apple Music), which are sent to me by MPMediaPickerController. How can I hide (songs also iTunes Store) in MPMediaPickerController or get assetURL for them. P.S. I assume, that I…
4
votes
0 answers

Load project's mp3 into MPMediaItem

I've got an mp3 in my project's "Supporting Files" folder, and I'd like to create an MPMediaItem for that song. Normally, I'd use MPMediaQuery if I were creating an MPMediaItem from the user's library, but I'm not sure how that would work with a…
Rogare
  • 3,234
  • 3
  • 27
  • 50
4
votes
1 answer

Determine if a song has album art in iOS

I am working on an iOS app and I need to determine if a song has album art. I am using the MPMusicPlayerController to access the native iOS music library and I am using a MPMediaItemArtwork to capture the artwork sent from the iOS music library.…
JDVDV5
  • 55
  • 5
4
votes
2 answers

How Do You Obtain the "Purchase Date" or "Date Added" from MPMediaItems in iPod Library

As users download new songs into their iPod Music library from the iTunes Store, I would like to programmatically list those songs in a table view. Is it possible to obtain the "Date Added" or "Purchase Date" from the MPMediaItemCollection? I see…
JeffB6688
  • 3,782
  • 5
  • 38
  • 58
4
votes
1 answer

BEGIN IMMEDIATE could unexpectedly not be stepped after 0: 8/attempt to write a readonly database

While using a UITableView to display MPMediaItems my log gets spammed with the following message: BEGIN IMMEDIATE could unexpectedly not be stepped after 0: 8/attempt to write a readonly database But I haven't any idea what this means. Can you give…
miho
  • 11,765
  • 7
  • 42
  • 85
3
votes
2 answers

Get date when MPMediaItem was added to iTunes library

Is it possible? I haven't found anything like this in MPMediaItemProperty... strings. Maybe private API?
HiveHicks
  • 2,294
  • 5
  • 28
  • 42
1 2
3
17 18