<!--
{
  "documentType" : "article",
  "framework" : "AVKit",
  "identifier" : "/documentation/AVKit/presenting-navigation-markers",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Presenting navigation markers"
}
-->

# Presenting navigation markers

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

## Discussion

To help users navigate your content, the Chapters panel presents navigation markers that represent points of interest within the media’s timeline. Users can skip to desired content by selecting a marker with the Siri Remote.

![An image of Apple TV Chapters panel that shows a horizontal list of chapter markers.](images/com.apple.avkit/media-3905733@2x.png)

## Set the navigation markers

In tvOS, a <doc://com.apple.documentation/documentation/AVFoundation/AVPlayerItem> contains a <doc://com.apple.documentation/documentation/AVFoundation/AVPlayerItem/navigationMarkerGroups> property you use to supply chapter information. Set this property to an array of [`AVNavigationMarkersGroup`](/documentation/AVKit/AVNavigationMarkersGroup) objects to define the navigation markers for the current media.

> Note:
> Although the player item defines the <doc://com.apple.documentation/documentation/AVFoundation/AVPlayerItem/navigationMarkerGroups> property as an array, the system only supports the first group in the array.

An [`AVNavigationMarkersGroup`](/documentation/AVKit/AVNavigationMarkersGroup) contains one or more <doc://com.apple.documentation/documentation/AVFoundation/AVTimedMetadataGroup> objects, each representing an individual marker presented in the player’s Info panel. Each <doc://com.apple.documentation/documentation/AVFoundation/AVTimedMetadataGroup> stores a time range in the asset’s timeline to which this marker applies, an array of <doc://com.apple.documentation/documentation/AVFoundation/AVMetadataItem> objects to define the marker’s title, and, optionally, its thumbnail artwork.

![A top-down component diagram showing a player item containing navigation markers groups at the top. The middle component shows a navigation markers group containing timed metadata groups. The bottom component shows a timed metadata group containing multiple metadata items.](images/com.apple.avkit/media-3905734@2x.png)

The following code shows how you can present a chapter list for your media:

```swift
struct Chapter {
    let title: String
    let imageName: String
    let startTime: TimeInterval
    let endTime: TimeInterval
}

...

func setupPlayback() {
    ...
    playerItem.navigationMarkerGroups = makeNavigationMarkerGroups()
    ...
}

private func makeNavigationMarkerGroups() -> [AVNavigationMarkersGroup] {
    
    let chapters = [
        Chapter(title: "Chapter 1", imageName: "chapter1", startTime: 0.0, endTime: 60.0),
        Chapter(title: "Chapter 2", imageName: "chapter2", startTime: 60.0, endTime: 120.0),
        Chapter(title: "Chapter 3", imageName: "chapter3", startTime: 120.0, endTime: 180.0),
        Chapter(title: "Chapter 4", imageName: "chapter4", startTime: 180.0, endTime: 240.0)
    ]
    
    var metadataGroups = [AVTimedMetadataGroup]()
    
    // Iterate over the defined chapters and build a timed metadata group object for each.
    chapters.forEach { chapter in
        metadataGroups.append(makeTimedMetadataGroup(for: chapter))
    }
    
    return [AVNavigationMarkersGroup(title: nil, 
                                     timedNavigationMarkers: metadataGroups)]
}

private func makeTimedMetadataGroup(for chapter: Chapter) -> AVTimedMetadataGroup {
    var metadata = [AVMetadataItem]()
    
    // Create a metadata item that contains the chapter title.
    let titleItem = makeMetadataItem(.commonIdentifierTitle, value: chapter.title)
    metadata.append(titleItem)
    if let image = UIImage(named: chapter.imageName), 
       let pngData = image.pngData() {
        // Create a metadata item that contains the chapter thumbnail.
        let imageItem = makeMetadataItem(.commonIdentifierArtwork, value: pngData)
        metadata.append(imageItem)
    }
    
    // Create a time range for the metadata group.
    let timescale: Int32 = 600
    let startTime = CMTime(seconds: chapter.startTime, preferredTimescale: timescale)
    let endTime = CMTime(seconds: chapter.endTime, preferredTimescale: timescale)
    let timeRange = CMTimeRangeFromTimeToTime(start: startTime, end: endTime)
    
    return AVTimedMetadataGroup(items: metadata, timeRange: timeRange)
}

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

---

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)