| Modifier and Type | Class and Description |
|---|---|
static interface |
AVPlayerItem.Block_seekToDateCompletionHandler |
static interface |
AVPlayerItem.Block_seekToTimeCompletionHandler |
static interface |
AVPlayerItem.Block_seekToTimeToleranceBeforeToleranceAfterCompletionHandler |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
AVPlayerItem(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
AVPlayerItemAccessLog |
accessLog()
accessLog
|
void |
addMediaDataCollector(AVPlayerItemMediaDataCollector collector)
addMediaDataCollector:
|
void |
addOutput(AVPlayerItemOutput output)
addOutput:
|
static AVPlayerItem |
alloc() |
static AVPlayerItem |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
long |
allowedAudioSpatializationFormats()
[@property] allowedAudioSpatializationFormats
|
boolean |
appliesPerFrameHDRDisplayMetadata()
default is YES
|
AVAsset |
asset()
[@property] asset
|
AVAudioMix |
audioMix()
[@property] audioMix
|
java.lang.String |
audioTimePitchAlgorithm()
[@property] audioTimePitchAlgorithm
|
boolean |
automaticallyHandlesInterstitialEvents()
[@property] automaticallyHandlesInterstitialEvents
|
NSArray<java.lang.String> |
automaticallyLoadedAssetKeys()
[@property] automaticallyLoadedAssetKeys
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
boolean |
automaticallyPreservesTimeOffsetFromLive()
[@property] automaticallyPreservesTimeOffsetFromLive
|
void |
cancelPendingSeeks()
cancelPendingSeeks
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
boolean |
canPlayFastForward()
For releases of OS X prior to 10.9 and releases of iOS prior to 7.0, indicates whether the item can be played at rates greater than 1.0.
|
boolean |
canPlayFastReverse()
indicates whether the item can be played at rates less than -1.0
|
boolean |
canPlayReverse()
indicates whether the item can be played at rate -1.0
|
boolean |
canPlaySlowForward()
indicates whether the item can be played at rates between 0.0 and 1.0
|
boolean |
canPlaySlowReverse()
indicates whether the item can be played at rates less between 0.0 and -1.0
|
boolean |
canStepBackward()
indicates whether the item supports stepping backward; see -stepByCount:.
|
boolean |
canStepForward()
Indicates whether the item supports stepping forward; see -stepByCount:.
|
boolean |
canUseNetworkResourcesForLiveStreamingWhilePaused()
[@property] canUseNetworkResourcesForLiveStreamingWhilePaused
|
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
CMTime |
configuredTimeOffsetFromLive()
[@property] configuredTimeOffsetFromLive
|
java.lang.Object |
copy() |
java.lang.Object |
copyWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
NSDate |
currentDate()
currentDate
|
AVMediaSelection |
currentMediaSelection()
[@property] currentMediaSelection
|
CMTime |
currentTime()
currentTime
|
AVVideoCompositing |
customVideoCompositor()
[@property] customVideoCompositor
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
CMTime |
duration()
[@property] duration
|
NSError |
error()
[@property] error
|
AVPlayerItemErrorLog |
errorLog()
errorLog
|
NSArray<? extends AVMetadataItem> |
externalMetadata()
[@property] externalMetadata
|
CMTime |
forwardPlaybackEndTime()
[@property] forwardPlaybackEndTime
|
static long |
hash_static() |
AVPlayerItem |
init() |
AVPlayerItem |
initWithAsset(AVAsset asset)
initWithAsset:
|
AVPlayerItem |
initWithAssetAutomaticallyLoadedAssetKeys(AVAsset asset,
NSArray<java.lang.String> automaticallyLoadedAssetKeys)
initWithAsset:automaticallyLoadedAssetKeys:
|
AVPlayerItem |
initWithURL(NSURL URL)
initWithURL:
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isAudioSpatializationAllowed()
[@property] audioSpatializationAllowed
|
boolean |
isPlaybackBufferEmpty()
indicates that playback has consumed all buffered media and that playback will stall or end
|
boolean |
isPlaybackBufferFull()
[@property] playbackBufferFull
|
boolean |
isPlaybackLikelyToKeepUp()
[@property] playbackLikelyToKeepUp
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
NSArray<? extends NSValue> |
loadedTimeRanges()
[@property] loadedTimeRanges
|
NSArray<? extends AVPlayerItemMediaDataCollector> |
mediaDataCollectors()
[@property] mediaDataCollectors
|
static AVPlayerItem |
new_objc() |
NSArray<? extends AVPlayerItemOutput> |
outputs()
[@property] outputs
|
static AVPlayerItem |
playerItemWithAsset(AVAsset asset)
playerItemWithAsset:
|
static AVPlayerItem |
playerItemWithAssetAutomaticallyLoadedAssetKeys(AVAsset asset,
NSArray<java.lang.String> automaticallyLoadedAssetKeys)
playerItemWithAsset:automaticallyLoadedAssetKeys:
|
static AVPlayerItem |
playerItemWithURL(NSURL URL)
playerItemWithURL:
|
double |
preferredForwardBufferDuration()
[@property] preferredForwardBufferDuration
|
CGSize |
preferredMaximumResolution()
[@property] preferredMaximumResolution
|
CGSize |
preferredMaximumResolutionForExpensiveNetworks()
[@property] preferredMaximumResolutionForExpensiveNetworks
|
double |
preferredPeakBitRate()
[@property] preferredPeakBitRate
|
double |
preferredPeakBitRateForExpensiveNetworks()
[@property] preferredPeakBitRateForExpensiveNetworks
|
CGSize |
presentationSize()
[@property] presentationSize
|
CMTime |
recommendedTimeOffsetFromLive()
[@property] recommendedTimeOffsetFromLive
|
void |
removeMediaDataCollector(AVPlayerItemMediaDataCollector collector)
removeMediaDataCollector:
|
void |
removeOutput(AVPlayerItemOutput output)
removeOutput:
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
CMTime |
reversePlaybackEndTime()
[@property] reversePlaybackEndTime
|
NSArray<? extends NSValue> |
seekableTimeRanges()
[@property] seekableTimeRanges
|
boolean |
seekingWaitsForVideoCompositionRendering()
[@property] seekingWaitsForVideoCompositionRendering
|
boolean |
seekToDate(NSDate date)
seekToDate
|
boolean |
seekToDateCompletionHandler(NSDate date,
AVPlayerItem.Block_seekToDateCompletionHandler completionHandler)
seekToDate:completionHandler:
|
void |
seekToTime(CMTime time)
seekToTime:
|
void |
seekToTimeCompletionHandler(CMTime time,
AVPlayerItem.Block_seekToTimeCompletionHandler completionHandler)
seekToTime:completionHandler:
|
void |
seekToTimeToleranceBeforeToleranceAfter(CMTime time,
CMTime toleranceBefore,
CMTime toleranceAfter)
seekToTime:toleranceBefore:toleranceAfter:
|
void |
seekToTimeToleranceBeforeToleranceAfterCompletionHandler(CMTime time,
CMTime toleranceBefore,
CMTime toleranceAfter,
AVPlayerItem.Block_seekToTimeToleranceBeforeToleranceAfterCompletionHandler completionHandler)
seekToTime:toleranceBefore:toleranceAfter:completionHandler:
|
AVMediaSelectionOption |
selectedMediaOptionInMediaSelectionGroup(AVMediaSelectionGroup mediaSelectionGroup)
selectedMediaOptionInMediaSelectionGroup:
|
void |
selectMediaOptionAutomaticallyInMediaSelectionGroup(AVMediaSelectionGroup mediaSelectionGroup)
selectMediaOptionAutomaticallyInMediaSelectionGroup:
|
void |
selectMediaOptionInMediaSelectionGroup(AVMediaSelectionOption mediaSelectionOption,
AVMediaSelectionGroup mediaSelectionGroup)
selectMediaOption:inMediaSelectionGroup:
|
void |
setAllowedAudioSpatializationFormats(long value)
[@property] allowedAudioSpatializationFormats
|
void |
setAppliesPerFrameHDRDisplayMetadata(boolean value)
default is YES
|
void |
setAudioMix(AVAudioMix value)
[@property] audioMix
|
void |
setAudioSpatializationAllowed(boolean value)
[@property] audioSpatializationAllowed
|
void |
setAudioTimePitchAlgorithm(java.lang.String value)
[@property] audioTimePitchAlgorithm
|
void |
setAutomaticallyHandlesInterstitialEvents(boolean value)
[@property] automaticallyHandlesInterstitialEvents
|
void |
setAutomaticallyPreservesTimeOffsetFromLive(boolean value)
[@property] automaticallyPreservesTimeOffsetFromLive
|
void |
setCanUseNetworkResourcesForLiveStreamingWhilePaused(boolean value)
[@property] canUseNetworkResourcesForLiveStreamingWhilePaused
|
void |
setConfiguredTimeOffsetFromLive(CMTime value)
[@property] configuredTimeOffsetFromLive
|
void |
setExternalMetadata(NSArray<? extends AVMetadataItem> value)
[@property] externalMetadata
|
void |
setForwardPlaybackEndTime(CMTime value)
[@property] forwardPlaybackEndTime
|
void |
setPreferredForwardBufferDuration(double value)
[@property] preferredForwardBufferDuration
|
void |
setPreferredMaximumResolution(CGSize value)
[@property] preferredMaximumResolution
|
void |
setPreferredMaximumResolutionForExpensiveNetworks(CGSize value)
[@property] preferredMaximumResolutionForExpensiveNetworks
|
void |
setPreferredPeakBitRate(double value)
[@property] preferredPeakBitRate
|
void |
setPreferredPeakBitRateForExpensiveNetworks(double value)
[@property] preferredPeakBitRateForExpensiveNetworks
|
void |
setReversePlaybackEndTime(CMTime value)
[@property] reversePlaybackEndTime
|
void |
setSeekingWaitsForVideoCompositionRendering(boolean value)
[@property] seekingWaitsForVideoCompositionRendering
|
void |
setStartsOnFirstEligibleVariant(boolean value)
[@property] startsOnFirstEligibleVariant
|
void |
setTextStyleRules(NSArray<? extends AVTextStyleRule> value)
[@property] textStyleRules
|
void |
setVariantPreferences(long value)
[@property] variantPreferences
|
static void |
setVersion_static(long aVersion) |
void |
setVideoApertureMode(java.lang.String value)
[@property] videoApertureMode
|
void |
setVideoComposition(AVVideoComposition value)
[@property] videoComposition
|
boolean |
startsOnFirstEligibleVariant()
[@property] startsOnFirstEligibleVariant
|
long |
status()
[@property] status
|
void |
stepByCount(long stepCount)
stepByCount:
|
static org.moe.natj.objc.Class |
superclass_static() |
AVPlayerItem |
templatePlayerItem()
[@property] templatePlayerItem
|
NSArray<? extends AVTextStyleRule> |
textStyleRules()
[@property] textStyleRules
|
CMTimebaseRef |
timebase()
[@property] timebase
|
NSArray<? extends AVMetadataItem> |
timedMetadata()
[@property] timedMetadata
|
NSArray<? extends AVPlayerItemTrack> |
tracks()
[@property] tracks
|
long |
variantPreferences()
[@property] variantPreferences
|
static long |
version_static() |
java.lang.String |
videoApertureMode()
[@property] videoApertureMode
|
AVVideoComposition |
videoComposition()
[@property] videoComposition
|
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static AVPlayerItem alloc()
public static AVPlayerItem allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static AVPlayerItem new_objc()
public static AVPlayerItem playerItemWithAsset(AVAsset asset)
Returns an instance of AVPlayerItem for playing an AVAsset.
Equivalent to +playerItemWithAsset:automaticallyLoadedAssetKeys:, passing @[ @"duration" ] as the value of automaticallyLoadedAssetKeys.
asset - public static AVPlayerItem playerItemWithAssetAutomaticallyLoadedAssetKeys(AVAsset asset, NSArray<java.lang.String> automaticallyLoadedAssetKeys)
Returns an instance of AVPlayerItem for playing an AVAsset.
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 of -[[AVPlayerItem asset] statusOfValueForKey:error:] will be one of the terminal status values greater than AVKeyValueStatusLoading.
asset - automaticallyLoadedAssetKeys - An NSArray of NSStrings, each representing a property key defined by AVAsset. See AVAsset.h for property keys, e.g. duration.public static AVPlayerItem playerItemWithURL(NSURL URL)
Returns an instance of AVPlayerItem for playing a resource at the specified location.
Equivalent to +playerItemWithAsset:, passing [AVAsset assetWithURL:URL] as the value of asset.
URL - public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public AVPlayerItemAccessLog accessLog()
Returns an object that represents a snapshot of the network access log. Can be nil.
An AVPlayerItemAccessLog provides methods to retrieve the network access log in a format suitable for serialization. If nil is returned then there is no logging information currently available for this AVPlayerItem. An AVPlayerItemNewAccessLogEntryNotification will be posted when new logging information becomes available. However, accessLog might already return a non-nil value even before the first notification is posted.
public void addMediaDataCollector(AVPlayerItemMediaDataCollector collector)
Adds the specified instance of AVPlayerItemMediaDataCollector to the receiver's collection of mediaDataCollectors.
This method may incur additional I/O to collect the requested media data asynchronously.
collector - An instance of AVPlayerItemMediaDataCollectorpublic void addOutput(AVPlayerItemOutput output)
Adds the specified instance of AVPlayerItemOutput to the receiver's collection of outputs.
The class of AVPlayerItemOutput provided dictates the data structure that decoded samples are vended in.
When an AVPlayerItemOutput is associated with an AVPlayerItem, samples are provided for a media type in accordance with the rules for mixing, composition, or exclusion that the AVPlayer honors among multiple enabled tracks of that media type for its own rendering purposes. For example, video media will be composed according to the instructions provided via AVPlayerItem.videoComposition, if present. Audio media will be mixed according to the parameters provided via AVPlayerItem.audioMix, if present.
output - An instance of AVPlayerItemOutputpublic AVAsset asset()
Accessor for underlying AVAsset.
public AVAudioMix audioMix()
Indicates the audio mix parameters to be applied during playback
The inputParameters of the AVAudioMix must have trackIDs that correspond to a track of the receiver's asset. Otherwise they will be ignored. (See AVAudioMix.h for the declaration of AVAudioMixInputParameters and AVPlayerItem's asset property.)
public java.lang.String audioTimePitchAlgorithm()
Indicates the processing algorithm used to manage audio pitch at varying rates and for scaled audio edits.
Constants for various time pitch algorithms, e.g. AVAudioTimePitchSpectral, are defined in AVAudioProcessingSettings.h. The default value for applications linked on or after iOS 15.0 or macOS 12.0 is AVAudioTimePitchAlgorithmTimeDomain. For iOS versions prior to 15.0 the default value is AVAudioTimePitchAlgorithmLowQualityZeroLatency. For macOS versions prior to 12.0 the default value is AVAudioTimePitchAlgorithmSpectral.
public NSArray<java.lang.String> automaticallyLoadedAssetKeys()
An array of property keys defined on AVAsset. The value of each key in the array is automatically loaded while the receiver is being made ready to play.
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 of -[[AVPlayerItem asset] statusOfValueForKey:error:] will be AVKeyValueStatusLoaded. If loading of any of the values fails, the status of the AVPlayerItem will change instead to AVPlayerItemStatusFailed..
public boolean canPlayFastForward()
public boolean canPlayFastReverse()
public boolean canPlayReverse()
public boolean canPlaySlowForward()
public boolean canPlaySlowReverse()
public boolean canStepBackward()
public boolean canStepForward()
public boolean canUseNetworkResourcesForLiveStreamingWhilePaused()
Indicates whether the player item can use network resources to keep playback state up to date while paused
For live streaming content, the player item may need to use extra networking and power resources to keep playback state up to date when paused. For example, when this property is set to YES, the seekableTimeRanges property will be periodically updated to reflect the current state of the live stream.
For clients linked on or after OS X 10.11 or iOS 9.0, the default value is NO. To minimize power usage, avoid setting this property to YES when you do not need playback state to stay up to date while paused.
public void cancelPendingSeeks()
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 NO.
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
copyWithZone in interface NSCopyingpublic NSDate currentDate()
If currentTime is mapped to a particular (real-time) date, return that date.
public AVMediaSelection currentMediaSelection()
Provides an instance of AVMediaSelection carrying current selections for each of the receiver's media selection groups.
public CMTime currentTime()
Returns the current time of the item.
Returns the current time of the item. Not key-value observable; use -[AVPlayer addPeriodicTimeObserverForInterval:queue:usingBlock:] instead.
public AVVideoCompositing customVideoCompositor()
Indicates the custom video compositor instance.
This property is nil if there is no video compositor, or if the internal video compositor is in use. This reference can be used to provide extra context to the custom video compositor instance if required.
This property must be accessed on the main thread/queue.
public CMTime duration()
Indicates the duration of the item, not considering either its forwardPlaybackEndTime or reversePlaybackEndTime.
This property is observable. The duration of an item can change dynamically during playback.
Unless you omit @"duration" from the array of asset keys you pass to +playerItemWithAsset:automaticallyLoadedAssetKeys: or -initWithAsset:automaticallyLoadedAssetKeys:, the value of this property will accord with the properties of the underlying AVAsset and the current state of playback once the receiver becomes ready to play.
Before the underlying duration has been loaded, the value of this property is kCMTimeIndefinite. Use key-value observation to obtain a valid duration as soon as it becomes available. (Note that the value of duration may remain kCMTimeIndefinite, e.g. for live streams.)
public NSError error()
If the receiver's status is AVPlayerItemStatusFailed, this describes the error that caused the failure.
The value of this property is an NSError 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.
public AVPlayerItemErrorLog errorLog()
Returns an object that represents a snapshot of the error log. Can be nil.
An AVPlayerItemErrorLog provides methods to retrieve the error log in a format suitable for serialization. If nil is returned then there is no logging information currently available for this AVPlayerItem.
public CMTime forwardPlaybackEndTime()
The end time for forward playback.
Specifies 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 receiver's duration.
When the end time is reached, the receiver will post AVPlayerItemDidPlayToEndTimeNotification and the AVPlayer will take the action indicated by the value of its actionAtItemEnd property (see AVPlayerActionAtItemEnd in AVPlayer.h).
The value of this property has no effect on playback when the rate is negative.
public AVPlayerItem init()
public AVPlayerItem initWithAsset(AVAsset asset)
Initializes an AVPlayerItem with an AVAsset.
Equivalent to -initWithAsset:automaticallyLoadedAssetKeys:, passing @[ @"duration" ] as the value of automaticallyLoadedAssetKeys.
asset - public AVPlayerItem initWithAssetAutomaticallyLoadedAssetKeys(AVAsset asset, NSArray<java.lang.String> automaticallyLoadedAssetKeys)
Initializes an AVPlayerItem with an AVAsset.
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 of -[[AVPlayerItem asset] statusOfValueForKey:error:] will be one of the terminal status values greater than AVKeyValueStatusLoading.
asset - An instance of AVAsset.automaticallyLoadedAssetKeys - An NSArray of NSStrings, each representing a property key defined by AVAsset. See AVAsset.h for property keys, e.g. duration.public AVPlayerItem initWithURL(NSURL URL)
Initializes an AVPlayerItem with an NSURL.
Equivalent to -initWithAsset:, passing [AVAsset assetWithURL:URL] as the value of asset.
URL - public boolean isPlaybackBufferEmpty()
public boolean isPlaybackBufferFull()
Indicates that the internal media buffer is full and that further I/O is suspended.
This property reports that the data buffer used for playback has reach capacity. Despite the playback buffer reaching capacity there might not exist sufficient statistical data to support a playbackLikelyToKeepUp prediction of YES. See playbackLikelyToKeepUp above.
public boolean isPlaybackLikelyToKeepUp()
Indicates whether the item will likely play through without stalling.
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. It is left to the application programmer to decide to continue media playback or not. See playbackBufferFull below.
public NSArray<? extends NSValue> loadedTimeRanges()
This property provides a collection of time ranges for which the player has the media data readily available. The ranges provided might be discontinuous.
Returns an NSArray of NSValues containing CMTimeRanges.
public NSArray<? extends AVPlayerItemMediaDataCollector> mediaDataCollectors()
The collection of associated mediaDataCollectors.
public NSArray<? extends AVPlayerItemOutput> outputs()
The collection of associated outputs.
public double preferredForwardBufferDuration()
Indicates the media duration the caller prefers the player to buffer from the network ahead of the playhead to guard against playback disruption.
The value is in seconds. If it is set to 0, the player will choose an appropriate level of buffering for most use cases. Note that setting this property to a low value will increase the chance that playback will stall and re-buffer, while setting it to a high value will increase demand on system resources. Note that the system may buffer less than the value of this property in order to manage resource consumption.
public double preferredPeakBitRate()
Indicates the desired limit of network bandwidth consumption for this item.
Set preferredPeakBitRate to non-zero to indicate that the player should attempt to limit item playback to that bit rate, expressed in bits per second.
If network bandwidth consumption cannot be lowered to meet the preferredPeakBitRate, it will be reduced as much as possible while continuing to play the item.
public CGSize presentationSize()
The size of the receiver as presented by the player.
Indicates the size at which the visual portion of the item is presented by the player; can be scaled from this size to fit within the bounds of an AVPlayerLayer via its videoGravity property. Can be scaled arbitarily for presentation via the frame property of an AVPlayerLayer.
The value of this property will accord with the properties of the underlying media resource when the receiver becomes ready to play. Before the underlying media resource is sufficiently loaded, its value is CGSizeZero. Use key-value observation to obtain a valid presentationSize as soon as it becomes available. (Note that the value of presentationSize may remain CGSizeZero, e.g. for audio-only items.)
public void removeMediaDataCollector(AVPlayerItemMediaDataCollector collector)
Removes the specified instance of AVPlayerItemMediaDataCollector from the receiver's collection of mediaDataCollectors.
collector - An instance of AVPlayerItemMediaDataCollectorpublic void removeOutput(AVPlayerItemOutput output)
Removes the specified instance of AVPlayerItemOutput from the receiver's collection of outputs.
output - An instance of AVPlayerItemOutputpublic CMTime reversePlaybackEndTime()
The end time for reverse playback.
Specifies 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.
When the end time is reached, the receiver will post AVPlayerItemDidPlayToEndTimeNotification and the AVPlayer will take the action indicated by the value of its actionAtItemEnd property (see AVPlayerActionAtItemEnd in AVPlayer.h).
The value of this property has no effect on playback when the rate is positive.
public boolean seekToDate(NSDate date)
move playhead to a point corresponding to a particular date.
For playback content that is associated with a range of dates, move the playhead to point within that range. Will fail if the supplied date is outside the range or if the content is not associated with a range of dates.
date - The new position for the playhead.public boolean seekToDateCompletionHandler(NSDate date, AVPlayerItem.Block_seekToDateCompletionHandler completionHandler)
move playhead to a point corresponding to a particular date, and invokes the specified block when the seek operation has either been completed or been interrupted.
For playback content that is associated with a range of dates, move the playhead to point within that range and invokes the completion handler when the seek operation is complete. Will fail if the supplied date is outside the range or if the content is not associated with a range of dates. The completion handler for any prior seek request that is still in process will be invoked immediately with the finished parameter set to NO. If the new request completes without being interrupted by another seek request or by any other operation, the specified completion handler will be invoked with the finished parameter set to YES.
date - The new position for the playhead.completionHandler - The block to invoke when seek operation is completepublic void seekToTime(CMTime time)
Moves the playback cursor.
Use this method to seek to a specified time for the item. The time seeked to may differ from the specified time for efficiency. For sample accurate seeking see seekToTime:toleranceBefore:toleranceAfter:. If the seek time is outside of seekable time ranges as indicated by seekableTimeRanges property, the seek request will be cancelled.
time - public void seekToTimeCompletionHandler(CMTime time, AVPlayerItem.Block_seekToTimeCompletionHandler completionHandler)
Moves the playback cursor and invokes the specified block when the seek operation has either been completed or been interrupted.
Use this method to seek to a specified time for the item and to be notified when the seek operation is complete. The completion handler for any prior seek request that is still in process will be invoked immediately with the finished parameter set to NO. If the new request completes without being interrupted by another seek request or by any other operation the specified completion handler will be invoked with the finished parameter set to YES. If the seek time is outside of seekable time ranges as indicated by seekableTimeRanges property, the seek request will be cancelled and the completion handler will be invoked with the finished parameter set to NO.
time - completionHandler - public void seekToTimeToleranceBeforeToleranceAfter(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter)
Moves the playback cursor within a specified time bound.
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 the specified time for efficiency. Pass kCMTimeZero for both toleranceBefore and toleranceAfter to request sample accurate seeking which may incur additional decoding delay. Messaging this method with beforeTolerance:kCMTimePositiveInfinity and afterTolerance:kCMTimePositiveInfinity is the same as messaging seekToTime: 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. If the seek time is outside of seekable time ranges as indicated by seekableTimeRanges property, the seek request will be cancelled.
time - toleranceBefore - toleranceAfter - public void seekToTimeToleranceBeforeToleranceAfterCompletionHandler(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter, AVPlayerItem.Block_seekToTimeToleranceBeforeToleranceAfterCompletionHandler completionHandler)
Moves the playback cursor within a specified time bound and invokes the specified block when the seek operation has either been completed or been interrupted.
Use this method to seek to a specified time for the item and to be notified when the seek operation is complete. The time seeked to will be within the range [time-toleranceBefore, time+toleranceAfter] and may differ from the specified time for efficiency. Pass kCMTimeZero for both toleranceBefore and toleranceAfter to request sample accurate seeking which may incur additional decoding delay. Messaging this method with beforeTolerance:kCMTimePositiveInfinity and afterTolerance:kCMTimePositiveInfinity is the same as messaging seekToTime: directly. The completion handler for any prior seek request that is still in process will be invoked immediately with the finished parameter set to NO. If the new request completes without being interrupted by another seek request or by any other operation the specified completion handler will be invoked with the finished parameter set to YES. If the seek time is outside of seekable time ranges as indicated by seekableTimeRanges property, the seek request will be cancelled and the completion handler will be invoked with the finished parameter set to NO.
time - toleranceBefore - toleranceAfter - completionHandler - public NSArray<? extends NSValue> seekableTimeRanges()
This property provides a collection of time ranges that the player item can seek to. The ranges provided might be discontinous.
Returns an NSArray of NSValues containing CMTimeRanges.
public boolean seekingWaitsForVideoCompositionRendering()
Indicates whether the item's timing follows the displayed video frame when seeking with a video composition
By default, item timing is updated as quickly as possible, not waiting for media at new times to be rendered when seeking or during normal playback. The latency that occurs, for example, between the completion of a seek operation and the display of a video frame at a new time is negligible in most situations. However, when video compositions are in use, the processing of video for any particular time may introduce noticeable latency. Therefore it may be desirable when a video composition is in use for the item's timing be updated only after the video frame for a time has been displayed. This allows, for instance, an AVSynchronizedLayer associated with an AVPlayerItem to remain in synchronization with the displayed video and for the currentTime property to return the time of the displayed video.
This property has no effect on items for which videoComposition is nil.
public void selectMediaOptionInMediaSelectionGroup(AVMediaSelectionOption mediaSelectionOption, AVMediaSelectionGroup mediaSelectionGroup)
Selects the media option described by the specified instance of AVMediaSelectionOption in the specified AVMediaSelectionGroup and deselects all other options in that group.
If the specified media selection option isn't a member of the specified media selection group, no change in presentation state will result. If the value of the property allowsEmptySelection of the AVMediaSelectionGroup is YES, you can pass nil for mediaSelectionOption to deselect all media selection options in the group. Note that 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.
This method must be invoked on the main thread/queue.
mediaSelectionOption - The option to select.mediaSelectionGroup - The media selection group, obtained from the receiver's asset, that contains the specified option.public void selectMediaOptionAutomaticallyInMediaSelectionGroup(AVMediaSelectionGroup mediaSelectionGroup)
Selects the media option in the specified media selection group that best matches the AVPlayer's current automatic selection criteria. Also allows automatic selection to be re-applied to the specified group subsequently if the relevant criteria are changed.
Has no effect unless the appliesMediaSelectionCriteriaAutomatically property of the associated AVPlayer is YES and unless automatic media selection has previously been overridden via -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:].
This method must be invoked on the main thread/queue.
mediaSelectionGroup - The media selection group, obtained from the receiver's asset, that contains the specified option.public AVMediaSelectionOption selectedMediaOptionInMediaSelectionGroup(AVMediaSelectionGroup mediaSelectionGroup)
Indicates the media selection option that's currently selected from the specified group. May be nil.
If the value of the property allowsEmptySelection of the AVMediaSelectionGroup is YES, the currently selected option in the group may be nil.
mediaSelectionGroup - A media selection group obtained from the receiver's asset.public void setAudioMix(AVAudioMix value)
Indicates the audio mix parameters to be applied during playback
The inputParameters of the AVAudioMix must have trackIDs that correspond to a track of the receiver's asset. Otherwise they will be ignored. (See AVAudioMix.h for the declaration of AVAudioMixInputParameters and AVPlayerItem's asset property.)
public void setAudioTimePitchAlgorithm(java.lang.String value)
Indicates the processing algorithm used to manage audio pitch at varying rates and for scaled audio edits.
Constants for various time pitch algorithms, e.g. AVAudioTimePitchSpectral, are defined in AVAudioProcessingSettings.h. The default value for applications linked on or after iOS 15.0 or macOS 12.0 is AVAudioTimePitchAlgorithmTimeDomain. For iOS versions prior to 15.0 the default value is AVAudioTimePitchAlgorithmLowQualityZeroLatency. For macOS versions prior to 12.0 the default value is AVAudioTimePitchAlgorithmSpectral.
public void setCanUseNetworkResourcesForLiveStreamingWhilePaused(boolean value)
Indicates whether the player item can use network resources to keep playback state up to date while paused
For live streaming content, the player item may need to use extra networking and power resources to keep playback state up to date when paused. For example, when this property is set to YES, the seekableTimeRanges property will be periodically updated to reflect the current state of the live stream.
For clients linked on or after OS X 10.11 or iOS 9.0, the default value is NO. To minimize power usage, avoid setting this property to YES when you do not need playback state to stay up to date while paused.
public void setForwardPlaybackEndTime(CMTime value)
The end time for forward playback.
Specifies 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 receiver's duration.
When the end time is reached, the receiver will post AVPlayerItemDidPlayToEndTimeNotification and the AVPlayer will take the action indicated by the value of its actionAtItemEnd property (see AVPlayerActionAtItemEnd in AVPlayer.h).
The value of this property has no effect on playback when the rate is negative.
public void setPreferredForwardBufferDuration(double value)
Indicates the media duration the caller prefers the player to buffer from the network ahead of the playhead to guard against playback disruption.
The value is in seconds. If it is set to 0, the player will choose an appropriate level of buffering for most use cases. Note that setting this property to a low value will increase the chance that playback will stall and re-buffer, while setting it to a high value will increase demand on system resources. Note that the system may buffer less than the value of this property in order to manage resource consumption.
public void setPreferredPeakBitRate(double value)
Indicates the desired limit of network bandwidth consumption for this item.
Set preferredPeakBitRate to non-zero to indicate that the player should attempt to limit item playback to that bit rate, expressed in bits per second.
If network bandwidth consumption cannot be lowered to meet the preferredPeakBitRate, it will be reduced as much as possible while continuing to play the item.
public void setReversePlaybackEndTime(CMTime value)
The end time for reverse playback.
Specifies 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.
When the end time is reached, the receiver will post AVPlayerItemDidPlayToEndTimeNotification and the AVPlayer will take the action indicated by the value of its actionAtItemEnd property (see AVPlayerActionAtItemEnd in AVPlayer.h).
The value of this property has no effect on playback when the rate is positive.
public void setSeekingWaitsForVideoCompositionRendering(boolean value)
Indicates whether the item's timing follows the displayed video frame when seeking with a video composition
By default, item timing is updated as quickly as possible, not waiting for media at new times to be rendered when seeking or during normal playback. The latency that occurs, for example, between the completion of a seek operation and the display of a video frame at a new time is negligible in most situations. However, when video compositions are in use, the processing of video for any particular time may introduce noticeable latency. Therefore it may be desirable when a video composition is in use for the item's timing be updated only after the video frame for a time has been displayed. This allows, for instance, an AVSynchronizedLayer associated with an AVPlayerItem to remain in synchronization with the displayed video and for the currentTime property to return the time of the displayed video.
This property has no effect on items for which videoComposition is nil.
public void setTextStyleRules(NSArray<? extends AVTextStyleRule> value)
An array of AVTextStyleRules representing text styling that can be applied to subtitles and other legible media.
The styling information contained in each AVTextStyleRule object in the array is used only when no equivalent styling information is provided by the media resource being played. For example, if the text style rules specify Courier font but the media resource specifies Helvetica font, the text will be drawn using Helvetica font.
This property has an effect only for tracks with media subtype kCMSubtitleFormatType_WebVTT.
public void setVideoComposition(AVVideoComposition value)
Indicates the video composition settings to be applied during playback.
This property must be accessed on the main thread/queue.
public long status()
The ability of the receiver to be used for playback.
The value of this property is an AVPlayerItemStatus that indicates whether the receiver can be used for playback. When the value of this property is AVPlayerItemStatusFailed, the receiver can no longer be used for playback and a new instance needs to be created in its place. When this happens, clients can check the value of the error property to determine the nature of the failure. The value of this property will not be updated after the receiver is removed from an AVPlayer. This property is key value observable.
public void stepByCount(long stepCount)
Moves player's current item's current time forward or backward by the specified number of steps.
The size of each step depends on the enabled AVPlayerItemTracks of the AVPlayerItem.
This method must be invoked on the main thread/queue.
stepCount - The number of steps by which to move. A positive number results in stepping forward, a negative number in stepping backward.public NSArray<? extends AVTextStyleRule> textStyleRules()
An array of AVTextStyleRules representing text styling that can be applied to subtitles and other legible media.
The styling information contained in each AVTextStyleRule object in the array is used only when no equivalent styling information is provided by the media resource being played. For example, if the text style rules specify Courier font but the media resource specifies Helvetica font, the text will be drawn using Helvetica font.
This property has an effect only for tracks with media subtype kCMSubtitleFormatType_WebVTT.
public CMTimebaseRef timebase()
The item's timebase.
You can examine the timebase to discover the relationship between the item's time and the source clock used for drift synchronization. This timebase is read-only; you cannot set its time or rate to affect playback. The value of this property may change during playback.
public NSArray<? extends AVMetadataItem> timedMetadata()
Provides an NSArray of AVMetadataItems representing the timed metadata encountered most recently within the media as it plays. May be nil.
Notifications of changes are available via key-value observation. As an optimization for playback, AVPlayerItem may omit the processing of timed metadata when no observer of this property is registered. Therefore, when no such observer is registered, the value of the timedMetadata property may remain nil regardless of the contents of the underlying media.
This property must be accessed on the main thread/queue.
public NSArray<? extends AVPlayerItemTrack> tracks()
Provides array of AVPlayerItem tracks. Observable (can change dynamically during playback).
The value of this property will accord with the properties of the underlying media resource when the receiver becomes ready to play. Before the underlying media resource has been sufficiently loaded, its value is an empty NSArray. Use key-value observation to obtain a valid array of tracks as soon as it becomes available.
public AVVideoComposition videoComposition()
Indicates the video composition settings to be applied during playback.
This property must be accessed on the main thread/queue.
public CGSize preferredMaximumResolution()
Indicates a preferred upper limit on the resolution of the video to be downloaded (or otherwise transferred) and rendered by the player.
The default value is CGSizeZero, which indicates that the client enforces no limit on video resolution. Other values indicate a preferred maximum video resolution. It only applies to HTTP Live Streaming asset.
public void setPreferredMaximumResolution(CGSize value)
Indicates a preferred upper limit on the resolution of the video to be downloaded (or otherwise transferred) and rendered by the player.
The default value is CGSizeZero, which indicates that the client enforces no limit on video resolution. Other values indicate a preferred maximum video resolution. It only applies to HTTP Live Streaming asset.
public void setVideoApertureMode(java.lang.String value)
Specifies the video aperture mode to apply during playback.
See AVVideoApertureMode constants defined in AVVideoSettings.h. Default is AVVideoApertureModeCleanAperture.
public java.lang.String videoApertureMode()
Specifies the video aperture mode to apply during playback.
See AVVideoApertureMode constants defined in AVVideoSettings.h. Default is AVVideoApertureModeCleanAperture.
public boolean automaticallyPreservesTimeOffsetFromLive()
Indicates that after the player spends a period of time buffering media, it will skip forward if necessary to restore the playhead's distance from the live edge of the presentation to what it was when buffering began.
If the value of this property is YES and the player must buffer media from the network in order to resume playback, the player will seek forward if necessary before resuming playback to restore the position that the playhead had when rebuffering began, relative to the end of the current AVPlayerItem's seekableTimeRange.
This behavior applies to media buffering that occurs as a consequence of starting playback, seeking, and recovering from a playback stall.
Note that if the network cannot deliver media quickly enough to maintain the playback rate, playback may stall interminably.
This property value has no effect if the asset is not a live stream. The default value of this property is NO.
public CMTime configuredTimeOffsetFromLive()
Indicates how close to the latest content in a live stream playback will begin after a live start or a seek to kCMTimePositiveInfinity.
For non-live assets this value is kCMTimeInvalid.
public boolean isAudioSpatializationAllowed()
Indicates whether audio spatialization is allowed
When audio spatialization is allowed for an AVPlayerItem, the AVPlayer may render multichannel audio if available even if the output device doesn't support multichannel audio on its own, via use of a synthetic channel layout. When audio spatialization is not allowed, the AVPlayer must render audio with a channel layout that best matches the capabilities of the output device. This property is not observable. Defaults to YES.
public CMTime recommendedTimeOffsetFromLive()
A recommended value for configuredTimeOffsetFromLive, based on observed network conditions.
For non-live assets this value is kCMTimeInvalid.
public void setAudioSpatializationAllowed(boolean value)
Indicates whether audio spatialization is allowed
When audio spatialization is allowed for an AVPlayerItem, the AVPlayer may render multichannel audio if available even if the output device doesn't support multichannel audio on its own, via use of a synthetic channel layout. When audio spatialization is not allowed, the AVPlayer must render audio with a channel layout that best matches the capabilities of the output device. This property is not observable. Defaults to YES.
public void setAutomaticallyPreservesTimeOffsetFromLive(boolean value)
Indicates that after the player spends a period of time buffering media, it will skip forward if necessary to restore the playhead's distance from the live edge of the presentation to what it was when buffering began.
If the value of this property is YES and the player must buffer media from the network in order to resume playback, the player will seek forward if necessary before resuming playback to restore the position that the playhead had when rebuffering began, relative to the end of the current AVPlayerItem's seekableTimeRange.
This behavior applies to media buffering that occurs as a consequence of starting playback, seeking, and recovering from a playback stall.
Note that if the network cannot deliver media quickly enough to maintain the playback rate, playback may stall interminably.
This property value has no effect if the asset is not a live stream. The default value of this property is NO.
public void setConfiguredTimeOffsetFromLive(CMTime value)
Indicates how close to the latest content in a live stream playback will begin after a live start or a seek to kCMTimePositiveInfinity.
For non-live assets this value is kCMTimeInvalid.
public NSArray<? extends AVMetadataItem> externalMetadata()
Supplements metadata contained in the asset.
AVPlayerViewController will publish this metadata as now playing info when AVPlayerViewController.updatesNowPlayingInfoCenter is YES.
public void setExternalMetadata(NSArray<? extends AVMetadataItem> value)
Supplements metadata contained in the asset.
AVPlayerViewController will publish this metadata as now playing info when AVPlayerViewController.updatesNowPlayingInfoCenter is YES.
public long allowedAudioSpatializationFormats()
Indicates the source audio channel layouts allowed by the receiver for spatialization.
Spatialization uses psychoacoustic methods to create a more immersive audio rendering when the content is played on specialized headphones and speaker arrangements. When an AVPlayerItem's allowedAudioSpatializationFormats property is set to AVAudioSpatializationFormatMonoAndStereo the AVPlayer will attempt to spatialize content tagged with a stereo channel layout, two-channel content with no layout specified as well as mono. It is considered incorrect to render a binaural recording with spatialization. A binaural recording is captured using two carefully placed microphones at each ear where the intent, when played on headphones, is to reproduce a naturally occurring spatial effect. Content tagged with a binaural channel layout will ignore this property value. When an AVPlayerItem's allowedAudioSpatializationFormats property is set to AVAudioSpatializationFormatMultichannel the AVPlayer will attempt to spatialize any decodable multichannel layout. Setting this property to AVAudioSpatializationFormatMonoStereoAndMultichannel indicates that the sender allows the AVPlayer to spatialize any decodable mono, stereo or multichannel layout. This property is not observable. The default value for this property with video content is AVAudioSpatializationFormatMonoStereoAndMultichannel. Otherwise, audio only content default value is AVAudioSpatializationFormatMultichannel.
public void setAllowedAudioSpatializationFormats(long value)
Indicates the source audio channel layouts allowed by the receiver for spatialization.
Spatialization uses psychoacoustic methods to create a more immersive audio rendering when the content is played on specialized headphones and speaker arrangements. When an AVPlayerItem's allowedAudioSpatializationFormats property is set to AVAudioSpatializationFormatMonoAndStereo the AVPlayer will attempt to spatialize content tagged with a stereo channel layout, two-channel content with no layout specified as well as mono. It is considered incorrect to render a binaural recording with spatialization. A binaural recording is captured using two carefully placed microphones at each ear where the intent, when played on headphones, is to reproduce a naturally occurring spatial effect. Content tagged with a binaural channel layout will ignore this property value. When an AVPlayerItem's allowedAudioSpatializationFormats property is set to AVAudioSpatializationFormatMultichannel the AVPlayer will attempt to spatialize any decodable multichannel layout. Setting this property to AVAudioSpatializationFormatMonoStereoAndMultichannel indicates that the sender allows the AVPlayer to spatialize any decodable mono, stereo or multichannel layout. This property is not observable. The default value for this property with video content is AVAudioSpatializationFormatMonoStereoAndMultichannel. Otherwise, audio only content default value is AVAudioSpatializationFormatMultichannel.
public void setStartsOnFirstEligibleVariant(boolean value)
Directs the player to start playback with the first eligible variant that appears in the stream's master playlist.
This property influences AVPlayer's algorithm for selecting which of the eligible variant streams in an HTTP Live Streaming master playlist is selected when playback first begins. In all cases, AVPlayer may switch to other variants during playback.
On releases prior to macOS 10.15, iOS 13, tvOS 13 and watchOS 6, AVPlayer starts HLS playback with the first eligible variant in the master playlist. On releases starting with macOS 10.15, iOS 13, tvOS 13 and watchOS 6, AVPlayer starts HLS playback by choosing an initial variant that optimizes the startup experience. On releases starting with macOS 11.0, iOS 14, tvOS 14 and watchOS 7, applications may set this property to YES to request that AVPlayer use the previous behaviour of using the first eligible variant in the master playlist. This would be appropriate, for example, for applications which wish to control initial variant selection by ordering the variants in the master playlist.
Note that changing this property may impact stream startup performance and quality. In order to be effective this property must be set before initial variant selection occurs. This property only applies to HTTP Live Streaming assets. The default value of this property is NO.
public boolean startsOnFirstEligibleVariant()
Directs the player to start playback with the first eligible variant that appears in the stream's master playlist.
This property influences AVPlayer's algorithm for selecting which of the eligible variant streams in an HTTP Live Streaming master playlist is selected when playback first begins. In all cases, AVPlayer may switch to other variants during playback.
On releases prior to macOS 10.15, iOS 13, tvOS 13 and watchOS 6, AVPlayer starts HLS playback with the first eligible variant in the master playlist. On releases starting with macOS 10.15, iOS 13, tvOS 13 and watchOS 6, AVPlayer starts HLS playback by choosing an initial variant that optimizes the startup experience. On releases starting with macOS 11.0, iOS 14, tvOS 14 and watchOS 7, applications may set this property to YES to request that AVPlayer use the previous behaviour of using the first eligible variant in the master playlist. This would be appropriate, for example, for applications which wish to control initial variant selection by ordering the variants in the master playlist.
Note that changing this property may impact stream startup performance and quality. In order to be effective this property must be set before initial variant selection occurs. This property only applies to HTTP Live Streaming assets. The default value of this property is NO.
public boolean appliesPerFrameHDRDisplayMetadata()
public void setAppliesPerFrameHDRDisplayMetadata(boolean value)
public boolean automaticallyHandlesInterstitialEvents()
Allows interstitials to be played according to a schedule that's specified by server-side directives. The default value is YES. A value of NO prevents automatic scheduling of future server-side interstitial events. Events specified by an AVPlayerInterstitialEventController override server-side events, regardless of the value of this property.
This property must be accessed on the main thread/queue.
public CGSize preferredMaximumResolutionForExpensiveNetworks()
Indicates a preferred upper limit on the resolution of the video to be downloaded that applies only when the download occurs over expensive networks.
The default value is CGSizeZero, which indicates that the client enforces no limit on video resolution. Other values indicate a preferred maximum video resolution. This limit applies only when streaming over an expensive network, such as when using a cellular data plan. (See -[NWPath isExpensive])
It only applies to HTTP Live Streaming asset.
Note that preferredMaximumResolution still applies unconditionally. If preferredMaximumResolutionForExpensiveNetworks is less restrictive (higher resolution) than preferredMaximumResolution, preferredMaximumResolutionForExpensiveNetworks has no practical effect.
public double preferredPeakBitRateForExpensiveNetworks()
Indicates the desired limit of network bandwidth consumption for this item over expensive networks.
When preferredPeakBitRateForExpensiveNetworks is set to non-zero, the player will attempt to limit item playback to that bit rate when streaming over an expensive network, such as when using a cellular data plan. (See -[NWPath isExpensive])
If network bandwidth consumption cannot be lowered to meet the preferredPeakBitRateForExpensiveNetworks, it will be reduced as much as possible while continuing to play the item.
Note that preferredPeakBitRate still applies unconditionally. If preferredPeakBitRateForExpensiveNetworks is less restrictive (greater) than preferredPeakBitRate, preferredPeakBitRateForExpensiveNetworks has no practical effect.
public void setAutomaticallyHandlesInterstitialEvents(boolean value)
Allows interstitials to be played according to a schedule that's specified by server-side directives. The default value is YES. A value of NO prevents automatic scheduling of future server-side interstitial events. Events specified by an AVPlayerInterstitialEventController override server-side events, regardless of the value of this property.
This property must be accessed on the main thread/queue.
public void setPreferredMaximumResolutionForExpensiveNetworks(CGSize value)
Indicates a preferred upper limit on the resolution of the video to be downloaded that applies only when the download occurs over expensive networks.
The default value is CGSizeZero, which indicates that the client enforces no limit on video resolution. Other values indicate a preferred maximum video resolution. This limit applies only when streaming over an expensive network, such as when using a cellular data plan. (See -[NWPath isExpensive])
It only applies to HTTP Live Streaming asset.
Note that preferredMaximumResolution still applies unconditionally. If preferredMaximumResolutionForExpensiveNetworks is less restrictive (higher resolution) than preferredMaximumResolution, preferredMaximumResolutionForExpensiveNetworks has no practical effect.
public void setPreferredPeakBitRateForExpensiveNetworks(double value)
Indicates the desired limit of network bandwidth consumption for this item over expensive networks.
When preferredPeakBitRateForExpensiveNetworks is set to non-zero, the player will attempt to limit item playback to that bit rate when streaming over an expensive network, such as when using a cellular data plan. (See -[NWPath isExpensive])
If network bandwidth consumption cannot be lowered to meet the preferredPeakBitRateForExpensiveNetworks, it will be reduced as much as possible while continuing to play the item.
Note that preferredPeakBitRate still applies unconditionally. If preferredPeakBitRateForExpensiveNetworks is less restrictive (greater) than preferredPeakBitRate, preferredPeakBitRateForExpensiveNetworks has no practical effect.
public void setVariantPreferences(long value)
Indicates preferences for variant switching.
Changing variant preferences during playback may result in a variant switch. The default value is AVVariantPreferenceNone.
public AVPlayerItem templatePlayerItem()
If the item was created automatically according to a template item for looping, for interstitial playback, or for other purposes, indicates the AVPlayerItem that was used as the template.
public long variantPreferences()
Indicates preferences for variant switching.
Changing variant preferences during playback may result in a variant switch. The default value is AVVariantPreferenceNone.