AVPlayerItem Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in OS X v10.7 and later.
Companion guide
Declared in
AVPlayerItem.h
AVPlayerItemProtectedContentAdditions.h
Related sample code

Overview

An AVPlayerItem represents the presentation state of an asset that’s played by an AVPlayer object, and lets you observe that state.

A object carries a reference to an AVAsset object and presentation settings for that asset, including track enabled state. If you need to inspect the media assets themselves, you should message the AVAsset object itself.

You can initialize a player item using an URL (playerItemWithURL: and initWithURL:); the resource types referenced by the URL may include, but aren't necessarily limited to, those with the following corresponding UTIs:

If you want to play an asset more than once within a sequence of items, you must create independent instances of AVPlayerItem for each placement in the player's queue.

Tasks

Creating a Player Item

Getting Information About an Item

Moving the Playhead

Information About Playback

Timing Information

Settings

Accessing Logs

Managing Authorization

Selecting Media Options

Managing the Item’s Outputs

Properties

applicationAuthorizedForPlayback

Indicates whether the application can be used to play the content. (read-only)

@property (nonatomic, readonly, getter=isApplicationAuthorizedForPlayback) BOOL applicationAuthorizedForPlayback
Discussion

This property reports whether or not the calling application is authorized to play the content associated with the item.

Application authorization is independent of content authorization (see contentAuthorizedForPlayback) and that both must be granted in order for an application to be allowed to play protected content. Also, unlike content authorization, application authorization is not dependent on user credentials (that is, if applicationAuthorizedForPlayback is NO, there are no means to obtain authorization).

This property is not key-value observable.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItemProtectedContentAdditions.h

asset

The underlying asset provided during initialization. (read-only)

@property(nonatomic, readonly) AVAsset *asset
Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

audioMix

The audio mix parameters to be applied during playback.

@property(nonatomic, copy) AVAudioMix *audioMix
Availability
  • Available in OS X v10.7 and later.
Related Sample Code
Declared In
AVPlayerItem.h

authorizationRequiredForPlayback

Indicates whether or not authorization is required to play the content. (read-only)

@property (nonatomic, readonly, getter=isAuthorizationRequiredForPlayback) BOOL authorizationRequiredForPlayback
Discussion

This property reports whether authorization is required for the item’s content to be played. If it does not require authorization, then none of the other authorization-related methods or properties apply (though they will return sensible values where possible).

This property is not key-value observable.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItemProtectedContentAdditions.h

canPlayFastForward

A Boolean value indicating whether the item can be played at rates greater than 1.0. (read-only)

@property(nonatomic, readonly) BOOL canPlayFastForward
Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

canPlayFastReverse

A Boolean value indicating whether the item can be played at rates less than –1.0. (read-only)

@property(nonatomic, readonly) BOOL canPlayFastReverse
Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

canPlayReverse

A Boolean value indicating whether the item can be played with a rate of -1.0. (read-only)

@property (nonatomic, readonly) BOOL canPlayReverse
Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

canPlaySlowForward

A Boolean value indicating whether the item can be played at a rate between 0.0 and 1.0. (read-only)

@property (nonatomic, readonly) BOOL canPlaySlowForward
Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

canPlaySlowReverse

A Boolean value indicating whether the item can be played at a rate between -1.0 and 0.0. (read-only)

@property (nonatomic, readonly) BOOL canPlaySlowReverse
Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

canStepBackward

A Boolean value indicating whether the item supports stepping backward. (read-only)

@property (nonatomic, readonly) BOOL canStepBackward
Discussion

Once the item becomes ready to play, the value of this property does not change. This behavior applies even when boundary conditions, such as when the item’s current time is kCMTimeZero, have been reached.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

canStepForward

A Boolean value indicating whether the item supports stepping forward. (read-only)

@property (nonatomic, readonly) BOOL canStepForward
Discussion

Once the item becomes ready to play, the value of this property does not change. This behavior applies even when boundary conditions, such as when the item’s current time is equal to its end time, have been reached.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

contentAuthorizationRequestStatus

Indicates the status of the most recent call to requestContentAuthorizationAsynchronouslyWithTimeoutInterval:completionHandler:. (read-only)

@property (nonatomic, readonly) AVContentAuthorizationStatus contentAuthorizationRequestStatus
Discussion

This property reports the authorization status as determined by the most recent call to requestContentAuthorizationAsynchronouslyWithTimeoutInterval:completionHandler:.

The value will be AVContentAuthorizationUnknown before the first call and between the time a request call is made and just prior to the completion handler being executed (thus it is safe to query this property from the completion handler).

This value is not key-value observable.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItemProtectedContentAdditions.h

contentAuthorizedForPlayback

Indicates whether the content has been authorized by the user (for example, by authorizing the content’s associated account in iTunes). (read-only)

@property (nonatomic, readonly, getter=isContentAuthorizedForPlayback) BOOL contentAuthorizedForPlayback
Discussion

This property reports whether the user has provided the necessary credentials to the system in order for the content to be decrypted for playback.

Content authorization is independent of application authorization (see applicationAuthorizedForPlayback) and that both must be granted in order for an application to be allowed to play protected content.

This property is not key-value observable.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItemProtectedContentAdditions.h

duration

Indicates the duration of the item. (read-only)

@property(nonatomic, readonly) CMTime duration
Discussion

Indicates the duration of the item, not considering either its forwardPlaybackEndTime or reversePlaybackEndTime.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

error

If the receiver's status is AVPlayerItemStatusFailed, this describes the error that caused the failure. (read-only)

@property(nonatomic, readonly) NSError *error
Discussion

The value of this property is an error that describes what caused the receiver to no longer be able to be played.

If the receiver's status is not AVPlayerItemStatusFailed, the value of this property is nil.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

forwardPlaybackEndTime

The time at which forward playback ends.

@property(nonatomic) CMTime forwardPlaybackEndTime
Discussion

The value indicated the time at which playback should end when the playback rate is positive (see AVPlayer’s rate property).

The default value is kCMTimeInvalid, which indicates that no end time for forward playback is specified. In this case, the effective end time for forward playback is the item’s duration.

The value of this property has no effect on playback when the rate is negative.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

loadedTimeRanges

The time ranges of the item that have been loaded. (read-only)

@property(nonatomic, readonly) NSArray *loadedTimeRanges
Discussion

The array contains NSValue objects containing a CMTimeRange value.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

outputs

The outputs associated with the item. (read-only)

@property (nonatomic, readonly) NSArray *outputs
Discussion

This property contains the collection of AVPlayerItemOutput objects used to transfer media data to the player object.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

playbackBufferEmpty

Indicates whether playback has consumed all buffered media and that playback will stall or end. (read-only)

@property(nonatomic, readonly, getter=isPlaybackBufferEmpty) BOOL playbackBufferEmpty
Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

playbackBufferFull

Indicates whether the internal media buffer is full and that further I/O is suspended. (read-only)

@property(nonatomic, readonly, getter=isPlaybackBufferFull) BOOL playbackBufferFull
Discussion

Despite the playback buffer reaching capacity there might not exist sufficient statistical data to support a playbackLikelyToKeepUp prediction of YES.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

playbackLikelyToKeepUp

Indicates whether the item will likely play through without stalling (read-only)

@property(nonatomic, readonly, getter=isPlaybackLikelyToKeepUp) BOOL playbackLikelyToKeepUp
Discussion

This property communicates a prediction of playability. Factors considered in this prediction include I/O throughput and media decode performance. It is possible for playbackLikelyToKeepUp to indicate NO while the property playbackBufferFull indicates YES. In this event the playback buffer has reached capacity but there isn't the statistical data to support a prediction that playback is likely to keep up in the future. It is up to you to decide whether to continue media playback.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

presentationSize

The size at which the visual portion of the item is presented by the player. (read-only)

@property(nonatomic, readonly) CGSize presentationSize
Discussion

You can scale the presentation size to fit within the bounds of a player layer using its videoGravity property. You can also scale the presentation size arbitrarily using the frame property of an AVPlayerLayer object.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

reversePlaybackEndTime

The time at which reverse playback ends.

@property(nonatomic) CMTime reversePlaybackEndTime
Discussion

The value indicated the time at which playback should end when the playback rate is negative (see AVPlayer’s rate property).

The default value is kCMTimeInvalid, which indicates that no end time for reverse playback is specified. In this case, the effective end time for reverse playback is kCMTimeZero.

The value of this property has no effect on playback when the rate is positive.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

seekableTimeRanges

An array of time ranges within which it is possible to seek. (read-only)

@property(nonatomic, readonly) NSArray *seekableTimeRanges
Discussion

The array contains NSValue objects containing a CMTimeRange value.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

status

The status of the player item. (read-only)

@property(nonatomic, readonly) AVPlayerItemStatus status
Discussion

For example, whether the item is playable. For possible values, see “AVPlayerItemStatus.”

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

timebase

The timebase information for the item. (read-only)

@property (nonatomic, readonly) __attribute__((NSObject)) CMTimebaseRef timebase
Discussion

Timebase information is used to synchronize playback of the current item with the master clock. You can use this property to access the timebase information, but you cannot use it to set the time or rate of playback.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

timedMetadata

The timed metadata played most recently by the media stream. (read-only)

@property(nonatomic, readonly) NSArray *timedMetadata
Discussion

The array contains instances of AVMetadataItem.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

tracks

An array of AVPlayerItemTrack objects. (read-only)

@property(nonatomic, readonly) NSArray *tracks
Discussion

This property can change dynamically during playback.

You can observe this property using key-value observing.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

videoComposition

The video composition settings to be applied during playback.

@property(nonatomic, copy) AVVideoComposition *videoComposition
Availability
  • Available in OS X v10.7 and later.
Related Sample Code
Declared In
AVPlayerItem.h

Class Methods

playerItemWithAsset:

Returns a new player item for a given asset.

+ (AVPlayerItem *)playerItemWithAsset:(AVAsset *)asset
Parameters
asset

An asset to play.

Return Value

A new player item, initialized to play asset.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

playerItemWithURL:

Returns a new player item, prepared to use a given URL.

+ (AVPlayerItem *)playerItemWithURL:(NSURL *)URL
Parameters
URL

An URL.

Return Value

A new player item, prepared to use URL.

Special Considerations

This method immediately returns the item, but with the status AVPlayerItemStatusUnknown.

If the URL contains valid data that can be used by the player item, the status later changes to AVPlayerItemStatusReadyToPlay.

If the URL contains no valid data or otherwise can't be used by the player item, the status later changes to AVPlayerItemStatusFailed.

Availability
  • Available in OS X v10.7 and later.
Related Sample Code
Declared In
AVPlayerItem.h

Instance Methods

accessLog

Returns an object that represents a snapshot of the network access log.

- (AVPlayerItemAccessLog *)accessLog
Return Value

An object that represents a snapshot of the network access log. The returned value can be nil.

Discussion

If the method returns nil, there is no logging information currently available for the player item.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

addOutput:

Adds the specified player item output object to the receiver.

- (void)addOutput:(AVPlayerItemOutput *)output
Parameters
output

The player item output object to associate with the item.

Discussion

When you add an AVPlayerItemOutput object to an item, the samples associated with that output object are processed according to the rules for mixing, composing, or excluding content that the AVPlayer object honors for the specific media type. For example, video media is composed according to the instructions provided by the player item’s video composition object and audio media is mixed according to the parameters of its audio mix object.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

cancelContentAuthorizationRequest

Causes the currently outstanding content authorization request to be cancelled.

- (void)cancelContentAuthorizationRequest
Discussion

Calling this method while a content authorization request is pending will cause that request to be cancelled and its completion handler to be invoked with a status of AVContentAuthorizationCancelled.

This method does not block.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItemProtectedContentAdditions.h

cancelPendingSeeks

Cancel any pending seek requests and invoke the corresponding completion handlers if present.

- (void)cancelPendingSeeks
Discussion

Use this method to cancel and release the completion handlers of pending seeks.

The finished parameter of the completion handlers will be set to NO.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

currentDate

Returns the current time of the item as an NSDate object.

- (NSDate *)currentDate
Return Value

The current time of the item as an NSDate object, or nil if playback is not mapped to any date.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

currentTime

Returns the current time of the item.

- (CMTime)currentTime
Return Value

The current time of the item.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

errorLog

Returns an object that represents a snapshot of the error log.

- (AVPlayerItemErrorLog *)errorLog
Return Value

An object that represents a snapshot of the error log. The returned value can be nil.

Discussion

If the method returns nil, there is no logging information currently available for the player item.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

initWithAsset:

Initializes a new player item for a given asset.

- (id)initWithAsset:(AVAsset *)asset
Parameters
asset

An asset to play.

Return Value

The receiver, initialized to play asset.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

initWithURL:

Prepares a player item with a given URL.

- (id)initWithURL:(NSURL *)URL
Parameters
URL

An URL.

Return Value

The receiver, prepared to use URL.

Special Considerations

This method immediately returns the item, but with the status AVPlayerItemStatusUnknown.

If the URL contains valid data that can be used by the player item, the status later changes to AVPlayerItemStatusReadyToPlay.

If the URL contains no valid data or otherwise can't be used by the player item, the status later changes to AVPlayerItemStatusFailed.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

removeOutput:

Removes the specified player item output object from the receiver.

- (void)removeOutput:(AVPlayerItemOutput *)output
Parameters
output

The player item output object to remove.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

requestContentAuthorizationAsynchronouslyWithTimeoutInterval:completionHandler:

Causes appropriate action to be taken to allow the user to authorize the content for playback.

- (void)requestContentAuthorizationAsynchronouslyWithTimeoutInterval:(NSTimeInterval)timeoutInterval completionHandler:(void (^)(void))handler
Parameters
timeoutInterval

The maximum amount of time in seconds to wait for the user to authorize the content before calling the handler block with a timeout result.

handler

The block to be called upon completion.

Discussion

Calling this method will present the user with the opportunity to authorize the content (for example, by launching iTunes and prompting the user to enter their Apple ID and password).

When the user has taken action (or the timeout has elapsed), the completion handler is invoked. You determine the status of the authorization attempt by checking the value of the contentAuthorizationRequestStatus property.

Even if the status indicates a completed authorization, the content may still not be authorized (for example, if the user authorizes an Apple ID other than that associated with the content). You should re-check the value of contentAuthorizationRequestStatus to verify whether the content has actually been authorized before continuing. It is not necessary to call this method if the value of contentAuthorizationRequestStatus is already true.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItemProtectedContentAdditions.h

seekToDate:

Moves the playback cursor to a given date.

- (BOOL)seekToDate:(NSDate *)date
Parameters
date

The date to which to move the playback cursor.

Return Value

YES if the playhead was moved to date, otherwise NO.

Discussion

For playback content that is associated with a range of dates, this method moves the playhead to point within that range. This method will fail (return NO) if date is outside the range or if the content is not associated with a range of dates.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

seekToTime:

Moves the playback cursor to a given time.

- (void)seekToTime:(CMTime)time
Parameters
time

The time to which to move the playback cursor.

Discussion

The time seeked to may differ from the specified time for efficiency. For sample accurate seeking see seekToTime:toleranceBefore:toleranceAfter:.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

seekToTime:completionHandler:

Moves the playback cursor to a given time.

- (void)seekToTime:(CMTime)time completionHandler:(void (^)(BOOL finished))completionHandler
Parameters
time

The time to which to seek.

completionHandler

The block to invoke when the seek operation has either been completed or been interrupted. The block takes one argument:

finished

Indicates whether the seek operation completed.

Discussion

Use this method to seek to a specified time in the item item and be notified when the operation completes. If the seek request completes without being interrupted (either by another seek request or by any other operation), the completion handler you provide is executed with the finished parameter set to YES.

If another seek request is already in progress when you call this method, the completion handler for the in-progress seek request is executed immediately with the finished parameter set to NO.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

seekToTime:toleranceBefore:toleranceAfter:

Moves the playback cursor within a specified time bound.

- (void)seekToTime:(CMTime)time toleranceBefore:(CMTime)toleranceBefore toleranceAfter:(CMTime)toleranceAfter
Parameters
time

The time to which you would like to move the playback cursor.

toleranceBefore

The tolerance allowed before time.

toleranceAfter

The tolerance allowed after time.

Discussion

The time seeked to will be within the range [time-beforeTolerance, time+afterTolerance], and may differ from the specified time for efficiency. If you pass kCMTimeZero for both toleranceBefore and toleranceAfter (to request sample accurate seeking), you may incur additional decoding delay.

Passing kCMTimePositiveInfinity for both toleranceBefore and toleranceAfter is the same as messaging seekToTime: directly.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

seekToTime:toleranceBefore:toleranceAfter:completionHandler:

Moves the playback cursor within a specified time bound.

- (void)seekToTime:(CMTime)time toleranceBefore:(CMTime)toleranceBefore toleranceAfter:(CMTime)toleranceAfter completionHandler:(void (^)(BOOL finished))completionHandler
Parameters
time

The time to which to seek.

toleranceBefore

The temporal tolerance before time.

Pass kCMTimeZero to request sample accurate seeking (this may incur additional decoding delay).

toleranceAfter

The temporal tolerance after time.

Pass kCMTimeZero to request sample accurate seeking (this may incur additional decoding delay).

completionHandler

The block to invoke when the seek operation has finished.

Discussion

Use this method to seek to a specified time for the item.

The time seeked to will be within the range [time-toleranceBefore, time+toleranceAfter] and may differ from time for efficiency.

Invoking this method with kCMTimePositiveInfinity for toleranceBefore and toleranceAfter is the same as invoking seekToTime:completionHandler: directly.

Seeking is constrained by the collection of seekable time ranges. If you seek to a time outside all of the seekable ranges the seek will result in a currentTime within the seekable ranges.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

selectedMediaOptionInMediaSelectionGroup:

Indicates the media selection option that's currently selected from the specified group.

- (AVMediaSelectionOption *)selectedMediaOptionInMediaSelectionGroup:(AVMediaSelectionGroup *)mediaSelectionGroup
Parameters
mediaSelectionGroup

A media selection group obtained from the player item’s asset.

Return Value

An instance of AVMediaSelectionOption that describes the currently selection option in the group.

Discussion

If the value of the allowsEmptySelection property of mediaSelectionGroup is YES, the currently selected option in the group may be nil.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

selectMediaOption:inMediaSelectionGroup:

Selects the media option described by a specified instance of AVMediaSelectionOption in a given media selection group and deselects all other options in that group.

- (void)selectMediaOption:(AVMediaSelectionOption *)mediaSelectionOption inMediaSelectionGroup:(AVMediaSelectionGroup *)mediaSelectionGroup
Parameters
mediaSelectionOption

The option to select.

If the value of the allowsEmptySelection property of mediaSelectionGroup is YES, you can pass nil to deselect all media selection options in the group.

mediaSelectionGroup

The media selection group, obtained from the receiver's asset, that contains mediaSelectionOption.

Discussion

If mediaSelectionOption isn’t a member of the mediaSelectionGroup, no change in presentation state will result.

If multiple options within a group meet your criteria for selection according to locale or other considerations, and if these options are otherwise indistinguishable to you according to media characteristics that are meaningful for your application, content is typically authored so that the first available option that meets your criteria is appropriate for selection.

Availability
  • Available in OS X v10.8 and later.
Declared In
AVPlayerItem.h

stepByCount:

Moves the player’s current item’s current time forward or backward by a specified number of steps.

- (void)stepByCount:(NSInteger)stepCount
Parameters
stepCount

The number of steps by which to move.

A positive number steps forward, a negative number steps backward.

Discussion

The size of each step depends on the receiver’s enabled AVPlayerItemTrack objects (see tracks).

Availability
  • Available in OS X v10.7 and later.
Declared In
AVPlayerItem.h

Constants

AVPlayerItemStatus

Constants that represent the status of an item

enum {
   AVPlayerItemStatusUnknown,
   AVPlayerItemStatusReadyToPlay,
   AVPlayerItemStatusFailed
};
typedef NSInteger AVPlayerItemStatus;
Constants
AVPlayerItemStatusUnknown

The item’s status is unknown.

Available in OS X v10.7 and later.

Declared in AVPlayerItem.h.

AVPlayerItemStatusReadyToPlay

The item is ready to play.

Available in OS X v10.7 and later.

Declared in AVPlayerItem.h.

AVPlayerItemStatusFailed

The item cannot be played.

Available in OS X v10.7 and later.

Declared in AVPlayerItem.h.

AVContentAuthorizationStatus

Possible status values resulting from a call to requestContentAuthorizationAsynchronouslyWithTimeoutInterval:completionHandler:.

enum {
   AVContentAuthorizationUnknown,
   AVContentAuthorizationCompleted,
   AVContentAuthorizationCancelled,
   AVContentAuthorizationTimedOut,
   AVContentAuthorizationBusy,
   AVContentAuthorizationNotAvailable,
   AVContentAuthorizationNotPossible,
};
typedef NSInteger AVContentAuthorizationStatus;
Constants
AVContentAuthorizationUnknown

No call to request content authorization has completed yet.

Available in OS X v10.7 and later.

Declared in AVPlayerItemProtectedContentAdditions.h.

AVContentAuthorizationCompleted

The last completed call to request content authorization completed.

Available in OS X v10.7 and later.

Declared in AVPlayerItemProtectedContentAdditions.h.

AVContentAuthorizationCancelled

The last call to request content authorization was cancelled by the user.

Available in OS X v10.7 and later.

Declared in AVPlayerItemProtectedContentAdditions.h.

AVContentAuthorizationTimedOut

The last call to request content authorization was cancelled because the timeout interval was reached.

Available in OS X v10.7 and later.

Declared in AVPlayerItemProtectedContentAdditions.h.

AVContentAuthorizationBusy

The last call to request content authorization could not be completed because another asset is currently attempting authorization.

Available in OS X v10.7 and later.

Declared in AVPlayerItemProtectedContentAdditions.h.

AVContentAuthorizationNotAvailable

The last call to request content authorization could not be completed because there was no known mechanism by which to attempt authorization.

Available in OS X v10.7 and later.

Declared in AVPlayerItemProtectedContentAdditions.h.

AVContentAuthorizationNotPossible

The last call to request content authorization could not be completed in a non-recoverable way (for example, a newer version of iTunes is required).

Available in OS X v10.7 and later.

Declared in AVPlayerItemProtectedContentAdditions.h.

Discussion

Even if authorization is completed by the user, there is no guarantee that the content will then be authorized. You should re-check whether the content is authorized before proceeding.

Notification Key

Key to retrieve information from a notification’s user info dictionary.

extern NSString *const AVPlayerItemFailedToPlayToEndTimeErrorKey
Constants
AVPlayerItemFailedToPlayToEndTimeErrorKey

The key to retrieve an error object (NSError) from the user info dictionary of an AVPlayerItemTimeJumpedNotification notification.

Available in OS X v10.7 and later.

Declared in AVPlayerItem.h.

Notifications

AVPlayerItemDidPlayToEndTimeNotification

Posted when the item has played to its end time.

The notification’s object is the item that finished playing.

Availability
Declared In
AVPlayerItem.h

AVPlayerItemFailedToPlayToEndTimeNotification

Posted when the item failed to play to its end time.

The notification’s object is the item that finished playing.

The user info dictionary contains an error object that describes the problem—seeAVPlayerItemFailedToPlayToEndTimeErrorKey.

Availability
Declared In
AVPlayerItem.h

AVPlayerItemTimeJumpedNotification

Posted when the item’s current time has changed discontinuously.

The notification’s object is the item.

Availability
Declared In
AVPlayerItem.h

Did this document help you? Yes It's good, but... Not helpful...