Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVPlayerItemMBS class.

AVPlayerItemMBS.accessLog as AVPlayerItemAccessLogMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns an object that represents a snapshot of the network access log.

An object that represents a snapshot of the network access log. The returned value can be nil.
If the method returns nil, there is no logging information currently available for the player item.

AVPlayerItemMBS.addOutput(output as AVPlayerItemOutputMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds the specified player item output object to the receiver.

output: The player item output object to associate with the item.

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.
Available in OS X v10.8 and later.

AVPlayerItemMBS.automaticallyLoadedAssetKeys as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 14.0 ✅ Yes ❌ No ❌ No ✅ Yes All
An array of property keys defined by the asset property. (read-only)

The value of each key in automaticallyLoadedAssetKeys will be automatically be loaded by the asset before the receiver achieves the status AVPlayerItemStatusReadyToPlay; i.e. when the item is ready to play, the value of invoking statusOfValueForKey on the asset property value will be AVKeyValueStatusLoaded. If loading of any of the values fails, the status property of the receiver will change to AVPlayerItemStatusFailed.
Available in OS X v10.9 and later.

AVPlayerItemMBS.cancelContentAuthorizationRequest

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Causes the currently outstanding content authorization request to be cancelled.

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.

AVPlayerItemMBS.cancelPendingSeeks

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Cancel any pending seek requests and invoke the corresponding completion handlers if present.

Use this method to cancel and release the completion handlers of pending seeks.
The finished parameter of the completion handlers will be set to false.

AVPlayerItemMBS.Constructor(asset as AVAssetMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes a new player item for a given asset.

See also:

AVPlayerItemMBS.Constructor(asset as AVAssetMBS, automaticallyLoadedAssetKeys() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 14.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes a player item with an array of AVAsset keys.

asset: An instance of AVAsset.
automaticallyLoadedAssetKeys: An array of strings, each representing a property defined by AVAsset.

Returns an initialized instance of AVPlayerItem.

The value of each key in automaticallyLoadedAssetKeys will be automatically be loaded by the underlying AVAsset before the receiver achieves the status AVPlayerItemStatusReadyToPlay; i.e. when the item is ready to play, the value returned by invoking the asset property's statusOfValueForKey method will be one of the terminal status values, either AVKeyValueStatusLoaded, AVKeyValueStatusFailed, or AVKeyValueStatusCancelled.

Important: The asset property keys "playable" and "compatibleWithSavedPhotosAlbum" are not eligible for automatic loading by AVPlayerItem. You must use the AVAsset method loadValuesAsynchronouslyForKeys:completionHandler: to load the values of those properties asynchronously.

Available in OS X v10.9 and later.

See also:

AVPlayerItemMBS.Constructor(file as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Prepares a player item with a given file.

file: A folderitem.

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.

See also:

AVPlayerItemMBS.Constructor(URL as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Prepares a player item with a given URL.

URL: An URL.

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.

See also:

AVPlayerItemMBS.copy as AVPlayerItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a copy of the object.

AVPlayerItemMBS.errorLog as AVPlayerItemErrorLogMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns an object that represents a snapshot of the error log.

An object that represents a snapshot of the error log. The returned value can be nil.
If the method returns nil, there is no logging information currently available for the player item.

AVPlayerItemMBS.loadedTimeRanges as CMTimeRangeMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The time ranges of the item that have been loaded. (read-only)

AVPlayerItemMBS.outputs as AVPlayerItemOutputMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The outputs associated with the item. (read-only)

This property contains the collection of AVPlayerItemOutput objects used to transfer media data to the player object.
Available in OS X v10.8 and later.

AVPlayerItemMBS.removeOutput(output as AVPlayerItemOutputMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes the specified player item output object from the receiver.

output: The player item output object to remove.
Available in OS X v10.8 and later.

AVPlayerItemMBS.requestContentAuthorizationAsynchronously(timeoutInterval as Double, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Causes appropriate action to be taken to allow the user to authorize the content for playback.

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.

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 AVFoundationMBS.requestContentAuthorizationCompleted event 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.

With tag you can pass any value you like to the event later. This can be for example an object reference or a number in an array. Be aware that the reference to this tag value is kept until the event is called and can cause memory reference cycles.

AVPlayerItemMBS.seekableTimeRanges as CMTimeRangeMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
An array of time ranges within which it is possible to seek. (read-only)

AVPlayerItemMBS.seekToDate(date as date, fireEvent as boolean = false, tag as Variant = nil) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 14.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Moves the playback cursor to the time given by the specified date object.

date: The time to which to seek.

If fireEvent is true, the AVFoundationMBS.playerItemSeekToDateFinished event is called.

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

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.
Available in OS X v10.9 and later.

AVPlayerItemMBS.seekToDateTime(date as dateTime, fireEvent as boolean = false, tag as variant = nil) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 20.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Moves the playback cursor to the time given by the specified date object.

date: The time to which to seek.

If fireEvent is true, the AVFoundationMBS.playerItemSeekToDateFinished event is called.

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

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.
Available in OS X v10.9 and later.

AVPlayerItemMBS.seekToTime(time as CMTimeMBS, fireEvent as boolean = false, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Moves the playback cursor to a given time.

time: The time to which to move the playback cursor.
If fireEvent is true, the AVFoundationMBS.playerItemSeekToTimeFinished event will be called later.

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 event is executed with the finished parameter set to true.

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

With tag you can pass any value you like to the event later. This can be for example an object reference or a number in an array. Be aware that the reference to this tag value is kept until the event is called and can cause memory reference cycles.

See also:

AVPlayerItemMBS.seekToTime(time as CMTimeMBS, toleranceBefore as CMTimeMBS, toleranceAfter as CMTimeMBS, fireEvent as boolean = false, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Moves the playback cursor within a specified time bound.

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.

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.

With tag you can pass any value you like to the event later. This can be for example an object reference or a number in an array. Be aware that the reference to this tag value is kept until the event is called and can cause memory reference cycles.

See also:

AVPlayerItemMBS.selectedMediaOptionInMediaSelectionGroup(mediaSelectionGroup as AVMediaSelectionGroupMBS) as AVMediaSelectionOptionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Indicates the media selection option that's currently selected from the specified group.

mediaSelectionGroup: A media selection group obtained from the player item's asset.

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

If the value of the allowsEmptySelection property of mediaSelectionGroup is true, the currently selected option in the group may be nil.
Available in OS X v10.8 and later.

AVPlayerItemMBS.selectMediaOption(mediaSelectionOption as AVMediaSelectionOptionMBS, mediaSelectionGroup as AVMediaSelectionGroupMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
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.

mediaSelectionOption: The option to select.
If the value of the allowsEmptySelection property of mediaSelectionGroup is true, 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.

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.
Available in OS X v10.8 and later.

AVPlayerItemMBS.selectMediaOptionAutomaticallyInMediaSelectionGroup(mediaSelectionGroup as AVMediaSelectionGroupMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 14.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Selects the media option in the specified media selection group that best matches the receiver's automatic selection criteria.

mediaSelectionGroup: The media selection group, obtained from the receiver's asset, that contains the specified option.

This method has no effect unless the appliesMediaSelectionCriteriaAutomatically property of the associated AVPlayer is true and unless automatic media selection has previously been overridden by invoking sselectMediaOption:inMediaSelectionGroup.
Available in OS X v10.9 and later.

AVPlayerItemMBS.setTextStyleRules(rules() as AVTextStyleRuleMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 14.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the textStyleRules array.

AVPlayerItemMBS.stepByCount(stepCount as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Moves the player's current item's current time forward or backward by a specified number of steps.

stepCount: The number of steps by which to move.
A positive number steps forward, a negative number steps backward.

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

AVPlayerItemMBS.textStyleRules as AVTextStyleRuleMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 14.0 ✅ Yes ❌ No ❌ No ✅ Yes All
An array of text style rules to apply to subtitles and other legible text.

You can use this property to assign an array of AVTextStyleRule objects to the item. Each rule specifies both the style information and the range of text to which that styling should apply.
Available in OS X v10.9 and later.

AVPlayerItemMBS.timedMetadata as AVMetadataItemMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The timed metadata played most recently by the media stream. (read-only)

The array contains instances of AVMetadataItem.

AVPlayerItemMBS.tracks as AVPlayerItemTrackMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
An array of AVPlayerItemTrack objects. (read-only)

This property can change dynamically during playback.
You can observe this property using key-value observing.

The items on this page are in the following plugins: MBS AVFoundation Plugin.


The biggest plugin in space...