Home

AVPlayer

AVPlayer is a component of Apple's AVFoundation framework that provides playback of time-based audiovisual media on Apple platforms. It coordinates playback by managing AVPlayerItem instances, which wrap AVAsset resources such as local files or network streams. AVPlayer itself does not render video; developers attach it to a rendering layer or controller, such as AVPlayerLayer or AVPlayerViewController, to display video content.

The player supports a range of resource types, including local files, HTTP progressive streams, and adaptive

Playback is controlled through methods and properties such as play, pause, seek(to:), and the time-based rate

In practical use, AVPlayer is integrated with user interfaces through AVPlayerLayer for custom views or AVPlayerViewController

formats
such
as
HLS.
It
can
handle
multiple
tracks
within
an
asset,
including
video,
audio,
and
subtitles,
and
supports
features
for
external
playback
via
AirPlay
and
picture-in-picture
on
supported
devices.
AVPlayer
is
designed
to
work
with
both
live
streams
and
on-demand
content,
automatically
adapting
to
network
conditions
when
using
adaptive
streaming.
property
that
adjusts
playback
speed.
Time
and
status
can
be
observed
via
key-value
observing
on
properties
like
currentItem,
timeControlStatus,
and
currentTime,
and
developers
typically
respond
to
notifications
such
as
AVPlayerItemDidPlayToEndTime.
AVPlayer
items
can
be
observed
for
status
changes,
loaded
time
ranges,
and
playback
progress.
for
a
ready-made
playback
interface.
It
is
widely
used
in
video
and
streaming
applications
on
iOS,
macOS,
and
tvOS,
often
in
conjunction
with
AVAsset/AVURLAsset
for
resource
creation
and
with
AVPlayerItem
for
lifecycle
and
playback
control.