Protocol

MPPlayableContentDataSource

The data source providing media metadata to external media players so they can build user interfaces displaying your app’s content.

Overview

To support external media players, create a class that conforms to the MPPlayableContentDataSource protocol. When your app launches, create an instance of this class and assign it to the shared dataSource property. This data source provides media metadata to external media players so that they can build user interfaces displaying your app’s content. It is best to set this data source as early as possible in your app’s lifecycle, as iOS may start asking for content right away.

Topics

Retrieving a Media Item

func contentItem(at: IndexPath)

Retrieves the media item at the specified index.

Required.

func contentItem(forIdentifier: String, completionHandler: (MPContentItem?, Error?) -> Void)

Retrieves the content item associated with the provided identifier.

Working with Child Nodes

func childItemsDisplayPlaybackProgress(at: IndexPath)

Returns a Boolean value indicating whether the provided content supports playback progress.

func numberOfChildItems(at: IndexPath)

Provides the number of child nodes for the indicated node.

Required.

Relationships

Inherits From

See Also

Providing Playable Content

var dataSource: MPPlayableContentDataSource?

The data source provided by the app.