---
title: Presenting Navigation Markers
framework: avkit
role: article
role_heading: Article
path: avkit/presenting-navigation-markers
---

# Presenting Navigation Markers

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

## Overview

Overview 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.

Set the Navigation Markers In tvOS, a AVPlayerItem contains a navigationMarkerGroups property you use to supply chapter information. Set this property to an array of AVNavigationMarkersGroup objects to define the navigation markers for the current media. note: Although the player item defines the navigationMarkerGroups property as an array, the system only supports the first group in the array. An AVNavigationMarkersGroup contains one or more AVTimedMetadataGroup objects, each representing an individual marker presented in the player’s Info panel. Each AVTimedMetadataGroup stores a time range in the asset’s timeline to which this marker applies, an array of AVMetadataItem objects to define the marker’s title, and, optionally, its thumbnail artwork.

The following code shows how you can present a chapter list for your media: 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 }

## See Also

### tvOS playback and capture

- [Customizing the tvOS Playback Experience](avkit/customizing-the-tvos-playback-experience.md)
- [Working with Interstitial Content](avkit/working-with-interstitial-content.md)
- [Presenting Content Proposals in tvOS](avkit/presenting-content-proposals-in-tvos.md)
- [Working with Overlays and Parental Controls in tvOS](avkit/working-with-overlays-and-parental-controls-in-tvos.md)
- [Supporting Continuity Camera in your tvOS app](avkit/supporting-continuity-camera-in-your-tvos-app.md)
- [AVPlayerViewController](avkit/avplayerviewcontroller.md)
- [AVPlayerViewControllerDelegate](avkit/avplayerviewcontrollerdelegate.md)
- [AVInterstitialTimeRange](avkit/avinterstitialtimerange.md)
- [AVNavigationMarkersGroup](avkit/avnavigationmarkersgroup.md)
- [AVContentProposalViewController](avkit/avcontentproposalviewcontroller.md)
- [AVDisplayManager](avkit/avdisplaymanager.md)
- [AVContinuityDevicePickerViewController](avkit/avcontinuitydevicepickerviewcontroller.md)
- [AVContinuityDevicePickerViewControllerDelegate](avkit/avcontinuitydevicepickerviewcontrollerdelegate.md)
- [Third-party casting support](avkit/third-party-casting-support.md)
