Class AVPlayerItem

All Implemented Interfaces:
NSObjectProtocol, ObjCProtocol

public class AVPlayerItem
extends NSObject
  • Constructor Details

    • AVPlayerItem

      protected AVPlayerItem()
    • AVPlayerItem

      protected AVPlayerItem​(NSObject.Handle h, long handle)
    • AVPlayerItem

      protected AVPlayerItem​(NSObject.SkipInit skipInit)
    • AVPlayerItem

      public AVPlayerItem​(NSURL URL)
    • AVPlayerItem

      public AVPlayerItem​(AVAsset asset)
    • AVPlayerItem

      public AVPlayerItem​(AVAsset asset, List<String> automaticallyLoadedAssetKeys)
  • Method Details

    • getStatus

      public AVPlayerItemStatus getStatus()
    • getError

      public NSError getError()
    • getAsset

      public AVAsset getAsset()
    • getTracks

      public NSArray<AVPlayerItemTrack> getTracks()
    • getDuration

      public CMTime getDuration()
    • getPresentationSize

      public CGSize getPresentationSize()
    • getTimedMetadata

      @Deprecated public NSArray<AVMetadataItem> getTimedMetadata()
      Deprecated.
      Deprecated in iOS 13.0. Use AVPlayerItemMetadataOutput to obtain timed metadata
    • getAutomaticallyLoadedAssetKeys

      public List<String> getAutomaticallyLoadedAssetKeys()
    • canPlayFastForward

      public boolean canPlayFastForward()
    • canPlaySlowForward

      public boolean canPlaySlowForward()
    • canPlayReverse

      public boolean canPlayReverse()
    • canPlaySlowReverse

      public boolean canPlaySlowReverse()
    • canPlayFastReverse

      public boolean canPlayFastReverse()
    • canStepForward

      public boolean canStepForward()
    • canStepBackward

      public boolean canStepBackward()
    • getConfiguredTimeOffsetFromLive

      public CMTime getConfiguredTimeOffsetFromLive()
      Since:
      Available in iOS 13.0 and later.
    • setConfiguredTimeOffsetFromLive

      public void setConfiguredTimeOffsetFromLive​(CMTime v)
      Since:
      Available in iOS 13.0 and later.
    • getRecommendedTimeOffsetFromLive

      public CMTime getRecommendedTimeOffsetFromLive()
      Since:
      Available in iOS 13.0 and later.
    • automaticallyPreservesTimeOffsetFromLive

      public boolean automaticallyPreservesTimeOffsetFromLive()
      Since:
      Available in iOS 13.0 and later.
    • setAutomaticallyPreservesTimeOffsetFromLive

      public void setAutomaticallyPreservesTimeOffsetFromLive​(boolean v)
      Since:
      Available in iOS 13.0 and later.
    • getForwardPlaybackEndTime

      public CMTime getForwardPlaybackEndTime()
    • setForwardPlaybackEndTime

      public void setForwardPlaybackEndTime​(CMTime v)
    • getReversePlaybackEndTime

      public CMTime getReversePlaybackEndTime()
    • setReversePlaybackEndTime

      public void setReversePlaybackEndTime​(CMTime v)
    • getSeekableTimeRanges

      public List<CMTimeRange> getSeekableTimeRanges()
    • getTimebase

      public CMTimebase getTimebase()
    • getVideoComposition

      public AVVideoComposition getVideoComposition()
    • setVideoComposition

      public void setVideoComposition​(AVVideoComposition v)
    • getCustomVideoCompositor

      public AVVideoCompositing getCustomVideoCompositor()
    • seekingWaitsForVideoCompositionRendering

      public boolean seekingWaitsForVideoCompositionRendering()
    • seekingWaitsForVideoCompositionRendering

      public void seekingWaitsForVideoCompositionRendering​(boolean v)
    • getTextStyleRules

      public NSArray<AVTextStyleRule> getTextStyleRules()
    • setTextStyleRules

      public void setTextStyleRules​(NSArray<AVTextStyleRule> v)
    • getVideoApertureMode

      public AVVideoApertureMode getVideoApertureMode()
      Since:
      Available in iOS 11.0 and later.
    • setVideoApertureMode

      public void setVideoApertureMode​(AVVideoApertureMode v)
      Since:
      Available in iOS 11.0 and later.
    • appliesPerFrameHDRDisplayMetadata

      public boolean appliesPerFrameHDRDisplayMetadata()
      Since:
      Available in iOS 14.0 and later.
    • setAppliesPerFrameHDRDisplayMetadata

      public void setAppliesPerFrameHDRDisplayMetadata​(boolean v)
      Since:
      Available in iOS 14.0 and later.
    • getAudioTimePitchAlgorithm

      public String getAudioTimePitchAlgorithm()
    • setAudioTimePitchAlgorithm

      public void setAudioTimePitchAlgorithm​(String v)
    • isAudioSpatializationAllowed

      @Deprecated public boolean isAudioSpatializationAllowed()
      Deprecated.
      Use allowedAudioSpatializationFormats
      Since:
      Available in iOS 13.0 and later.
    • setAudioSpatializationAllowed

      @Deprecated public void setAudioSpatializationAllowed​(boolean v)
      Deprecated.
      Use allowedAudioSpatializationFormats
      Since:
      Available in iOS 13.0 and later.
    • getAllowedAudioSpatializationFormats

      public AVAudioSpatializationFormats getAllowedAudioSpatializationFormats()
      Since:
      Available in iOS 14.0 and later.
    • setAllowedAudioSpatializationFormats

      public void setAllowedAudioSpatializationFormats​(AVAudioSpatializationFormats v)
      Since:
      Available in iOS 14.0 and later.
    • getAudioMix

      public AVAudioMix getAudioMix()
    • setAudioMix

      public void setAudioMix​(AVAudioMix v)
    • getLoadedTimeRanges

      public List<CMTimeRange> getLoadedTimeRanges()
    • isPlaybackLikelyToKeepUp

      public boolean isPlaybackLikelyToKeepUp()
    • isPlaybackBufferFull

      public boolean isPlaybackBufferFull()
    • isPlaybackBufferEmpty

      public boolean isPlaybackBufferEmpty()
    • canUseNetworkResourcesForLiveStreamingWhilePaused

      public boolean canUseNetworkResourcesForLiveStreamingWhilePaused()
      Since:
      Available in iOS 9.0 and later.
    • setCanUseNetworkResourcesForLiveStreamingWhilePaused

      public void setCanUseNetworkResourcesForLiveStreamingWhilePaused​(boolean v)
      Since:
      Available in iOS 9.0 and later.
    • getPreferredForwardBufferDuration

      public double getPreferredForwardBufferDuration()
      Since:
      Available in iOS 10.0 and later.
    • setPreferredForwardBufferDuration

      public void setPreferredForwardBufferDuration​(double v)
      Since:
      Available in iOS 10.0 and later.
    • getPreferredPeakBitRate

      public double getPreferredPeakBitRate()
    • setPreferredPeakBitRate

      public void setPreferredPeakBitRate​(double v)
    • getPreferredPeakBitRateForExpensiveNetworks

      public double getPreferredPeakBitRateForExpensiveNetworks()
      Since:
      Available in iOS 15.0 and later.
    • setPreferredPeakBitRateForExpensiveNetworks

      public void setPreferredPeakBitRateForExpensiveNetworks​(double v)
      Since:
      Available in iOS 15.0 and later.
    • getPreferredMaximumResolution

      public CGSize getPreferredMaximumResolution()
      Since:
      Available in iOS 11.0 and later.
    • setPreferredMaximumResolution

      public void setPreferredMaximumResolution​(CGSize v)
      Since:
      Available in iOS 11.0 and later.
    • getPreferredMaximumResolutionForExpensiveNetworks

      public CGSize getPreferredMaximumResolutionForExpensiveNetworks()
      Since:
      Available in iOS 15.0 and later.
    • setPreferredMaximumResolutionForExpensiveNetworks

      public void setPreferredMaximumResolutionForExpensiveNetworks​(CGSize v)
      Since:
      Available in iOS 15.0 and later.
    • isStartsOnFirstEligibleVariant

      public boolean isStartsOnFirstEligibleVariant()
      Since:
      Available in iOS 14.0 and later.
    • setStartsOnFirstEligibleVariant

      public void setStartsOnFirstEligibleVariant​(boolean v)
      Since:
      Available in iOS 14.0 and later.
    • getVariantPreferences

      public AVVariantPreferences getVariantPreferences()
      Since:
      Available in iOS 14.5 and later.
    • setVariantPreferences

      public void setVariantPreferences​(AVVariantPreferences v)
      Since:
      Available in iOS 14.5 and later.
    • getCurrentMediaSelection

      public AVMediaSelection getCurrentMediaSelection()
      Since:
      Available in iOS 9.0 and later.
    • getOutputs

      public NSArray<AVPlayerItemOutput> getOutputs()
    • getMediaDataCollectors

      public NSArray<AVPlayerItemMediaDataCollector> getMediaDataCollectors()
      Since:
      Available in iOS 9.3 and later.
    • automaticallyHandlesInterstitialEvents

      public boolean automaticallyHandlesInterstitialEvents()
      Since:
      Available in iOS 15.0 and later.
    • setAutomaticallyHandlesInterstitialEvents

      public void setAutomaticallyHandlesInterstitialEvents​(boolean v)
      Since:
      Available in iOS 15.0 and later.
    • getTemplatePlayerItem

      public AVPlayerItem getTemplatePlayerItem()
      Since:
      Available in iOS 15.0 and later.
    • TimeJumpedNotification

      public static NSString TimeJumpedNotification()
    • DidPlayToEndTimeNotification

      public static NSString DidPlayToEndTimeNotification()
    • FailedToPlayToEndTimeNotification

      public static NSString FailedToPlayToEndTimeNotification()
    • PlaybackStalledNotification

      public static NSString PlaybackStalledNotification()
    • NewAccessLogEntryNotification

      public static NSString NewAccessLogEntryNotification()
    • NewErrorLogEntryNotification

      public static NSString NewErrorLogEntryNotification()
    • RecommendedTimeOffsetFromLiveDidChangeNotification

      public static NSString RecommendedTimeOffsetFromLiveDidChangeNotification()
      Since:
      Available in iOS 13.0 and later.
    • MediaSelectionDidChangeNotification

      public static NSString MediaSelectionDidChangeNotification()
      Since:
      Available in iOS 13.0 and later.
    • FailedToPlayToEndTimeErrorKey

      protected static NSString FailedToPlayToEndTimeErrorKey()
    • init

      protected long init​(NSURL URL)
    • init

      protected long init​(AVAsset asset)
    • init

      protected long init​(AVAsset asset, List<String> automaticallyLoadedAssetKeys)
    • copyWithZone

      public NSObject copyWithZone​(NSZone zone)
    • copy

      public NSObject copy()
      Overrides:
      copy in class NSObject
    • getCurrentTime

      public CMTime getCurrentTime()
    • seekToTime

      public void seekToTime​(CMTime time, VoidBooleanBlock completionHandler)
    • seekToTime

      public void seekToTime​(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter, VoidBooleanBlock completionHandler)
    • cancelPendingSeeks

      public void cancelPendingSeeks()
    • getCurrentDate

      public NSDate getCurrentDate()
    • seekToDate

      public boolean seekToDate​(NSDate date, VoidBooleanBlock completionHandler)
    • stepByCount

      public void stepByCount​(long stepCount)
    • selectMediaOption

      public void selectMediaOption​(AVMediaSelectionOption mediaSelectionOption, AVMediaSelectionGroup mediaSelectionGroup)
    • selectMediaOptionAutomatically

      public void selectMediaOptionAutomatically​(AVMediaSelectionGroup mediaSelectionGroup)
    • getAccessLog

      public AVPlayerItemAccessLog getAccessLog()
    • getErrorLog

      public AVPlayerItemErrorLog getErrorLog()
    • addOutput

      public void addOutput​(AVPlayerItemOutput output)
    • removeOutput

      public void removeOutput​(AVPlayerItemOutput output)
    • addMediaDataCollector

      public void addMediaDataCollector​(AVPlayerItemMediaDataCollector collector)
      Since:
      Available in iOS 9.3 and later.
    • removeMediaDataCollector

      public void removeMediaDataCollector​(AVPlayerItemMediaDataCollector collector)
      Since:
      Available in iOS 9.3 and later.
    • seekToTime

      @Deprecated public void seekToTime​(CMTime time)
      Deprecated.
      Deprecated in iOS 11.0. Use -seekToTime:completionHandler:, passing nil for the completionHandler if you don't require notification of completion
    • seekToTime

      @Deprecated public void seekToTime​(CMTime time, CMTime toleranceBefore, CMTime toleranceAfter)
      Deprecated.
      Deprecated in iOS 11.0. Use -seekToTime:toleranceBefore:toleranceAfter:completionHandler:, passing nil for the completionHandler if you don't require notification of completion
    • seekToDate

      @Deprecated public boolean seekToDate​(NSDate date)
      Deprecated.
      Deprecated in iOS 11.0. Use -seekToDate:completionHandler:, passing nil for the completionHandler if you don't require notification of completion
    • getSelectedMediaOption

      @Deprecated public AVMediaSelectionOption getSelectedMediaOption​(AVMediaSelectionGroup mediaSelectionGroup)
      Deprecated.
      Deprecated in iOS 11.0. Use currentMediaSelection to obtain an instance of AVMediaSelection, which encompasses the currently selected AVMediaSelectionOption in each of the available AVMediaSelectionGroups