Presenting Metadata in the Info Panel (tvOS)

Add metadata information to the Info panel in Apple TV.


When you swipe down on the Siri Remote touchpad, AVPlayerViewController in tvOS presents an Info panel, revealing information and controls for the current presentation. The top section of the panel’s Info tab displays metadata describing the currently presented media.

Define Metadata Identifiers

The Info panel is automatically populated if the presented media contains supported metadata. However, there are cases where this metadata doesn’t exist, is incomplete, or can be determined only at runtime. To handle these scenarios, AVKit in tvOS adds an externalMetadata property to AVPlayerItem. You can use this property to set an array of AVMetadataItem objects defining your custom metadata.

AVFoundation defines a large number of metadata identifiers (see AVMetadataIdentifiers.h), but the Info panel currently supports only the five listed below.

Populate the Info Panel

AVMetadataItem is an immutable type, so to create your custom metadata, you use its mutable subclass, AVMutableMetadataItem. For a metadata item to be presented in the Info panel, you need to provide values for the item’s identifier, value, and extendedLanguageTag. For the extendedLanguageTag property, provide a valid BCP-47 string value such as en or zh-TW (or und if undetermined).

The following example shows how to create the player item’s externalMetadata used to populate the player’s Info panel:

func setupPlayback() {
    playerItem.externalMetadata = makeExternalMetadata()

func makeExternalMetadata() -> [AVMetadataItem] {
    var metadata = [AVMetadataItem]()

    // Build title item
    let titleItem = makeMetadataItem(AVMetadataCommonIdentifierTitle, value: "My Movie Title")

    // Build artwork item
    if let image = UIImage(named: "poster"), let pngData = UIImagePNGRepresentation(image) {
        let artworkItem = makeMetadataItem(AVMetadataCommonIdentifierArtwork, value: pngData)

    // Build description item
    let descItem = makeMetadataItem(AVMetadataCommonIdentifierDescription, value: "My Movie Description")

    // Build rating item
    let ratingItem = makeMetadataItem(AVMetadataIdentifieriTunesMetadataContentRating, value: "PG-13")

    // Build genre item
    let genreItem = makeMetadataItem(AVMetadataIdentifierQuickTimeMetadataGenre, value: "Comedy")
    return metadata

private func makeMetadataItem(_ identifier: String,
                       value: Any) -> AVMetadataItem {
    let item = AVMutableMetadataItem()
    item.identifier = identifier
    item.value = value as? NSCopying & NSObjectProtocol
    item.extendedLanguageTag = "und"
    return item.copy() as! AVMetadataItem

See Also

Info Panel Information

Presenting Navigation Markers (tvOS)

Present navigation markers in the Info panel to help users quickly navigate your content.