Media playback
Manage the playback of media assets and interstitial content, independent of how you present that content in your interface.
Overview
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.
You create an instance of 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.
Topics
Essentials
Playback control
Observing playback state in SwiftUIControlling the transport behavior of a playerCreating a seamless multiview playback experienceAVPlayerAVPlayerItemAVPlayerItemTrackAVQueuePlayerAVPlayerLooper
SharePlay
Destination VideoSupporting coordinated media playbackAVPlaybackCoordinatorAVPlayerPlaybackCoordinatorAVDelegatingPlaybackCoordinatorAVPlaybackCoordinationMedium
Presentation
Media selection
Selecting subtitles and alternative audio tracksAVMediaSelectionAVMediaSelectionGroupAVMediaSelectionOptionAVMutableMediaSelectionAVPlayerMediaSelectionCriteriaAVCustomMediaSelectionSchemeAVMediaPresentationSelectorAVMediaPresentationSetting
Interstitials
Providing an integrated view of your timeline when playing HLS interstitialsAVPlayerInterstitialEventAVPlayerInterstitialEventControllerAVPlayerInterstitialEventMonitorAVPlayerInterstitialEventMonitorScheduleRequestErrorKeyAVPlayerInterstitialEventMonitorScheduleRequestIdentifierKeyAVPlayerInterstitialEventMonitorScheduleRequestResponseKeyAVPlayerItemIntegratedTimeline
Metrics
AVMetricsAVMergedMetricsAVVideoPerformanceMetricsAVMetricEventStreamPublisherAVMetricEventAVMetricErrorEventMetric event types
Remote controls
Timed metadata
Presenting chapter markersAVMetadataGroupAVTimedMetadataGroupAVMutableTimedMetadataGroupAVDateRangeMetadataGroupAVMutableDateRangeMetadataGroupAVPlayerItemMediaDataCollectorAVPlayerItemMetadataCollector
Media output
AVPlayerVideoOutputAVVideoOutputSpecificationAVPlayerItemOutputAVPlayerItemVideoOutputAVPlayerItemLegibleOutputAVPlayerItemRenderedLegibleOutputAVRenderedCaptionImageAVPlayerItemMetadataOutputAVPlayerItemOutputPushDelegateAVPlayerItemSampleBufferOutputAVPlayerItemSampleBufferOutputConfigurationAVPlayerItemSampleBufferOutputAudioConfiguration