Package apple.avfoundation
Class AVPlayer
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.avfoundation.AVPlayer
-
- All Implemented Interfaces:
NSObject
- Direct Known Subclasses:
AVQueuePlayer
public class AVPlayer extends NSObject
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAVPlayer.Block_addBoundaryTimeObserverForTimesQueueUsingBlockstatic interfaceAVPlayer.Block_addPeriodicTimeObserverForIntervalQueueUsingBlockstatic interfaceAVPlayer.Block_prerollAtRateCompletionHandlerstatic interfaceAVPlayer.Block_seekToDateCompletionHandlerstatic interfaceAVPlayer.Block_seekToTimeCompletionHandlerstatic interfaceAVPlayer.Block_seekToTimeToleranceBeforeToleranceAfterCompletionHandler-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAVPlayer(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()longactionAtItemEnd()indicates the action that the player should perform when playback of an item reaches its end timejava.lang.ObjectaddBoundaryTimeObserverForTimesQueueUsingBlock(NSArray<? extends NSValue> times, NSObject queue, AVPlayer.Block_addBoundaryTimeObserverForTimesQueueUsingBlock block)addBoundaryTimeObserverForTimes:queue:usingBlock: Requests invocation of a block when specified times are traversed during normal playback.java.lang.ObjectaddPeriodicTimeObserverForIntervalQueueUsingBlock(CMTime interval, NSObject queue, AVPlayer.Block_addPeriodicTimeObserverForIntervalQueueUsingBlock block)addPeriodicTimeObserverForInterval:queue:usingBlock: Requests invocation of a block during playback to report changing time.static AVPlayeralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)booleanallowsAirPlayVideo()Deprecated.booleanallowsExternalPlayback()Indicates whether the player allows switching to "external playback" mode.booleanappliesMediaSelectionCriteriaAutomatically()Indicates whether the receiver should apply the current selection criteria automatically to AVPlayerItems.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)booleanautomaticallyWaitsToMinimizeStalling()[@property] automaticallyWaitsToMinimizeStalling Indicates that the player is allowed to delay playback at the specified rate in order to minimize stalling When this property is YES, whenever 1) the rate is set from zero to non-zero or 2) the playback buffer becomes empty and playback stalls, the player will attempt to determine if, at the specified rate, its currentItem will play to the end without interruptions.static longavailableHDRModes()[@property] availableHDRModes An AVPlayerHDRMode value that indicates the HDR modes the device can play to an appropriate display.voidcancelPendingPrerolls()cancelPendingPrerolls Cancel any pending preroll requests and invoke the corresponding completion handlers if present.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()AVPlayerItemcurrentItem()indicates the current item of the playerCMTimecurrentTime()currentTime Returns the current time of the current item.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()static booleaneligibleForHDRPlayback()[@property] eligibleForHDRPlayback Indicates whether HDR content can be played to an appropriate display.NSErrorerror()[@property] error If the receiver's status is AVPlayerStatusFailed, this describes the error that caused the failure.java.lang.StringexternalPlaybackVideoGravity()Video gravity strictly for "external playback" mode, one of AVLayerVideoGravity* defined in AVAnimation.hstatic longhash_static()AVPlayerinit()AVPlayerinitWithPlayerItem(AVPlayerItem item)initWithPlayerItem: Create an AVPlayer that plays a single audiovisual item.AVPlayerinitWithURL(NSURL URL)initWithURL: Initializes an AVPlayer that plays a single audiovisual resource referenced by URL.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisAirPlayVideoActive()Deprecated.booleanisClosedCaptionDisplayEnabled()[@property] closedCaptionDisplayEnabled Indicates whether display of closed captions is enabled.booleanisExternalPlaybackActive()Indicates whether the player is currently playing video in "external playback" mode.booleanisMuted()indicates whether or not audio output of the player is muted.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)CMClockRefmasterClock()NULL by default.AVPlayerMediaSelectionCriteriamediaSelectionCriteriaForMediaCharacteristic(java.lang.String mediaCharacteristic)mediaSelectionCriteriaForMediaCharacteristic: Returns the automatic selection criteria for media that has the specified media characteristic.static java.lang.Objectnew_objc()booleanoutputObscuredDueToInsufficientExternalProtection()[@property] outputObscuredDueToInsufficientExternalProtection Whether or not decoded output is being obscured due to insufficient external protection.voidpause()pause Pauses playback.voidplay()play Signals the desire to begin playback at the current item's natural rate.static AVPlayerplayerWithPlayerItem(AVPlayerItem item)playerWithPlayerItem: Create an AVPlayer that plays a single audiovisual item.static AVPlayerplayerWithURL(NSURL URL)playerWithURL: Returns an instance of AVPlayer that plays a single audiovisual resource referenced by URL.voidplayImmediatelyAtRate(float rate)playImmediatelyAtRate: Immediately plays the available media data at the specified rate.voidprerollAtRateCompletionHandler(float rate, AVPlayer.Block_prerollAtRateCompletionHandler completionHandler)prerollAtRate:completionHandler: Begins loading media data to prime the render pipelines for playback from the current time with the given rate.booleanpreventsDisplaySleepDuringVideoPlayback()[@property] preventsDisplaySleepDuringVideoPlayback Indicates whether video playback prevents display and device sleep.floatrate()[@property] rate Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a desire to play at the natural rate of the current item.java.lang.StringreasonForWaitingToPlay()[@property] reasonForWaitingToPlay Indicates the reason for waiting when the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate When the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate, this property describes why the player is currently waiting.voidremoveTimeObserver(java.lang.Object observer)removeTimeObserver: Cancels a previously registered time observer.voidreplaceCurrentItemWithPlayerItem(AVPlayerItem item)replaceCurrentItemWithPlayerItem: Replaces the player's current item with the specified player item.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidseekToDate(NSDate date)seekToDate: Moves the playback cursor.voidseekToDateCompletionHandler(NSDate date, AVPlayer.Block_seekToDateCompletionHandler completionHandler)seekToDate:completionHandler: Moves the playback cursor and invokes the specified block when the seek operation has either been completed or been interrupted.voidseekToTime(CMTime time)seekToTime: Moves the playback cursor.voidseekToTimeCompletionHandler(CMTime time, AVPlayer.Block_seekToTimeCompletionHandler completionHandler)seekToTime:completionHandler: Moves the playback cursor and invokes the specified block when the seek operation has either been completed or been interrupted.voidseekToTimeToleranceBeforeToleranceAfter(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter)seekToTime:toleranceBefore:toleranceAfter: Moves the playback cursor within a specified time bound.voidseekToTimeToleranceBeforeToleranceAfterCompletionHandler(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter, AVPlayer.Block_seekToTimeToleranceBeforeToleranceAfterCompletionHandler completionHandler)seekToTime:toleranceBefore:toleranceAfter: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.voidsetActionAtItemEnd(long value)indicates the action that the player should perform when playback of an item reaches its end timevoidsetAllowsAirPlayVideo(boolean value)Deprecated.voidsetAllowsExternalPlayback(boolean value)Indicates whether the player allows switching to "external playback" mode.voidsetAppliesMediaSelectionCriteriaAutomatically(boolean value)Indicates whether the receiver should apply the current selection criteria automatically to AVPlayerItems.voidsetAutomaticallyWaitsToMinimizeStalling(boolean value)[@property] automaticallyWaitsToMinimizeStalling Indicates that the player is allowed to delay playback at the specified rate in order to minimize stalling When this property is YES, whenever 1) the rate is set from zero to non-zero or 2) the playback buffer becomes empty and playback stalls, the player will attempt to determine if, at the specified rate, its currentItem will play to the end without interruptions.voidsetClosedCaptionDisplayEnabled(boolean value)[@property] closedCaptionDisplayEnabled Indicates whether display of closed captions is enabled.voidsetExternalPlaybackVideoGravity(java.lang.String value)Video gravity strictly for "external playback" mode, one of AVLayerVideoGravity* defined in AVAnimation.hvoidsetMasterClock(CMClockRef value)NULL by default.voidsetMediaSelectionCriteriaForMediaCharacteristic(AVPlayerMediaSelectionCriteria criteria, java.lang.String mediaCharacteristic)setMediaSelectionCriteria:forMediaCharacteristic: Applies automatic selection criteria for media that has the specified media characteristic.voidsetMuted(boolean value)indicates whether or not audio output of the player is muted.voidsetPreventsDisplaySleepDuringVideoPlayback(boolean value)[@property] preventsDisplaySleepDuringVideoPlayback Indicates whether video playback prevents display and device sleep.voidsetRate(float value)[@property] rate Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a desire to play at the natural rate of the current item.voidsetRateTimeAtHostTime(float rate, CMTime itemTime, CMTime hostClockTime)setRate:time:atHostTime: Simultaneously sets the playback rate and the relationship between the current item's current time and host time.voidsetUsesAirPlayVideoWhileAirPlayScreenIsActive(boolean value)Deprecated.voidsetUsesExternalPlaybackWhileExternalScreenIsActive(boolean value)Indicates whether the player should automatically switch to "external playback" mode while the "external screen" mode is active in order to play video content and switching back to "external screen" mode as soon as playback is done.static voidsetVersion_static(long aVersion)voidsetVolume(float value)Indicates the current audio volume of the player; 0.0 means "silence all audio", 1.0 means "play at the full volume of the current item".longstatus()[@property] status The ability of the receiver to be used for playback.static org.moe.natj.objc.Classsuperclass_static()longtimeControlStatus()[@property] timeControlStatus Indicates whether playback is currently paused indefinitely, suspended while waiting for appropriate conditions, or in progress.booleanusesAirPlayVideoWhileAirPlayScreenIsActive()Deprecated.booleanusesExternalPlaybackWhileExternalScreenIsActive()Indicates whether the player should automatically switch to "external playback" mode while the "external screen" mode is active in order to play video content and switching back to "external screen" mode as soon as playback is done.static longversion_static()floatvolume()Indicates the current audio volume of the player; 0.0 means "silence all audio", 1.0 means "play at the full volume of the current item".-
Methods inherited from class apple.NSObject
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, copy, 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, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static AVPlayer alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
playerWithPlayerItem
public static AVPlayer playerWithPlayerItem(AVPlayerItem item)
playerWithPlayerItem: Create an AVPlayer that plays a single audiovisual item. Useful in order to play items for which an AVAsset has previously been created. See -[AVPlayerItem initWithAsset:].- Parameters:
item-- Returns:
- An instance of AVPlayer
-
playerWithURL
public static AVPlayer playerWithURL(NSURL URL)
playerWithURL: Returns an instance of AVPlayer that plays a single audiovisual resource referenced by URL. Implicitly creates an AVPlayerItem. Clients can obtain the AVPlayerItem as it becomes the player's currentItem.- Parameters:
URL-- Returns:
- An instance of AVPlayer
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
actionAtItemEnd
public long actionAtItemEnd()
indicates the action that the player should perform when playback of an item reaches its end time
-
addBoundaryTimeObserverForTimesQueueUsingBlock
public java.lang.Object addBoundaryTimeObserverForTimesQueueUsingBlock(NSArray<? extends NSValue> times, NSObject queue, AVPlayer.Block_addBoundaryTimeObserverForTimesQueueUsingBlock block)
addBoundaryTimeObserverForTimes:queue:usingBlock: Requests invocation of a block when specified times are traversed during normal playback. Each call to -addPeriodicTimeObserverForInterval:queue:usingBlock: should be paired with a corresponding call to -removeTimeObserver:. Releasing the observer object without a call to -removeTimeObserver: will result in undefined behavior.- Parameters:
times- The times for which the observer requests notification, supplied as an array of NSValues carrying CMTimes.queue- The serial queue onto which block should be enqueued. If you pass NULL, the main queue (obtained using dispatch_get_main_queue()) will be used. Passing a concurrent queue to this method will result in undefined behavior.block- The block to be invoked when any of the specified times is crossed during normal playback.- Returns:
- An object conforming to the NSObject protocol. You must retain this returned value as long as you want the time observer to be invoked by the player. Pass this object to -removeTimeObserver: to cancel time observation.
-
addPeriodicTimeObserverForIntervalQueueUsingBlock
public java.lang.Object addPeriodicTimeObserverForIntervalQueueUsingBlock(CMTime interval, NSObject queue, AVPlayer.Block_addPeriodicTimeObserverForIntervalQueueUsingBlock block)
addPeriodicTimeObserverForInterval:queue:usingBlock: Requests invocation of a block during playback to report changing time. The block is invoked periodically at the interval specified, interpreted according to the timeline of the current item. The block is also invoked whenever time jumps and whenever playback starts or stops. If the interval corresponds to a very short interval in real time, the player may invoke the block less frequently than requested. Even so, the player will invoke the block sufficiently often for the client to update indications of the current time appropriately in its end-user interface. Each call to -addPeriodicTimeObserverForInterval:queue:usingBlock: should be paired with a corresponding call to -removeTimeObserver:. Releasing the observer object without a call to -removeTimeObserver: will result in undefined behavior.- Parameters:
interval- The interval of invocation of the block during normal playback, according to progress of the current time of the player.queue- The serial queue onto which block should be enqueued. If you pass NULL, the main queue (obtained using dispatch_get_main_queue()) will be used. Passing a concurrent queue to this method will result in undefined behavior.block- The block to be invoked periodically.- Returns:
- An object conforming to the NSObject protocol. You must retain this returned value as long as you want the time observer to be invoked by the player. Pass this object to -removeTimeObserver: to cancel time observation.
-
allowsAirPlayVideo
@Deprecated public boolean allowsAirPlayVideo()
Deprecated.Indicates whether the player allows AirPlay Video playback. The default value is YES. This property is deprecated. Use AVPlayer's -allowsExternalPlayback instead.
-
allowsExternalPlayback
public boolean allowsExternalPlayback()
Indicates whether the player allows switching to "external playback" mode. The default value is YES.
-
appliesMediaSelectionCriteriaAutomatically
public boolean appliesMediaSelectionCriteriaAutomatically()
Indicates whether the receiver should apply the current selection criteria automatically to AVPlayerItems. For clients linked against the iOS 7 SDK or later or against the OS X 10.9 SDK or later, the default is YES. For all others, the default is NO. By default, AVPlayer applies selection criteria based on system preferences. To override the default criteria for any media selection group, use -[AVPlayer setMediaSelectionCriteria:forMediaCharacteristic:].
-
automaticallyWaitsToMinimizeStalling
public boolean automaticallyWaitsToMinimizeStalling()
[@property] automaticallyWaitsToMinimizeStalling Indicates that the player is allowed to delay playback at the specified rate in order to minimize stalling When this property is YES, whenever 1) the rate is set from zero to non-zero or 2) the playback buffer becomes empty and playback stalls, the player will attempt to determine if, at the specified rate, its currentItem will play to the end without interruptions. Should it determine that such interruptions would occur and these interruptions can be avoided by delaying the start or resumption of playback, the value of timeControlStatus will become AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate and playback will start automatically when the likelihood of stalling has been minimized. You may want to set this property to NO when you need precise control over playback start times, e.g., when synchronizing multiple instances of AVPlayer, and you should set it to NO if you use an AVAssetResourceLoader delegate to load media data (more on this below). If the value of this property is NO, reasonForWaitingToPlay cannot assume a value of AVPlayerWaitingToMinimizeStallsReason. This implies that setting rate to a non-zero value in AVPlayerTimeControlStatusPaused will cause playback to start immediately as long as the playback buffer is not empty. When the playback buffer becomes empty during AVPlayerTimeControlStatusPlaying and playback stalls, playback state will switch to AVPlayerTimeControlStatusPaused and the rate will become 0.0. Changing the value of this property to NO while the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate with a reasonForWaitingToPlay of AVPlayerWaitingToMinimizeStallsReason will cause the player to attempt playback at the specified rate immediately. For clients linked against iOS 10.0 and running on that version or later or linked against OS X 10.12 and running on that version or later, the default value of this property is YES. In versions of iOS prior to iOS 10.0 and versions of OS X prior to 10.12, this property is unavailable, and the behavior of the AVPlayer corresponds to the type of content being played. For streaming content, including HTTP Live Streaming, the AVPlayer acts as if automaticallyWaitsToMinimizeStalling is YES. For file-based content, including file-based content accessed via progressive http download, the AVPlayer acts as if automaticallyWaitsToMinimizeStalling is NO. If you employ an AVAssetResourceLoader delegate that loads media data for playback, you should set the value of your AVPlayer’s automaticallyWaitsToMinimizeStalling property to NO. Allowing the value of automaticallyWaitsToMinimizeStalling to remain YES when an AVAssetResourceLoader delegate is used for the loading of media data can result in poor start-up times for playback and poor recovery from stalls, because the behaviors provided by AVPlayer when automaticallyWaitsToMinimizeStalling has a value of YES depend on predictions of the future availability of media data that that do not function as expected when data is loaded via a client-controlled means, using the AVAssetResourceLoader delegate interface. You can allow the value of automaticallyWaitsToMinimizeStalling to remain YES if you use an AVAssetResourceLoader delegate to manage content keys for FairPlay Streaming, to provide dynamically-generated master playlists for HTTP Live Streaming, or to respond to authentication challenges, but not to load media data for playback.
-
cancelPendingPrerolls
public void cancelPendingPrerolls()
cancelPendingPrerolls Cancel any pending preroll requests and invoke the corresponding completion handlers if present. Use this method to cancel and release the completion handlers for pending prerolls. The finished parameter of the completion handlers will be set to NO.
-
currentItem
public AVPlayerItem currentItem()
indicates the current item of the player
-
currentTime
public CMTime currentTime()
currentTime Returns the current time of the current item. Returns the current time of the current item. Not key-value observable; use -addPeriodicTimeObserverForInterval:queue:usingBlock: instead.- Returns:
- A CMTime
-
error
public NSError error()
[@property] error If the receiver's status is AVPlayerStatusFailed, 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 play items. If the receiver's status is not AVPlayerStatusFailed, the value of this property is nil.
-
externalPlaybackVideoGravity
public java.lang.String externalPlaybackVideoGravity()
Video gravity strictly for "external playback" mode, one of AVLayerVideoGravity* defined in AVAnimation.h
-
initWithPlayerItem
public AVPlayer initWithPlayerItem(AVPlayerItem item)
initWithPlayerItem: Create an AVPlayer that plays a single audiovisual item. Useful in order to play items for which an AVAsset has previously been created. See -[AVPlayerItem initWithAsset:].- Parameters:
item-- Returns:
- An instance of AVPlayer
-
initWithURL
public AVPlayer initWithURL(NSURL URL)
initWithURL: Initializes an AVPlayer that plays a single audiovisual resource referenced by URL. Implicitly creates an AVPlayerItem. Clients can obtain the AVPlayerItem as it becomes the player's currentItem.- Parameters:
URL-- Returns:
- An instance of AVPlayer
-
isAirPlayVideoActive
@Deprecated public boolean isAirPlayVideoActive()
Deprecated.Indicates whether the player is currently playing video via AirPlay. This property is deprecated. Use AVPlayer's -externalPlaybackActive instead.
-
isClosedCaptionDisplayEnabled
public boolean isClosedCaptionDisplayEnabled()
[@property] closedCaptionDisplayEnabled Indicates whether display of closed captions is enabled. This property is deprecated. When the value of appliesMediaSelectionCriteriaAutomatically is YES, the receiver will enable closed captions automatically either according to user preferences or, if you provide them, according to AVPlayerMediaSelectionCriteria for the media characteristic AVMediaCharacteristicLegible. If you want to determine whether closed captions may be available for a given AVPlayerItem, you can examine the AVMediaSelectionOptions in the AVMediaSelectionGroup for the characteristic AVMediaCharacteristicLegible, as vended by -[AVAsset mediaSelectionGroupForMediaCharacteristic:]. See AVMediaCharacteristicTranscribesSpokenDialogForAccessibility and AVMediaCharacteristicDescribesMusicAndSoundForAccessibility as documented in AVMediaFormat.h for information about how to identify legible media selection options that offer the features of closed captions for accessibility purposes. You can select or deselect a specific AVMediaSelectionOption via -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:]. For further information about Media Accessibility preferences, see MediaAccessibility framework documentation.
-
setClosedCaptionDisplayEnabled
public void setClosedCaptionDisplayEnabled(boolean value)
[@property] closedCaptionDisplayEnabled Indicates whether display of closed captions is enabled. This property is deprecated. When the value of appliesMediaSelectionCriteriaAutomatically is YES, the receiver will enable closed captions automatically either according to user preferences or, if you provide them, according to AVPlayerMediaSelectionCriteria for the media characteristic AVMediaCharacteristicLegible. If you want to determine whether closed captions may be available for a given AVPlayerItem, you can examine the AVMediaSelectionOptions in the AVMediaSelectionGroup for the characteristic AVMediaCharacteristicLegible, as vended by -[AVAsset mediaSelectionGroupForMediaCharacteristic:]. See AVMediaCharacteristicTranscribesSpokenDialogForAccessibility and AVMediaCharacteristicDescribesMusicAndSoundForAccessibility as documented in AVMediaFormat.h for information about how to identify legible media selection options that offer the features of closed captions for accessibility purposes. You can select or deselect a specific AVMediaSelectionOption via -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:]. For further information about Media Accessibility preferences, see MediaAccessibility framework documentation.
-
isExternalPlaybackActive
public boolean isExternalPlaybackActive()
Indicates whether the player is currently playing video in "external playback" mode.
-
isMuted
public boolean isMuted()
indicates whether or not audio output of the player is muted. Only affects audio muting for the player instance and not for the device.
-
setMuted
public void setMuted(boolean value)
indicates whether or not audio output of the player is muted. Only affects audio muting for the player instance and not for the device.
-
masterClock
public CMClockRef masterClock()
NULL by default. if not NULL, overrides the automatic choice of master clock for item timebases. This is most useful for synchronizing video-only movies with audio played via other means. IMPORTANT: If you specify a master clock other than the appropriate audio device clock, audio may drift out of sync.
-
mediaSelectionCriteriaForMediaCharacteristic
public AVPlayerMediaSelectionCriteria mediaSelectionCriteriaForMediaCharacteristic(java.lang.String mediaCharacteristic)
mediaSelectionCriteriaForMediaCharacteristic: Returns the automatic selection criteria for media that has the specified media characteristic.- Parameters:
mediaCharacteristic- The media characteristic for which the selection criteria is to be returned. Supported values include AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual.
-
outputObscuredDueToInsufficientExternalProtection
public boolean outputObscuredDueToInsufficientExternalProtection()
[@property] outputObscuredDueToInsufficientExternalProtection Whether or not decoded output is being obscured due to insufficient external protection. The value of this property indicates whether the player is purposefully obscuring the visual output of the current item because the requirement for an external protection mechanism is not met by the current device configuration. It is highly recommended that clients whose content requires external protection observe this property and set the playback rate to zero and display an appropriate user interface when the value changes to YES. This property is key value observable. Note that the value of this property is dependent on the external protection requirements of the current item. These requirements are inherent to the content itself and cannot be externally specified. If the current item does not require external protection, the value of this property will be NO.
-
pause
public void pause()
pause Pauses playback. Equivalent to setting the value of rate to 0.0.
-
play
public void play()
play Signals the desire to begin playback at the current item's natural rate. Equivalent to setting the value of rate to 1.0.
-
playImmediatelyAtRate
public void playImmediatelyAtRate(float rate)
playImmediatelyAtRate: Immediately plays the available media data at the specified rate. When the player's currentItem has a value of NO for playbackBufferEmpty, this method causes the value of rate to change to the specified rate, the value of timeControlStatus to change to AVPlayerTimeControlStatusPlaying, and the receiver to play the available media immediately, whether or not prior buffering of media data is sufficient to ensure smooth playback. If insufficient media data is buffered for playback to start (e.g. if the current item has a value of YES for playbackBufferEmpty), the receiver will act as if the buffer became empty during playback, except that no AVPlayerItemPlaybackStalledNotification will be posted.
-
prerollAtRateCompletionHandler
public void prerollAtRateCompletionHandler(float rate, AVPlayer.Block_prerollAtRateCompletionHandler completionHandler)prerollAtRate:completionHandler: Begins loading media data to prime the render pipelines for playback from the current time with the given rate. Once the completion handler is called with YES, the player's rate can be set with minimal latency. The completion handler will be called with NO if the preroll is interrupted by a time change or incompatible rate change, or if preroll is not possible for some other reason. Call this method only when the rate is currently zero and only after the AVPlayer's status has become AVPlayerStatusReadyToPlay.- Parameters:
rate- The intended rate for subsequent playback.completionHandler- The block that will be called when the preroll is either completed or is interrupted.
-
rate
public float rate()
[@property] rate Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a desire to play at the natural rate of the current item. Setting the value of rate to 0.0 pauses playback, causing the value of timeControlStatus to change to AVPlayerTimeControlStatusPaused. Setting the rate to a non-zero value causes the value of timeControlStatus to become either AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate or AVPlayerTimeControlStatusPlaying, depending on whether sufficient media data has been buffered for playback to occur and whether the player's default behavior of waiting in order to minimize stalling is permitted. See discussion of AVPlayerTimeControlStatus for more details. AVPlayer can reset the desired rate to 0.0 when a change in overall state requires playback to be halted, such as when an interruption occurs on iOS, as announced by AVAudioSession, or when the playback buffer becomes empty and playback stalls while automaticallyWaitsToMinimizeStalling is NO. The effective rate of playback may differ from the desired rate even while timeControlStatus is AVPlayerTimeControlStatusPlaying, if the processing algorithm in use for managing audio pitch requires quantization of playback rate. For information about quantization of rates for audio processing, see AVAudioProcessingSettings.h. You can always obtain the effective rate of playback from the currentItem's timebase; see the timebase property of AVPlayerItem.
-
reasonForWaitingToPlay
public java.lang.String reasonForWaitingToPlay()
[@property] reasonForWaitingToPlay Indicates the reason for waiting when the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate When the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate, this property describes why the player is currently waiting. It is nil otherwise. You can use the value of reasonForWaitingToPlay to show UI indicating the player's waiting state conditionally. This property is key value observable. Possible values are AVPlayerWaitingWithNoItemToPlayReason, AVPlayerWaitingWhileEvaluatingBufferingRateReason, and AVPlayerWaitingToMinimizeStallsReason.
-
removeTimeObserver
public void removeTimeObserver(java.lang.Object observer)
removeTimeObserver: Cancels a previously registered time observer. Upon return, the caller is guaranteed that no new time observer blocks will begin executing. Depending on the calling thread and the queue used to add the time observer, an in-flight block may continue to execute after this method returns. You can guarantee synchronous time observer removal by enqueuing the call to -removeTimeObserver: on that queue. Alternatively, call dispatch_sync(queue, ^{}) after -removeTimeObserver: to wait for any in-flight blocks to finish executing. -removeTimeObserver: should be used to explicitly cancel each time observer added using -addPeriodicTimeObserverForInterval:queue:usingBlock: and -addBoundaryTimeObserverForTimes:queue:usingBlock:.- Parameters:
observer- An object returned by a previous call to -addPeriodicTimeObserverForInterval:queue:usingBlock: or -addBoundaryTimeObserverForTimes:queue:usingBlock:.
-
replaceCurrentItemWithPlayerItem
public void replaceCurrentItemWithPlayerItem(AVPlayerItem item)
replaceCurrentItemWithPlayerItem: Replaces the player's current item with the specified player item. In all releases of iOS 4, invoking replaceCurrentItemWithPlayerItem: with an AVPlayerItem that's already the receiver's currentItem results in an exception being raised. Starting with iOS 5, it's a no-op.- Parameters:
item- The AVPlayerItem that will become the player's current item.
-
seekToDate
public void seekToDate(NSDate date)
seekToDate: Moves the playback cursor. Use this method to seek to a specified time for the current player item. The time seeked to may differ from the specified time for efficiency. For sample accurate seeking see seekToTime:toleranceBefore:toleranceAfter:.- Parameters:
date-
-
seekToDateCompletionHandler
public void seekToDateCompletionHandler(NSDate date, AVPlayer.Block_seekToDateCompletionHandler completionHandler)
seekToDate: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 current player 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.- Parameters:
date-completionHandler-
-
seekToTime
public void seekToTime(CMTime time)
seekToTime: Moves the playback cursor. Use this method to seek to a specified time for the current player item. The time seeked to may differ from the specified time for efficiency. For sample accurate seeking see seekToTime:toleranceBefore:toleranceAfter:.- Parameters:
time-
-
seekToTimeCompletionHandler
public void seekToTimeCompletionHandler(CMTime time, AVPlayer.Block_seekToTimeCompletionHandler completionHandler)
seekToTime: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 current player 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.- Parameters:
time-completionHandler-
-
seekToTimeToleranceBeforeToleranceAfter
public void seekToTimeToleranceBeforeToleranceAfter(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter)
seekToTime:toleranceBefore:toleranceAfter: Moves the playback cursor within a specified time bound. Use this method to seek to a specified time for the current player 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.- Parameters:
time-toleranceBefore-toleranceAfter-
-
seekToTimeToleranceBeforeToleranceAfterCompletionHandler
public void seekToTimeToleranceBeforeToleranceAfterCompletionHandler(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter, AVPlayer.Block_seekToTimeToleranceBeforeToleranceAfterCompletionHandler completionHandler)
seekToTime:toleranceBefore:toleranceAfter: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 current player 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.- Parameters:
time-toleranceBefore-toleranceAfter-
-
setActionAtItemEnd
public void setActionAtItemEnd(long value)
indicates the action that the player should perform when playback of an item reaches its end time
-
setAllowsAirPlayVideo
@Deprecated public void setAllowsAirPlayVideo(boolean value)
Deprecated.Indicates whether the player allows AirPlay Video playback. The default value is YES. This property is deprecated. Use AVPlayer's -allowsExternalPlayback instead.
-
setAllowsExternalPlayback
public void setAllowsExternalPlayback(boolean value)
Indicates whether the player allows switching to "external playback" mode. The default value is YES.
-
setAppliesMediaSelectionCriteriaAutomatically
public void setAppliesMediaSelectionCriteriaAutomatically(boolean value)
Indicates whether the receiver should apply the current selection criteria automatically to AVPlayerItems. For clients linked against the iOS 7 SDK or later or against the OS X 10.9 SDK or later, the default is YES. For all others, the default is NO. By default, AVPlayer applies selection criteria based on system preferences. To override the default criteria for any media selection group, use -[AVPlayer setMediaSelectionCriteria:forMediaCharacteristic:].
-
setAutomaticallyWaitsToMinimizeStalling
public void setAutomaticallyWaitsToMinimizeStalling(boolean value)
[@property] automaticallyWaitsToMinimizeStalling Indicates that the player is allowed to delay playback at the specified rate in order to minimize stalling When this property is YES, whenever 1) the rate is set from zero to non-zero or 2) the playback buffer becomes empty and playback stalls, the player will attempt to determine if, at the specified rate, its currentItem will play to the end without interruptions. Should it determine that such interruptions would occur and these interruptions can be avoided by delaying the start or resumption of playback, the value of timeControlStatus will become AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate and playback will start automatically when the likelihood of stalling has been minimized. You may want to set this property to NO when you need precise control over playback start times, e.g., when synchronizing multiple instances of AVPlayer, and you should set it to NO if you use an AVAssetResourceLoader delegate to load media data (more on this below). If the value of this property is NO, reasonForWaitingToPlay cannot assume a value of AVPlayerWaitingToMinimizeStallsReason. This implies that setting rate to a non-zero value in AVPlayerTimeControlStatusPaused will cause playback to start immediately as long as the playback buffer is not empty. When the playback buffer becomes empty during AVPlayerTimeControlStatusPlaying and playback stalls, playback state will switch to AVPlayerTimeControlStatusPaused and the rate will become 0.0. Changing the value of this property to NO while the value of timeControlStatus is AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate with a reasonForWaitingToPlay of AVPlayerWaitingToMinimizeStallsReason will cause the player to attempt playback at the specified rate immediately. For clients linked against iOS 10.0 and running on that version or later or linked against OS X 10.12 and running on that version or later, the default value of this property is YES. In versions of iOS prior to iOS 10.0 and versions of OS X prior to 10.12, this property is unavailable, and the behavior of the AVPlayer corresponds to the type of content being played. For streaming content, including HTTP Live Streaming, the AVPlayer acts as if automaticallyWaitsToMinimizeStalling is YES. For file-based content, including file-based content accessed via progressive http download, the AVPlayer acts as if automaticallyWaitsToMinimizeStalling is NO. If you employ an AVAssetResourceLoader delegate that loads media data for playback, you should set the value of your AVPlayer’s automaticallyWaitsToMinimizeStalling property to NO. Allowing the value of automaticallyWaitsToMinimizeStalling to remain YES when an AVAssetResourceLoader delegate is used for the loading of media data can result in poor start-up times for playback and poor recovery from stalls, because the behaviors provided by AVPlayer when automaticallyWaitsToMinimizeStalling has a value of YES depend on predictions of the future availability of media data that that do not function as expected when data is loaded via a client-controlled means, using the AVAssetResourceLoader delegate interface. You can allow the value of automaticallyWaitsToMinimizeStalling to remain YES if you use an AVAssetResourceLoader delegate to manage content keys for FairPlay Streaming, to provide dynamically-generated master playlists for HTTP Live Streaming, or to respond to authentication challenges, but not to load media data for playback.
-
setExternalPlaybackVideoGravity
public void setExternalPlaybackVideoGravity(java.lang.String value)
Video gravity strictly for "external playback" mode, one of AVLayerVideoGravity* defined in AVAnimation.h
-
setMasterClock
public void setMasterClock(CMClockRef value)
NULL by default. if not NULL, overrides the automatic choice of master clock for item timebases. This is most useful for synchronizing video-only movies with audio played via other means. IMPORTANT: If you specify a master clock other than the appropriate audio device clock, audio may drift out of sync.
-
setMediaSelectionCriteriaForMediaCharacteristic
public void setMediaSelectionCriteriaForMediaCharacteristic(AVPlayerMediaSelectionCriteria criteria, java.lang.String mediaCharacteristic)
setMediaSelectionCriteria:forMediaCharacteristic: Applies automatic selection criteria for media that has the specified media characteristic. Criteria will be applied to an AVPlayerItem when: a) It is made ready to play b) Specific media selections are made by -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:] in a different group. The automatic choice in one group may be influenced by a specific selection in another group. c) Underlying system preferences change, e.g. system language, accessibility captions. Specific selections made by -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:] within any group will override automatic selection in that group until -[AVPlayerItem selectMediaOptionAutomaticallyInMediaSelectionGroup:] is received.- Parameters:
criteria- An instance of AVPlayerMediaSelectionCriteria.mediaCharacteristic- The media characteristic for which the selection criteria are to be applied. Supported values include AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual.
-
setRate
public void setRate(float value)
[@property] rate Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a desire to play at the natural rate of the current item. Setting the value of rate to 0.0 pauses playback, causing the value of timeControlStatus to change to AVPlayerTimeControlStatusPaused. Setting the rate to a non-zero value causes the value of timeControlStatus to become either AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate or AVPlayerTimeControlStatusPlaying, depending on whether sufficient media data has been buffered for playback to occur and whether the player's default behavior of waiting in order to minimize stalling is permitted. See discussion of AVPlayerTimeControlStatus for more details. AVPlayer can reset the desired rate to 0.0 when a change in overall state requires playback to be halted, such as when an interruption occurs on iOS, as announced by AVAudioSession, or when the playback buffer becomes empty and playback stalls while automaticallyWaitsToMinimizeStalling is NO. The effective rate of playback may differ from the desired rate even while timeControlStatus is AVPlayerTimeControlStatusPlaying, if the processing algorithm in use for managing audio pitch requires quantization of playback rate. For information about quantization of rates for audio processing, see AVAudioProcessingSettings.h. You can always obtain the effective rate of playback from the currentItem's timebase; see the timebase property of AVPlayerItem.
-
setRateTimeAtHostTime
public void setRateTimeAtHostTime(float rate, CMTime itemTime, CMTime hostClockTime)setRate:time:atHostTime: Simultaneously sets the playback rate and the relationship between the current item's current time and host time. You can use this function to synchronize playback with an external activity. The current item's timebase is adjusted so that its time will be (or was) itemTime when host time is (or was) hostClockTime. In other words: if hostClockTime is in the past, the timebase's time will be interpolated as though the timebase has been running at the requested rate since that time. If hostClockTime is in the future, the timebase will immediately start running at the requested rate from an earlier time so that it will reach the requested itemTime at the requested hostClockTime. (Note that the item's time will not jump backwards, but instead will sit at itemTime until the timebase reaches that time.) Note that setRate:time:atHostTime: is not supported when automaticallyWaitsToMinimizeStalling is YES. For clients linked against iOS 10.0 and later or OS X 12.0 and later, invoking setRate:time:atHostTime: when automaticallyWaitsToMinimizeStalling is YES will raise an NSInvalidArgument exception. Support for HTTP Live Streaming content requires iOS 11, tvOS 11, macOS 10.13 or later.- Parameters:
itemTime- The time to start playback from, specified precisely (i.e., with zero tolerance). Pass kCMTimeInvalid to use the current item's current time.hostClockTime- The host time at which to start playback. If hostClockTime is specified, the player will not ensure that media data is loaded before the timebase starts moving. If hostClockTime is kCMTimeInvalid, the rate and time will be set together, but without external synchronization; a host time in the near future will be used, allowing some time for media data loading.
-
setUsesAirPlayVideoWhileAirPlayScreenIsActive
@Deprecated public void setUsesAirPlayVideoWhileAirPlayScreenIsActive(boolean value)
Deprecated.Indicates whether the player should automatically switch to AirPlay Video while AirPlay Screen is active in order to play video content, switching back to AirPlay Screen as soon as playback is done. The default value is NO. Has no effect if allowsAirPlayVideo is NO. This property is deprecated. Use AVPlayer's -usesExternalPlaybackWhileExternalScreenIsActive instead.
-
setUsesExternalPlaybackWhileExternalScreenIsActive
public void setUsesExternalPlaybackWhileExternalScreenIsActive(boolean value)
Indicates whether the player should automatically switch to "external playback" mode while the "external screen" mode is active in order to play video content and switching back to "external screen" mode as soon as playback is done. Brief transition may be visible on the external display when automatically switching between the two modes. The default value is NO. Has no effect if allowsExternalPlayback is NO.
-
setVolume
public void setVolume(float value)
Indicates the current audio volume of the player; 0.0 means "silence all audio", 1.0 means "play at the full volume of the current item". iOS note: Do not use this property to implement a volume slider for media playback. For that purpose, use MPVolumeView, which is customizable in appearance and provides standard media playback behaviors that users expect. This property is most useful on iOS to control the volume of the AVPlayer relative to other audio output, not for volume control by end users.
-
status
public long status()
[@property] status The ability of the receiver to be used for playback. The value of this property is an AVPlayerStatus that indicates whether the receiver can be used for playback. When the value of this property is AVPlayerStatusFailed, 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. This property is key value observable.
-
timeControlStatus
public long timeControlStatus()
[@property] timeControlStatus Indicates whether playback is currently paused indefinitely, suspended while waiting for appropriate conditions, or in progress. For possible values and discussion, see AVPlayerTimeControlStatus. When automaticallyWaitsToMinimizeStalling is YES, absent intervention in the form of invocations of -setRate: or -pause or, on iOS, an interruption that requires user intervention before playback can resume, the value of the property timeControlStatus automatically changes between AVPlayerTimeControlStatusPlaying and AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate depending on whether sufficient media data is available to continue playback. This property is key value observable.
-
usesAirPlayVideoWhileAirPlayScreenIsActive
@Deprecated public boolean usesAirPlayVideoWhileAirPlayScreenIsActive()
Deprecated.Indicates whether the player should automatically switch to AirPlay Video while AirPlay Screen is active in order to play video content, switching back to AirPlay Screen as soon as playback is done. The default value is NO. Has no effect if allowsAirPlayVideo is NO. This property is deprecated. Use AVPlayer's -usesExternalPlaybackWhileExternalScreenIsActive instead.
-
usesExternalPlaybackWhileExternalScreenIsActive
public boolean usesExternalPlaybackWhileExternalScreenIsActive()
Indicates whether the player should automatically switch to "external playback" mode while the "external screen" mode is active in order to play video content and switching back to "external screen" mode as soon as playback is done. Brief transition may be visible on the external display when automatically switching between the two modes. The default value is NO. Has no effect if allowsExternalPlayback is NO.
-
volume
public float volume()
Indicates the current audio volume of the player; 0.0 means "silence all audio", 1.0 means "play at the full volume of the current item". iOS note: Do not use this property to implement a volume slider for media playback. For that purpose, use MPVolumeView, which is customizable in appearance and provides standard media playback behaviors that users expect. This property is most useful on iOS to control the volume of the AVPlayer relative to other audio output, not for volume control by end users.
-
availableHDRModes
public static long availableHDRModes()
[@property] availableHDRModes An AVPlayerHDRMode value that indicates the HDR modes the device can play to an appropriate display. A value of 0 indicates that no HDR modes are supported. This property indicates all of the HDR modes that the device can play. Each value indicates that an appropriate HDR display is available for the specified HDR mode. Additionally, the device must be capable of playing the specified HDR type. This property does not indicate whether video contains HDR content, whether HDR video is currently playing, or whether video is playing on an HDR display.
-
preventsDisplaySleepDuringVideoPlayback
public boolean preventsDisplaySleepDuringVideoPlayback()
[@property] preventsDisplaySleepDuringVideoPlayback Indicates whether video playback prevents display and device sleep. Default is YES on iOS, tvOS and in Mac Catalyst apps. Default is NO on macOS. Setting this property to NO does not force the display to sleep, it simply stops preventing display sleep. Other apps or frameworks within your app may still be preventing display sleep for various reasons.
-
setPreventsDisplaySleepDuringVideoPlayback
public void setPreventsDisplaySleepDuringVideoPlayback(boolean value)
[@property] preventsDisplaySleepDuringVideoPlayback Indicates whether video playback prevents display and device sleep. Default is YES on iOS, tvOS and in Mac Catalyst apps. Default is NO on macOS. Setting this property to NO does not force the display to sleep, it simply stops preventing display sleep. Other apps or frameworks within your app may still be preventing display sleep for various reasons.
-
eligibleForHDRPlayback
public static boolean eligibleForHDRPlayback()
[@property] eligibleForHDRPlayback Indicates whether HDR content can be played to an appropriate display. This property is YES if an HDR display is available and the device is capable of playing HDR content from an appropriate AVAsset, NO otherwise. This property does not indicate whether video contains HDR content, whether HDR video is currently playing, or whether video is playing on an HDR display. This property is not KVO observable.
-
-