Media Assets, Playback, and Editing

Access and inspect media assets; queue media for playback and customize playback behavior; edit and combine assets; import and export raw media streams.

Topics

First Steps

Guidelines for Apple TV 4K Development

Follow these guidelines when developing for Apple TV 4K.

Creating a Basic Video Player (iOS and tvOS)

Create a simple video playback app with built-in controls.

Creating a Basic Video Player (macOS)

Create a simple video playback app with built-in controls.

Media Assets

About the Asset Model

Understand how assets are used as the building blocks for media players.

AVAsset

The abstract class used to model timed audiovisual media such as videos and sounds.

AVAssetTrack

An object that provides the track-level inspection interface for an asset’s media tracks.

Asset Manipulation

Retrieve assets for playback or to gather information about an asset.

Asset File Import and Export

Import and export media samples to and from the file system.

Media Playback

Responding to Playback State Changes

Respond to changes in a player's playback state.

Observing the Playback Time

Observe the playback time for an asset in order to update the player's state.

Seeking Through Media

Seek or scrub across a media item to quickly access a specific time point.

Asset Playback

Play audio and video assets modeled by a player item.

Sample Buffer Playback

Play audio and video sample buffers using a custom player.

QuickTime and ISO-Related Media

Create, play, and modify QuickTime and ISO-related media assets.

Metadata Manipulation

Finding Metadata Values

Retrieve and filter all of the metadata associated with an asset.

JavaScript Object Notation (JSON) Chapter Format for HTTP Live Streaming

Understand the JSON chapter formatting required for HTTP Live Streaming.

AVMetadataItem

A metadata item associated with an audiovisual asset or one of its tracks.

AVMetadataGroup

A collection of metadata items associated with a timeline segment.

AVMetadataItemFilter

An object that filters selected information from a metadata item.

AVMetadataItemValueRequest

An object used to respond to a request to load the value of a metadata item.

AVMutableMetadataItem

A mutable metadata item associated with an audiovisual asset or with one of its tracks.

AVDateRangeMetadataGroup

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

AVMutableDateRangeMetadataGroup

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

AVTimedMetadataGroup

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

AVMutableTimedMetadataGroup

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

AVMetadataFormat

A value that defines a metadata format.

Media Item Transfer

AVPlayerItemOutput

The abstract class that defines the common interface for moving samples from an asset to a player.

AVPlayerItemOutputPushDelegate

Methods you can implement to respond to changes in the media data sequence.

AVPlayerItemLegibleOutput

An object that can vend media with a legible characteristic as an attributed string.

AVPlayerItemMetadataOutput

An object used to vend collections of metadata items carried in metadata tracks.

AVPlayerItemVideoOutput

An object that coordinates the output of content associated with a Core Video pixel buffer.

AVPlayerItemMediaDataCollector

The abstract base for media data collectors.

HTTP Live Streaming

About the Common Media Application Format with HTTP Live Streaming

Understand the Common Media Application Format as it applies to HTTP Live Streaming

Using AVFoundation to Play and Persist HTTP Live Streams

Play HTTP Live Streams and preserve streams on disk for offline play back.

Sample Buffer Manipulation

AVSampleBufferRequest

An object that describes a sample buffer creation request.

AVSampleCursor

An object that provides information about the current media sample at its current position.

AVSampleBufferGenerator

An object used to create sample buffer opaque objects.

AVQueuedSampleBufferRendering

Methods you can implement to enqueue sample buffers for presentation.

Media Composition and Editing

Media Composition

Combine, edit, and remix audio and video tracks from multiple sources in a single composition.

Text Formatting

AVTextStyleRule

An object that represents text styling rules applied to text in a media item.

Media Selection

Adding Subtitles and Alternative Audio Tracks

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

AVMediaSelection

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

AVMediaSelectionGroup

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

AVMediaSelectionOption

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

AVMutableMediaSelection

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

Content Key Decryption

AVContentKeyRequest

An object that encapsulates information about a content decryption key request issued from a content key session object.

AVContentKeyResponse

An object that encapsulates information about a response to a content decryption key request.

AVContentKeySession

An object used to create and track decryption keys for media data.

AVPersistableContentKeyRequest

An object that encapsulates information about a persistable content decryption key request issued from a content key session.

Supporting Types

Video Settings Dictionaries

Define output image and video formats by using the key and value constants.

Video Settings

Dictionary keys for configuring video compression and compression settings for video assets.

AVFileType

A uniform type identifier for various file formats.

AVMediaType

An identifier for various media types.

AVMediaCharacteristic

The options for specifying media type characteristics.

See Also

Playback and Editing

AirPlay 2

With AirPlay 2, you can wirelessly send your content from any Apple device to a device enabled with AirPlay.