<!--
{
  "documentType" : "article",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/media-playback",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Media playback"
}
-->

# Media playback

Manage the playback of media assets and interstitial content, independent of how you present that content in your interface.

## Discussion

You use a player to manage the playback and timing of a media asset, for example starting and stopping playback, and seeking to a particular time. A player manages the playback of a single media asset at a time. The framework also provides a queue player that queues media assets to play sequentially.

> Note:
> When you use AVFoundation, Apple may collect metrics to help improve the framework.

You create an instance of [`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem) to play a media asset. A player item manages the timing and presentation state of an asset played by the player. A player item also contains player item tracks that correspond to the tracks in the asset. You direct the output of a player to a specialized Core Animation layer, a player layer, or a synchronized layer.

> Important:
> You must call the <doc://com.apple.documentation/documentation/VideoToolbox/VTRegisterProfessionalVideoWorkflowVideoDecoders()> function if your app requires Afterburner accelerated playback and decoding of ProRes and ProRes RAW video files.

## Topics

### Essentials

[Configuring your app for media playback](/documentation/AVFoundation/configuring-your-app-for-media-playback)

Configure apps to enable standard media playback behavior.

### Playback control

[Observing playback state in SwiftUI](/documentation/AVFoundation/observing-playback-state-in-swiftui)

Keep your user interface in sync with state changes from playback objects.

[Controlling the transport behavior of a player](/documentation/AVFoundation/controlling-the-transport-behavior-of-a-player)

Play, pause, and seek through a media presentation.

[Creating a seamless multiview playback experience](/documentation/AVFoundation/creating-a-seamless-multiview-playback-experience)

Build advanced multiview playback experiences with the AVFoundation and AVRouting frameworks.

[`AVPlayer`](/documentation/AVFoundation/AVPlayer)

An object that provides the interface to control the player’s transport behavior.

[`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem)

An object that models the timing and presentation state of an asset during playback.

[`AVPlayerItemTrack`](/documentation/AVFoundation/AVPlayerItemTrack)

An object that represents the presentation state of an asset track during playback.

[`AVQueuePlayer`](/documentation/AVFoundation/AVQueuePlayer)

An object that plays a sequence of player items.

[`AVPlayerLooper`](/documentation/AVFoundation/AVPlayerLooper)

An object that loops media content using a queue player.

### SharePlay

  <doc://com.apple.documentation/documentation/visionOS/destination-video>

[Supporting coordinated media playback](/documentation/AVFoundation/supporting-coordinated-media-playback)

Create synchronized media experiences that enable users to watch and listen across devices.

[`AVPlaybackCoordinator`](/documentation/AVFoundation/AVPlaybackCoordinator)

An object that coordinates the playback of players in a connected group.

[`AVPlayerPlaybackCoordinator`](/documentation/AVFoundation/AVPlayerPlaybackCoordinator)

A playback coordinator subclass that coordinates the playback of player objects in a connected group.

[`AVDelegatingPlaybackCoordinator`](/documentation/AVFoundation/AVDelegatingPlaybackCoordinator)

A playback coordinator subclass that coordinates the playback of custom player objects in a connected group.

[`AVPlaybackCoordinationMedium`](/documentation/AVFoundation/AVPlaybackCoordinationMedium)

The AVPlaybackCoordinationMedium passes states and messages between its connected playback coordinators.

### Presentation

[Monitoring playback progress in your app](/documentation/AVFoundation/monitoring-playback-progress-in-your-app)

Observe the playback of a media asset to update your app’s user-interface state.

[Using HEVC video with alpha](/documentation/AVFoundation/using-hevc-video-with-alpha)

Play, write, and export HEVC video with an alpha channel to add overlay effects to your video processing.

[`AVPlayerLayer`](/documentation/AVFoundation/AVPlayerLayer)

An object that presents the visual contents of a player object.

[`AVSynchronizedLayer`](/documentation/AVFoundation/AVSynchronizedLayer)

A Core Animation layer that derives its timing from a player item so that you can synchronize layer animations with media playback.

### Media selection

[Selecting subtitles and alternative audio tracks](/documentation/AVFoundation/selecting-subtitles-and-alternative-audio-tracks)

Extend your app’s appeal to users by adding subtitles and alternative audio tracks in their native language.

[`AVMediaSelection`](/documentation/AVFoundation/AVMediaSelection)

An object that represents a complete rendition of media selection options on an asset.

[`AVMediaSelectionGroup`](/documentation/AVFoundation/AVMediaSelectionGroup)

An object that represents a collection of mutually exclusive options for the presentation of media within an asset.

[`AVMediaSelectionOption`](/documentation/AVFoundation/AVMediaSelectionOption)

An object that represents a specific option for the presentation of media within a group of options.

[`AVMutableMediaSelection`](/documentation/AVFoundation/AVMutableMediaSelection)

A mutable object that represents a complete rendition of media selection options on an asset.

[`AVPlayerMediaSelectionCriteria`](/documentation/AVFoundation/AVPlayerMediaSelectionCriteria)

An object that specifies the preferred languages and media characteristics for a player.

[`AVCustomMediaSelectionScheme`](/documentation/AVFoundation/AVCustomMediaSelectionScheme)

For content that has been authored with the express intent of offering an alternative selection interface for AVMediaSelectionOptions, AVCustomMediaSelectionScheme provides a collection of custom settings for controlling the presentation of the media.

[`AVMediaPresentationSelector`](/documentation/AVFoundation/AVMediaPresentationSelector)

For content that has been authored with the express intent of offering an alternative selection interface for AVMediaSelectionOptions, AVMediaPresentationSelector represents a collection of mutually exclusive settings.

[`AVMediaPresentationSetting`](/documentation/AVFoundation/AVMediaPresentationSetting)

For content that has been authored with the express intent of offering an alternative selection interface for AVMediaSelectionOptions, AVMediaPresentationSetting represents a selectable setting for controlling the presentation of the media.

### Interstitials

[Providing an integrated view of your timeline when playing HLS interstitials](/documentation/AVFoundation/providing-an-integrated-view-of-your-timeline-when-playing-hls-interstitials)

Go beyond simple ad insertion with point and fill occupancy HLS interstitials.

[`AVPlayerInterstitialEvent`](/documentation/AVFoundation/AVPlayerInterstitialEvent)

An object that provides instructions for how a player presents interstitial content.

[`AVPlayerInterstitialEventController`](/documentation/AVFoundation/AVPlayerInterstitialEventController)

An object that schedules interstitial events for items played by the primary player.

[`AVPlayerInterstitialEventMonitor`](/documentation/AVFoundation/AVPlayerInterstitialEventMonitor)

An object that monitors the scheduling and progress of interstitial events.

[`AVPlayerInterstitialEventMonitorScheduleRequestCompletedNotification`](/documentation/AVFoundation/AVPlayerInterstitialEventMonitorScheduleRequestCompletedNotification)

A notification that is posted whenever a daterange-schedule request completes.

[`AVPlayerInterstitialEventMonitorScheduleRequestErrorKey`](/documentation/AVFoundation/AVPlayerInterstitialEventMonitorScheduleRequestErrorKey)

userInfo dictionary key for the AVPlayerInterstitialEventMonitorScheduleRequestCompletedNotification. Value is NSError. Absent if the request succeeded

[`AVPlayerInterstitialEventMonitorScheduleRequestIdentifierKey`](/documentation/AVFoundation/AVPlayerInterstitialEventMonitorScheduleRequestIdentifierKey)

userInfo dictionary key for the AVPlayerInterstitialEventMonitorScheduleRequestCompletedNotification. Value is NSString.

[`AVPlayerInterstitialEventMonitorScheduleRequestResponseKey`](/documentation/AVFoundation/AVPlayerInterstitialEventMonitorScheduleRequestResponseKey)

userInfo dictionary key for the AVPlayerInterstitialEventMonitorScheduleRequestCompletedNotification. Value is NSData. Absent if the request failed.

[`AVPlayerItemIntegratedTimeline`](/documentation/AVFoundation/AVPlayerItemIntegratedTimeline)

An object that models the timeline and playback sequence of a primary player item and scheduled interstitial events.

### Metrics

[`AVMetrics`](/documentation/AVFoundation/AVMetrics)

An asynchronous stream of metric information.

[`AVMergedMetrics`](/documentation/AVFoundation/AVMergedMetrics)

An asynchronous stream of metric information from different publishers.

[`AVVideoPerformanceMetrics`](/documentation/AVFoundation/AVVideoPerformanceMetrics)

An object that provides metrics related to video playback quality.

[`AVMetricEventStream`](/documentation/AVFoundation/AVMetricEventStream)

An object that allows clients to add publishers and then subscribe to specific metric event classes from those publishers.

[`AVMetricEventStreamPublisher`](/documentation/AVFoundation/AVMetricEventStreamPublisher)

A type for objects that publish metric events to the event stream.

[`AVMetricEventStreamSubscriber`](/documentation/AVFoundation/AVMetricEventStreamSubscriber)

A type for objects that receive metric events.

[`AVMetricEvent`](/documentation/AVFoundation/AVMetricEvent)

A base class that represents a metric event.

[`AVMetricErrorEvent`](/documentation/AVFoundation/AVMetricErrorEvent)

An object that represents a metric event when an error occurs.

[Metric event types](/documentation/AVFoundation/metric-event-types)

### Remote controls

[Supporting remote interactions in tvOS](/documentation/AVFoundation/supporting-remote-interactions-in-tvos)

Set up your app to support remote commands and events in a variety of scenarios by using the relevant approach.

### Timed metadata

[Presenting chapter markers](/documentation/AVFoundation/presenting-chapter-markers)

Add chapter markers to enable users to quickly navigate your content.

[`AVMetadataGroup`](/documentation/AVFoundation/AVMetadataGroup)

A collection of metadata items associated with a timeline segment.

[`AVTimedMetadataGroup`](/documentation/AVFoundation/AVTimedMetadataGroup)

A collection of metadata items that are valid for use during a specific time range.

[`AVMutableTimedMetadataGroup`](/documentation/AVFoundation/AVMutableTimedMetadataGroup)

A mutable collection of metadata items that are valid for use during a specific time range.

[`AVDateRangeMetadataGroup`](/documentation/AVFoundation/AVDateRangeMetadataGroup)

A collection of metadata items that are valid for use within a specific date range.

[`AVMutableDateRangeMetadataGroup`](/documentation/AVFoundation/AVMutableDateRangeMetadataGroup)

A mutable collection of metadata items that are valid for use within a specific range of dates.

[`AVPlayerItemMediaDataCollector`](/documentation/AVFoundation/AVPlayerItemMediaDataCollector)

The abstract base for media data collectors.

[`AVPlayerItemMetadataCollector`](/documentation/AVFoundation/AVPlayerItemMetadataCollector)

An object used to capture the date range metadata defined for an HTTP Live Streaming asset.

### Media output

[`AVPlayerVideoOutput`](/documentation/AVFoundation/AVPlayerVideoOutput)

An object that receives video data from a player object.

[`AVVideoOutputSpecification`](/documentation/AVFoundation/AVVideoOutputSpecification)

An object that specifies the pixel buffer attributes and tag collections handled by a player video output.

[`CMTagCollectionCreateWithVideoOutputPreset`](/documentation/AVFoundation/CMTagCollectionCreateWithVideoOutputPreset)

Creates a collection with the required tags to describe the specified video output requirements.

[`CMTagCollectionVideoOutputPreset`](/documentation/AVFoundation/CMTagCollectionVideoOutputPreset)

Constants that indicate the type of video content to output.

[`AVPlayerItemOutput`](/documentation/AVFoundation/AVPlayerItemOutput)

An abstract class that defines the common interface to output media data from a player item.

[`AVPlayerItemVideoOutput`](/documentation/AVFoundation/AVPlayerItemVideoOutput)

An object that outputs video frames from a player item.

[`AVPlayerItemLegibleOutput`](/documentation/AVFoundation/AVPlayerItemLegibleOutput)

An object that vends attributed strings for media with a legible characteristic.

[`AVPlayerItemRenderedLegibleOutput`](/documentation/AVFoundation/AVPlayerItemRenderedLegibleOutput)

A player item output that vends media with a legible characteristic as rendered pixel buffers.

[`AVRenderedCaptionImage`](/documentation/AVFoundation/AVRenderedCaptionImage)

An object that provides a rendered pixel buffer and its position in pixels.

[`AVPlayerItemMetadataOutput`](/documentation/AVFoundation/AVPlayerItemMetadataOutput)

An object that vends collections of metadata items that a player item’s tracks carry.

[`AVPlayerItemOutputPushDelegate`](/documentation/AVFoundation/AVPlayerItemOutputPushDelegate)

A protocol that defines the methods to implement to respond to changes in the media data sequence.

[`AVPlayerItemSampleBufferOutput`](/documentation/AVFoundation/AVPlayerItemSampleBufferOutput)

[`AVPlayerItemSampleBufferOutput`](/documentation/AVFoundation/AVPlayerItemSampleBufferOutput) delivers `CMSampleBuffers` for [`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem) playback.

[`AVPlayerItemSampleBufferOutputConfiguration`](/documentation/AVFoundation/AVPlayerItemSampleBufferOutputConfiguration)

Configuration options specified when creating an [`AVPlayerItemSampleBufferOutput`](/documentation/AVFoundation/AVPlayerItemSampleBufferOutput).

[`AVPlayerItemSampleBufferOutputAudioConfiguration`](/documentation/AVFoundation/AVPlayerItemSampleBufferOutputAudioConfiguration)

Audio-specific configuration options specified when creating an [`AVPlayerItemSampleBufferOutput`](/documentation/AVFoundation/AVPlayerItemSampleBufferOutput).

[`AVPlayerItemSampleBufferOutputDelegate`](/documentation/AVFoundation/AVPlayerItemSampleBufferOutputDelegate)

Defines common delegate methods for objects participating in sample buffer output.

### Utilities

[`AVAssetPlaybackAssistant`](/documentation/AVFoundation/AVAssetPlaybackAssistant)

An object that provides playback information for an asset.

[`AVAssetPlaybackConfigurationOption`](/documentation/AVFoundation/AVAssetPlaybackConfigurationOption)

A structure that defines playback configuration options for an asset.



---

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)