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.

class AVAsset

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

class 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 or video assets modeled by a player item.

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.

class AVMetadataItem

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

class AVMetadataGroup

A collection of metadata items associated with a timeline segment.

class AVMetadataItemFilter

An object that filters selected information from a metadata item.

class AVMetadataItemValueRequest

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

class AVMutableMetadataItem

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

class AVDateRangeMetadataGroup

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

class AVMutableDateRangeMetadataGroup

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

class AVTimedMetadataGroup

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

class AVMutableTimedMetadataGroup

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

struct AVMetadataFormat

A value that defines a metadata format.

Media Item Transfer

class AVPlayerItemOutput

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

protocol AVPlayerItemOutputPushDelegate

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

class AVPlayerItemLegibleOutput

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

class AVPlayerItemMetadataOutput

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

class AVPlayerItemVideoOutput

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

class 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

class AVSampleBufferRequest

An object that describes a sample buffer creation request.

class AVSampleCursor

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

class AVSampleBufferGenerator

An object used to create sample buffer opaque objects.

protocol 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

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

class AVMediaSelection

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

class AVMediaSelectionGroup

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

class AVMediaSelectionOption

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

class AVMutableMediaSelection

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

Content Key Decryption

class AVContentKeyRequest

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

class AVContentKeyResponse

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

class AVContentKeySession

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

class AVPersistableContentKeyRequest

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

Errors

struct AVError

The error codes for the AVError domain.

Supporting Types

Video Settings Dictionaries

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

Video Settings

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

struct AVFileType

A uniform type identifier for various file formats.

struct AVMediaType

An identifier for various media types.

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