music¶
Playing music¶
Sets a music player’s playback queue using a media item collection. |
|
Sets a music player's playback queue using with media items identified by the store identifiers. |
|
Initiates playback of the current item. |
|
Ends playback of the current item. |
|
Restarts playback at the beginning of the currently playing media item. |
|
Starts playback of the next media item in the playback queue; or, the music player is not playing, designates the next media item as the next to be played. |
|
Starts playback of the previous media item in the playback queue; or, the music player is not playing, designates the previous media item as the next to be played. |
|
Sets the shuffle mode of the music player. |
|
Sets the repeat mode of the music player. |
|
The current playback state of the music player. |
Now playing item¶
The currently-playing media item, or the media item, within a queue, that you have designated to begin playback with. |
|
The index of the now playing item in the current playback queue. |
Picking music¶
Picks music with a UI. |
Classes¶
A collection of properties that represents a single item contained in the media library. |
|
The primary performing artist for an album as a whole. |
|
The persistent identifier for the primary performing artist for an album as a whole. |
|
The persistent identifier for an album. |
|
The title of an album, such as “Live On Mars”, as opposed to the title of an individual song on the album, such as “Crater Dance (radio edit)”. |
|
The number of tracks in the album that contains the media item. |
|
The performing artist(s) for a media item—which may vary from the primary artist for the album that a media item belongs to. |
|
The persistent identifier for an artist. |
|
The artwork image for the media item. |
|
The number of musical beats per minute for the media item. |
|
The user’s place in the media item the most recent time it was played. |
|
A Boolean value indicating whether the media item is an iCloud Music Library item. |
|
Textual information about the media item. |
|
A Boolean value indicating whether the media item is part of a compilation. |
|
The musical composer for the media item. |
|
The persistent identifier for a composer. |
|
The date the item was added to the library. |
|
The number of discs in the album that contains the media item. |
|
The disc number of the media item, for a media item that is part of a multi-disc album. |
|
A Boolean value that indicates whether the item has explicit (adult) lyrics or language. |
|
The musical or film genre of the media item. |
|
The persistent identifier for a genre. |
|
The date a media item was last played. |
|
The lyrics for the media item. |
|
The persistent identifier for the media item. |
|
The number of times the user has played the media item. |
|
The playback duration of the media item. |
|
The non-library identifier for a media item. |
|
The persistent identifier for an audio podcast. |
|
The title of a podcast, such as “This Martian Drudgery”, as opposed to the title of an individual episode of a podcast such as “Episode 12: Another Cold Day At The Pole”. |
|
A Boolean indicating whether the media item has a protected asset. |
|
The user-specified rating of the object in the range [0...5], where a value of 5 indicates the most favorable rating. |
|
The date on which the media item was first publicly released. |
|
The number of times the user has skipped playing the item. |
|
The title (or name) of the media item. |
|
Grouping information for the media item. |
|
A query that specifies a set of media items from the device’s media library by way of a filter and a grouping type. |
|
An array of media items that match the media query’s predicate. |
|
Creates a media query that matches music items and that groups and sorts collections by album name. |
|
Creates a media query that matches music items and that groups and sorts collections by artist name. |
|
Creates a media query that matches music items and that groups and sorts collections by song name. |
|
Creates a media query that matches the entire library and that groups and sorts collections by playlist name. |
|
Creates a media query that matches podcast items and that groups and sorts collections by podcast name. |
|
Creates a media query that matches audio book items and that groups and sorts collections by audio book name. |
|
Creates a media query that matches compilation items and that groups and sorts collections by album name. |
|
Creates a media query that matches all media items and that groups and sorts collections by composer name. |
|
Creates a media query that matches all media items and that groups and sorts collections by genre name. |
Constants¶
Repeat mode¶
The user’s preferred repeat mode. |
|
The music player will not repeat the current song or playlist. |
|
The music player will repeat the current song. |
|
The music player will repeat the current playlist. |
|
The user’s preferred shuffle mode. |
|
The playlist is not shuffled. |
|
The playlist is shuffled by song. |
|
The playlist is shuffled by album. |
|
The music player is stopped. |
|
The music player is playing. |
|
The music player is paused. |
|
The music player has been interrupted, such as by an incoming phone call. |
|
The music player is seeking forward. |
|
The music player is seeking backward. |
Objective-C classes¶
The 'MPMusicPlayerController' class from the 'MediaPlayer' framework. |
|
The 'MPMediaItem' class from the 'MediaPlayer' framework. |
|
The 'MPMediaItemCollection' class from the 'MediaPlayer' framework. |
|
The 'MPMusicMPMediaQueryPlayerController' class from the 'MediaPlayer' framework. |