public class AVAsset extends NSObject implements NSCopying, AVAsynchronousKeyValueLoading
| Modifier and Type | Class and Description |
|---|---|
static interface |
AVAsset.Block_findUnusedTrackIDWithCompletionHandler |
static interface |
AVAsset.Block_loadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler |
static interface |
AVAsset.Block_loadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeysCompletionHandler |
static interface |
AVAsset.Block_loadMediaSelectionGroupForMediaCharacteristicCompletionHandler |
static interface |
AVAsset.Block_loadMetadataForFormatCompletionHandler |
static interface |
AVAsset.Block_loadTracksWithMediaCharacteristicCompletionHandler |
static interface |
AVAsset.Block_loadTracksWithMediaTypeCompletionHandler |
static interface |
AVAsset.Block_loadTrackWithTrackIDCompletionHandler |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_retAVAsynchronousKeyValueLoading.Block_loadValuesAsynchronouslyForKeysCompletionHandler| Modifier | Constructor and Description |
|---|---|
protected |
AVAsset(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
NSArray<? extends AVMediaSelection> |
allMediaSelections()
[@property] allMediaSelections
|
static AVAsset |
alloc() |
static AVAsset |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static AVAsset |
assetWithURL(NSURL URL)
assetWithURL:
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
NSArray<? extends NSLocale> |
availableChapterLocales()
array of NSLocale
|
NSArray<java.lang.String> |
availableMediaCharacteristicsWithMediaSelectionOptions()
Provides an NSArray of NSStrings, each NSString indicating a media characteristic for which a media selection option is available.
|
NSArray<java.lang.String> |
availableMetadataFormats()
Provides an NSArray of NSStrings, each representing a metadata format that's available to the asset (e.g.
|
void |
cancelLoading()
cancelLoading
|
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 |
canContainFragments()
[@property] canContainFragments
|
NSArray<? extends AVTimedMetadataGroup> |
chapterMetadataGroupsBestMatchingPreferredLanguages(NSArray<java.lang.String> preferredLanguages)
chapterMetadataGroupsBestMatchingPreferredLanguages:
|
NSArray<? extends AVTimedMetadataGroup> |
chapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeys(NSLocale locale,
NSArray<java.lang.String> commonKeys)
chapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:
|
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
NSArray<? extends AVMetadataItem> |
commonMetadata()
Provides access to an array of AVMetadataItems for each common metadata key for which a value is available; items can be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:] and according to identifier via +[AVMetadataItem metadataItemsFromArray:filteredByIdentifier:].
|
boolean |
containsFragments()
[@property] containsFragments
|
java.lang.Object |
copyWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
AVMetadataItem |
creationDate()
Indicates the creation date of the asset as an AVMetadataItem.
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
CMTime |
duration()
Indicates the duration of the asset.
|
void |
findUnusedTrackIDWithCompletionHandler(AVAsset.Block_findUnusedTrackIDWithCompletionHandler completionHandler)
findUnusedTrackIDWithCompletionHandler:
|
static long |
hash_static() |
boolean |
hasProtectedContent()
[@property] hasProtectedContent
|
AVAsset |
init() |
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 |
isCompatibleWithAirPlayVideo()
[@property] compatibleWithAirPlayVideo
|
boolean |
isCompatibleWithSavedPhotosAlbum()
indicates whether the receiver can be written to the saved photos album
|
boolean |
isComposable()
indicates whether the receiver can be used to build an AVMutableComposition
|
boolean |
isExportable()
indicates whether an AVAssetExportSession can be used with the receiver for export
|
boolean |
isPlayable()
[@property] playable
|
boolean |
isReadable()
indicates whether an AVAssetReader can be used with the receiver for extracting media data
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
void |
loadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler(NSArray<java.lang.String> preferredLanguages,
AVAsset.Block_loadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler completionHandler)
loadChapterMetadataGroupsBestMatchingPreferredLanguages:completionHandler:
|
void |
loadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeysCompletionHandler(NSLocale locale,
NSArray<java.lang.String> commonKeys,
AVAsset.Block_loadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeysCompletionHandler completionHandler)
loadChapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:completionHandler:
|
void |
loadMediaSelectionGroupForMediaCharacteristicCompletionHandler(java.lang.String mediaCharacteristic,
AVAsset.Block_loadMediaSelectionGroupForMediaCharacteristicCompletionHandler completionHandler)
loadMediaSelectionGroupForMediaCharacteristic:completionHandler:
|
void |
loadMetadataForFormatCompletionHandler(java.lang.String format,
AVAsset.Block_loadMetadataForFormatCompletionHandler completionHandler)
loadMetadataForFormat:completionHandler:
|
void |
loadTracksWithMediaCharacteristicCompletionHandler(java.lang.String mediaCharacteristic,
AVAsset.Block_loadTracksWithMediaCharacteristicCompletionHandler completionHandler)
loadTracksWithMediaCharacteristic:completionHandler:
|
void |
loadTracksWithMediaTypeCompletionHandler(java.lang.String mediaType,
AVAsset.Block_loadTracksWithMediaTypeCompletionHandler completionHandler)
loadTracksWithMediaType:completionHandler:
|
void |
loadTrackWithTrackIDCompletionHandler(int trackID,
AVAsset.Block_loadTrackWithTrackIDCompletionHandler completionHandler)
loadTrackWithTrackID:completionHandler:
|
void |
loadValuesAsynchronouslyForKeysCompletionHandler(NSArray<java.lang.String> keys,
AVAsynchronousKeyValueLoading.Block_loadValuesAsynchronouslyForKeysCompletionHandler handler)
loadValuesAsynchronouslyForKeys:completionHandler:
|
java.lang.String |
lyrics()
Provides access to the lyrics of the asset suitable for the current locale.
|
AVMediaSelectionGroup |
mediaSelectionGroupForMediaCharacteristic(java.lang.String mediaCharacteristic)
mediaSelectionGroupForMediaCharacteristic:
|
NSArray<? extends AVMetadataItem> |
metadata()
Provides access to an array of AVMetadataItems for all metadata identifiers for which a value is available; items can be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:] and according to identifier via +[AVMetadataItem metadataItemsFromArray:filteredByIdentifier:].
|
NSArray<? extends AVMetadataItem> |
metadataForFormat(java.lang.String format)
metadataForFormat:
|
CMTime |
minimumTimeOffsetFromLive()
[@property] minimumTimeOffsetFromLive
|
CGSize |
naturalSize()
Deprecated.
|
static AVAsset |
new_objc() |
CMTime |
overallDurationHint()
[@property] overallDurationHint
|
AVMediaSelection |
preferredMediaSelection()
[@property] preferredMediaSelection
|
float |
preferredRate()
indicates the natural rate at which the asset is to be played; often but not always 1.0
|
CGAffineTransform |
preferredTransform()
indicates the preferred transform to apply to the visual content of the asset for presentation or processing; the value is often but not always the identity transform
|
float |
preferredVolume()
indicates the preferred volume at which the audible media of an asset is to be played; often but not always 1.0
|
boolean |
providesPreciseDurationAndTiming()
Indicates that the asset provides precise timing.
|
long |
referenceRestrictions()
[@property] referenceRestrictions
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
long |
statusOfValueForKeyError(java.lang.String key,
org.moe.natj.general.ptr.Ptr<NSError> outError)
statusOfValueForKey:
|
static org.moe.natj.objc.Class |
superclass_static() |
NSArray<? extends AVAssetTrackGroup> |
trackGroups()
[@property] trackGroups
|
NSArray<? extends AVAssetTrack> |
tracks()
[@property] tracks
|
NSArray<? extends AVAssetTrack> |
tracksWithMediaCharacteristic(java.lang.String mediaCharacteristic)
tracksWithMediaCharacteristic:
|
NSArray<? extends AVAssetTrack> |
tracksWithMediaType(java.lang.String mediaType)
tracksWithMediaType:
|
AVAssetTrack |
trackWithTrackID(int trackID)
trackWithTrackID:
|
int |
unusedTrackID() |
static long |
version_static() |
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, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static AVAsset alloc()
public static AVAsset allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static AVAsset assetWithURL(NSURL URL)
Returns an instance of AVAsset for inspection of a media resource.
Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
URL - An instance of NSURL that references a media resource.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 AVAsset new_objc()
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 NSArray<? extends NSLocale> availableChapterLocales()
public NSArray<java.lang.String> availableMediaCharacteristicsWithMediaSelectionOptions()
public NSArray<java.lang.String> availableMetadataFormats()
public boolean canContainFragments()
Indicates whether the asset is capable of being extended by fragments.
For QuickTime movie files and MPEG-4 files, the value of canContainFragments is YES if an 'mvex' box is present in the 'moov' box. For those types, the 'mvex' box signals the possible presence of later 'moof' boxes.
public void cancelLoading()
Cancels the loading of all values for all observers.
Deallocation or finalization of an instance of AVAsset will implicitly cancel loading if any loading requests are still outstanding.
public NSArray<? extends AVTimedMetadataGroup> chapterMetadataGroupsBestMatchingPreferredLanguages(NSArray<java.lang.String> preferredLanguages)
Tests, in order of preference, for a match between language identifiers in the specified array of preferred languages and the available chapter locales, and returns the array of chapters corresponding to the first match that's found.
Safe to call without blocking when the AVAsset key availableChapterLocales has status AVKeyValueStatusLoaded.
Returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
All of the available chapter metadata is included in the metadata groups, including items with the common key AVMetadataCommonKeyArtwork, if such items are present. Items not carrying chapter titles will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and that of the metadata group overlaps. The locale of such items need not match the locale of the chapter titles.
Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:]. .
preferredLanguages - An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. Use +[NSLocale preferredLanguages] to obtain the user's list of preferred languages.public NSArray<? extends AVTimedMetadataGroup> chapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeys(NSLocale locale, NSArray<java.lang.String> commonKeys)
Provides an array of chapters.
This method returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
An AVMetadataItem with the specified common key will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and the metadata group overlaps. The locale of items not carrying chapter titles need not match the specified locale parameter.
Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].
locale - Locale of the metadata items carrying chapter titles to be returned (supports the IETF BCP 47 specification).commonKeys - Array of common keys of AVMetadataItem to be included; can be nil.
AVMetadataCommonKeyArtwork is the only supported key for now.public NSArray<? extends AVMetadataItem> commonMetadata()
public boolean containsFragments()
Indicates whether the asset is extended by at least one fragment.
For QuickTime movie files and MPEG-4 files, the value of this property is YES if canContainFragments is YES and at least one 'moof' box is present after the 'moov' box.
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
copyWithZone in interface NSCopyingpublic AVMetadataItem creationDate()
public CMTime duration()
public boolean hasProtectedContent()
Indicates whether or not the asset has protected content.
Assets containing protected content may not be playable without successful authorization, even if the value of the "playable" property is YES. See the properties in the AVAssetUsability category for details on how such an asset may be used. On OS X, clients can use the interfaces in AVPlayerItemProtectedContentAdditions.h to request authorization to play the asset.
public boolean isCompatibleWithAirPlayVideo()
Indicates whether the asset is compatible with AirPlay Video.
YES if an AVPlayerItem initialized with the receiver can be played by an external device via AirPlay Video.
public boolean isCompatibleWithSavedPhotosAlbum()
public boolean isComposable()
public boolean isExportable()
public boolean isPlayable()
Indicates whether an AVPlayer can play the contents of the asset in a manner that meets user expectations.
A client can attempt playback when playable is NO, this however may lead to a substandard playback experience.
public boolean isReadable()
public void loadValuesAsynchronouslyForKeysCompletionHandler(NSArray<java.lang.String> keys, AVAsynchronousKeyValueLoading.Block_loadValuesAsynchronouslyForKeysCompletionHandler handler)
AVAsynchronousKeyValueLoadingDirects the target to load the values of any of the specified keys that are not already loaded.
loadValuesAsynchronouslyForKeysCompletionHandler in interface AVAsynchronousKeyValueLoadingkeys - An instance of NSArray, containing NSStrings for the specified keys.handler - The block to be invoked when loading succeeds, fails, or is cancelled.public java.lang.String lyrics()
public AVMediaSelectionGroup mediaSelectionGroupForMediaCharacteristic(java.lang.String mediaCharacteristic)
Provides an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.
Becomes callable without blocking when the key @"availableMediaCharacteristicsWithMediaSelectionOptions" has been loaded.
If the asset has no AVMediaSelectionGroup containing options with the specified media characteristic, the return value will be nil.
Filtering of the options in the returned AVMediaSelectionGroup according to playability, locale, and additional media characteristics can be accomplished using the category AVMediaSelectionOptionFiltering defined on AVMediaSelectionGroup.
mediaCharacteristic - A media characteristic for which you wish to obtain the available media selection options. AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual are currently supported.
Pass AVMediaCharacteristicAudible to obtain the group of available options for audio media in various languages and for various purposes, such as descriptive audio. Pass AVMediaCharacteristicLegible to obtain the group of available options for subtitles in various languages and for various purposes. Pass AVMediaCharacteristicVisual to obtain the group of available options for video media.
public NSArray<? extends AVMetadataItem> metadata()
public NSArray<? extends AVMetadataItem> metadataForFormat(java.lang.String format)
Provides an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format; can subsequently be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:], according to locale via +[AVMetadataItem metadataItemsFromArray:withLocale:], or according to key via +[AVMetadataItem metadataItemsFromArray:withKey:keySpace:].
Becomes callable without blocking when the key @"availableMetadataFormats" has been loaded
format - The metadata format for which items are requested.@Deprecated public CGSize naturalSize()
public CMTime overallDurationHint()
Indicates the total duration of fragments that either exist now or may be appended in the future in order to extend the duration of the asset.
For QuickTime movie files and MPEG-4 files, the value of this property is obtained from the 'mehd' box of the 'mvex' box, if present. If no total fragment duration hint is available, the value of this property is kCMTimeInvalid.
public AVMediaSelection preferredMediaSelection()
Provides an instance of AVMediaSelection with default selections for each of the receiver's media selection groups.
public float preferredRate()
public CGAffineTransform preferredTransform()
public float preferredVolume()
public boolean providesPreciseDurationAndTiming()
public long referenceRestrictions()
Indicates the reference restrictions being used by the receiver.
For AVURLAsset, this property reflects the value passed in for AVURLAssetReferenceRestrictionsKey, if any. See AVURLAssetReferenceRestrictionsKey below for a full discussion of reference restrictions. The default value for this property is AVAssetReferenceRestrictionForbidLocalReferenceToRemote.
public long statusOfValueForKeyError(java.lang.String key,
org.moe.natj.general.ptr.Ptr<NSError> outError)
AVAsynchronousKeyValueLoadingReports whether the value for a key is immediately available without blocking.
Clients can use -statusOfValueForKey: to determine the availability of the value of any key of interest. However, this method alone does not prompt the receiver to load the value of a key that's not yet available. To request values for keys that may not already be loaded, without blocking, use -loadValuesAsynchronouslyForKeys:completionHandler:, await invocation of the completion handler, and test the availability of each key via -statusOfValueForKey: before invoking its getter.
Even if access to values of some keys may be readily available, as can occur with receivers initialized with URLs for resources on local volumes, extensive I/O or parsing may be needed for these same receivers to provide values for other keys. A duration for a local MP3 file, for example, may be expensive to obtain, even if the values for other AVAsset properties may be trivial to obtain.
Blocking that may occur when calling the getter for any key should therefore be avoided in the general case by loading values for all keys of interest via -loadValuesAsynchronouslyForKeys:completionHandler: and testing the availability of the requested values before fetching them by calling getters.
The sole exception to this general rule is in usage on Mac OS X on the desktop, where it may be acceptable to block in cases in which the client is preparing objects for use on background threads or in operation queues. On iOS, values should always be loaded asynchronously prior to calling getters for the values, in any usage scenario.
statusOfValueForKeyError in interface AVAsynchronousKeyValueLoadingkey - An instance of NSString containing the specified key.outError - If the status of the value for the key is AVKeyValueStatusFailed, *outError is set to a non-nil NSError that describes the failure that occurred.public NSArray<? extends AVAssetTrackGroup> trackGroups()
All track groups in the receiver.
The value of this property is an NSArray of AVAssetTrackGroups, each representing a different grouping of tracks in the receiver.
public AVAssetTrack trackWithTrackID(int trackID)
Provides an instance of AVAssetTrack that represents the track of the specified trackID.
Becomes callable without blocking when the key @"tracks" has been loaded
trackID - The trackID of the requested AVAssetTrack.public NSArray<? extends AVAssetTrack> tracks()
Provides the array of AVAssetTracks contained by the asset
public NSArray<? extends AVAssetTrack> tracksWithMediaCharacteristic(java.lang.String mediaCharacteristic)
Provides an array of AVAssetTracks of the asset that present media with the specified characteristic.
Becomes callable without blocking when the key @"tracks" has been loaded
mediaCharacteristic - The media characteristic according to which AVAsset filters its AVAssetTracks. (Media characteristics are defined in AVMediaFormat.h.)public NSArray<? extends AVAssetTrack> tracksWithMediaType(java.lang.String mediaType)
Provides an array of AVAssetTracks of the asset that present media of the specified media type.
Becomes callable without blocking when the key @"tracks" has been loaded
mediaType - The media type according to which AVAsset filters its AVAssetTracks. (Media types are defined in AVMediaFormat.h.)public int unusedTrackID()
public NSArray<? extends AVMediaSelection> allMediaSelections()
Provides an array of all permutations of AVMediaSelection for this asset.
public CMTime minimumTimeOffsetFromLive()
Indicates how close to the latest content in a live stream playback can be sustained.
For non-live assets this value is kCMTimeInvalid.
public void findUnusedTrackIDWithCompletionHandler(AVAsset.Block_findUnusedTrackIDWithCompletionHandler completionHandler)
Loads a track ID that will not collide with any existing track
completionHandler - A block that is invoked when loading is complete, vending the track ID or an error.public void loadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler(NSArray<java.lang.String> preferredLanguages, AVAsset.Block_loadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler completionHandler)
Tests, in order of preference, for a match between language identifiers in the specified array of preferred languages and the available chapter locales, and loads the array of chapters corresponding to the first match that's found.
Returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
All of the available chapter metadata is included in the metadata groups, including items with the common key AVMetadataCommonKeyArtwork, if such items are present. Items not carrying chapter titles will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and that of the metadata group overlaps. The locale of such items need not match the locale of the chapter titles.
Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].
preferredLanguages - An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. Use +[NSLocale preferredLanguages] to obtain the user's list of preferred languages.completionHandler - A block that is invoked when loading is complete, vending the array of timed metadata groups or an error.public void loadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeysCompletionHandler(NSLocale locale, NSArray<java.lang.String> commonKeys, AVAsset.Block_loadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeysCompletionHandler completionHandler)
Loads an array of chapters.
This method vends an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
An AVMetadataItem with the specified common key will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and the metadata group overlaps. The locale of items not carrying chapter titles need not match the specified locale parameter.
Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].
locale - Locale of the metadata items carrying chapter titles to be returned (supports the IETF BCP 47 specification).commonKeys - Array of common keys of AVMetadataItem to be included; if no common keys are required, send an empty list.
AVMetadataCommonKeyArtwork is the only supported key for now.completionHandler - A block that is invoked when loading is complete, vending the array of timed metadata groups or an error.public void loadMediaSelectionGroupForMediaCharacteristicCompletionHandler(java.lang.String mediaCharacteristic,
AVAsset.Block_loadMediaSelectionGroupForMediaCharacteristicCompletionHandler completionHandler)
Loads an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.
If the asset has no AVMediaSelectionGroup containing options with the specified media characteristic, the return value will be nil.
Filtering of the options in the returned AVMediaSelectionGroup according to playability, locale, and additional media characteristics can be accomplished using the category AVMediaSelectionOptionFiltering defined on AVMediaSelectionGroup.
mediaCharacteristic - A media characteristic for which you wish to obtain the available media selection options. AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual are currently supported.
Pass AVMediaCharacteristicAudible to obtain the group of available options for audio media in various languages and for various purposes, such as descriptive audio. Pass AVMediaCharacteristicLegible to obtain the group of available options for subtitles in various languages and for various purposes. Pass AVMediaCharacteristicVisual to obtain the group of available options for video media.
completionHandler - A block that is invoked when loading is complete, vending an instance of AVMediaSelectionGroup (which may be nil) or an error.public void loadMetadataForFormatCompletionHandler(java.lang.String format,
AVAsset.Block_loadMetadataForFormatCompletionHandler completionHandler)
Loads an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format; can subsequently be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:], according to locale via +[AVMetadataItem metadataItemsFromArray:withLocale:], or according to key via +[AVMetadataItem metadataItemsFromArray:withKey:keySpace:].
format - The metadata format for which items are requested.completionHandler - A block that is invoked when loading is complete, vending the array of metadata items (which may be empty if there is no metadata of the specified format) or an error.public void loadTrackWithTrackIDCompletionHandler(int trackID,
AVAsset.Block_loadTrackWithTrackIDCompletionHandler completionHandler)
Loads an instance of AVAssetTrack that represents the track of the specified trackID.
trackID - The trackID of the requested AVAssetTrack.completionHandler - A block that is called when the loading is finished, with either the loaded track (which may be nil if no track of the specified trackID is available) or an error.public void loadTracksWithMediaCharacteristicCompletionHandler(java.lang.String mediaCharacteristic,
AVAsset.Block_loadTracksWithMediaCharacteristicCompletionHandler completionHandler)
Loads an array of AVAssetTracks of the asset that present media with the specified characteristic.
mediaCharacteristic - The media characteristic according to which AVAsset filters its AVAssetTracks. (Media characteristics are defined in AVMediaFormat.h.)completionHandler - A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks with the specified characteristic are available) or an error.public void loadTracksWithMediaTypeCompletionHandler(java.lang.String mediaType,
AVAsset.Block_loadTracksWithMediaTypeCompletionHandler completionHandler)
Loads an array of AVAssetTracks of the asset that present media of the specified media type.
mediaType - The media type according to which AVAsset filters its AVAssetTracks. (Media types are defined in AVMediaFormat.h.)completionHandler - A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks of the specified media type are available) or an error.