<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPMediaItem",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMediaItem"
  },
  "title" : "MPMediaItem"
}
-->

# MPMediaItem

A collection of properties that represents a single item in the media library.

```
class MPMediaItem
```

## Overview

A media item has an overall unique identifier, accessed using the [`MPMediaItemPropertyPersistentID`](/documentation/MediaPlayer/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 [`value(forProperty:)`](/documentation/MediaPlayer/MPMediaEntity/value(forProperty:)) method along with the property keys described in this document. You can also access metadata in a batch fashion using the [`enumerateValues(forProperties:using:)`](/documentation/MediaPlayer/MPMediaEntity/enumerateValues(forProperties:using:)) method. Anytime the app accesses more than one property, enumerating over a set of property keys is more efficient than fetching each individual property. [`MPMediaEntity`](/documentation/MediaPlayer/MPMediaEntity) defines both of these methods, the abstract superclass of [`MPMediaItemCollection`](/documentation/MediaPlayer/MPMediaItemCollection), and described in `MPMediaEntity`.

You use attributes of media items to build media queries for searching the Media library. [`MPMediaType`](/documentation/MediaPlayer/MPMediaType), [General media item property keys](/documentation/MediaPlayer/general-media-item-property-keys), and `Podcast Item Property Keys` describe these attributes. In addition, [Media entity property keys](/documentation/MediaPlayer/media-entity-property-keys) describes the [`MPMediaEntityPropertyPersistentID`](/documentation/MediaPlayer/MPMediaEntityPropertyPersistentID) property, and [`MPMediaQuery`](/documentation/MediaPlayer/MPMediaQuery) describes media queries.

## Topics

### Media item properties

[`albumArtist`](/documentation/MediaPlayer/MPMediaItem/albumArtist)

The primary performing artist for an album.

[`albumArtistPersistentID`](/documentation/MediaPlayer/MPMediaItem/albumArtistPersistentID)

The persistent identifier for the primary performing artist for an album.

[`albumPersistentID`](/documentation/MediaPlayer/MPMediaItem/albumPersistentID)

The persistent identifier for an album.

[`albumTitle`](/documentation/MediaPlayer/MPMediaItem/albumTitle)

The title of an album, such as *Live on Mars*, rather than the title of an individual song on the album, such as “Crater Dance.”

[`albumTrackCount`](/documentation/MediaPlayer/MPMediaItem/albumTrackCount)

The number of tracks for the album that contains the media item.

[`albumTrackNumber`](/documentation/MediaPlayer/MPMediaItem/albumTrackNumber)

The track number of the media item, for a media item that’s part of an album.

[`artist`](/documentation/MediaPlayer/MPMediaItem/artist)

The performing artists for a media item, which may vary from the primary artist for the album that a media item belongs to.

[`artistPersistentID`](/documentation/MediaPlayer/MPMediaItem/artistPersistentID)

The persistent identifier for an artist.

[`artwork`](/documentation/MediaPlayer/MPMediaItem/artwork)

The artwork image for the media item.

[`assetURL`](/documentation/MediaPlayer/MPMediaItem/assetURL)

The URL that points to the media item.

[`beatsPerMinute`](/documentation/MediaPlayer/MPMediaItem/beatsPerMinute)

The number of musical beats per minute for the media item.

[`bookmarkTime`](/documentation/MediaPlayer/MPMediaItem/bookmarkTime)

The time of the user’s most recent interaction with the bookmark in the media item.

[`cloudItem`](/documentation/MediaPlayer/MPMediaItem/isCloudItem)

A Boolean value that indicates whether the media item is an iCloud Music Library item.

[`comments`](/documentation/MediaPlayer/MPMediaItem/comments)

Textual information about the media item.

[`compilation`](/documentation/MediaPlayer/MPMediaItem/isCompilation)

A Boolean value that indicates whether the media item is part of a compilation.

[`preorder`](/documentation/MediaPlayer/MPMediaItem/isPreorder)

A Boolean value that indicates whether the media item is a preorder.

[`composer`](/documentation/MediaPlayer/MPMediaItem/composer)

The musical composer for the media item.

[`composerPersistentID`](/documentation/MediaPlayer/MPMediaItem/composerPersistentID)

The persistent identifier for a composer.

[`dateAdded`](/documentation/MediaPlayer/MPMediaItem/dateAdded)

The date the user adds the media item to the library.

[`discCount`](/documentation/MediaPlayer/MPMediaItem/discCount)

The number of discs for the album that contains the media item.

[`discNumber`](/documentation/MediaPlayer/MPMediaItem/discNumber)

The disc number of the media item, for a media item that’s part of a multidisc album.

[`explicitItem`](/documentation/MediaPlayer/MPMediaItem/isExplicitItem)

A Boolean value that indicates whether the media item has explicit (adult) lyrics or language.

[`genre`](/documentation/MediaPlayer/MPMediaItem/genre)

The music or film genre of the media item.

[`genrePersistentID`](/documentation/MediaPlayer/MPMediaItem/genrePersistentID)

The persistent identifier for a genre.

[`lastPlayedDate`](/documentation/MediaPlayer/MPMediaItem/lastPlayedDate)

The most recent play date of the media item.

[`lyrics`](/documentation/MediaPlayer/MPMediaItem/lyrics)

The lyrics for the media item.

[`mediaType`](/documentation/MediaPlayer/MPMediaItem/mediaType)

The media type of the media item.

[`persistentID`](/documentation/MediaPlayer/MPMediaItem/persistentID)

The persistent identifier for the media item.

[`playCount`](/documentation/MediaPlayer/MPMediaItem/playCount)

The number of times the user plays the media item.

[`playbackDuration`](/documentation/MediaPlayer/MPMediaItem/playbackDuration)

The playback duration of the media item.

[`playbackStoreID`](/documentation/MediaPlayer/MPMediaItem/playbackStoreID)

The ID of a media item from the Apple Music catalog.

[`podcastPersistentID`](/documentation/MediaPlayer/MPMediaItem/podcastPersistentID)

The persistent identifier for an audio podcast.

[`podcastTitle`](/documentation/MediaPlayer/MPMediaItem/podcastTitle)

The title of a podcast, such as *This Martian Drudgery*, rather than the title of an individual episode of a podcast, such as “Episode 12: Another Cold Day at the Pole.”

[`protectedAsset`](/documentation/MediaPlayer/MPMediaItem/hasProtectedAsset)

A Boolean value that indicates whether the media item has a protected asset.

[`rating`](/documentation/MediaPlayer/MPMediaItem/rating)

The user-specified rating of the media item.

[`releaseDate`](/documentation/MediaPlayer/MPMediaItem/releaseDate)

The date of the media item’s first public release.

[`skipCount`](/documentation/MediaPlayer/MPMediaItem/skipCount)

The number of times the user skips playing the media item.

[`title`](/documentation/MediaPlayer/MPMediaItem/title)

The title or name of the media item.

[`userGrouping`](/documentation/MediaPlayer/MPMediaItem/userGrouping)

Grouping information for the media item.

### Obtaining group properties

[`+  persistentIDPropertyForGroupingType:`](/documentation/MediaPlayer/MPMediaItem/persistentIDProperty(forGroupingType:))

Obtains the persistent identifier key for a specified grouping type.

[`+  titlePropertyForGroupingType:`](/documentation/MediaPlayer/MPMediaItem/titleProperty(forGroupingType:))

Obtains the title key for a specified grouping type.

### Media item types and keys

[`MPMediaType`](/documentation/MediaPlayer/MPMediaType)

The properties for defining the type for a media item.

[General media item property keys](/documentation/MediaPlayer/general-media-item-property-keys)

System-defined properties for obtaining the metadata for a media item.

[User-defined property keys](/documentation/MediaPlayer/user-defined-property-keys)

Properties for obtaining user-defined metadata for a media item.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`MPMediaEntity`](/documentation/MediaPlayer/MPMediaEntity)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)