Class: AVMetadataItem

Inherits:
NSObject show all

Overview

An AVMetadataItem object represents an item of metadata associated with an audiovisual asset or with one of its tracks. To create metadata items for your own assets, you use the mutable subclass, AVMutableMetadataItem.

Direct Known Subclasses

AVMutableMetadataItem

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (String) commonKey (readonly)

The common key of the metadata item. (read-only) This property contains the key that most closely corresponds to the key in the key property but that belongs to the common key space (AVMetadataKeySpaceCommon) as opposed to a format-specific key space. You can use this key to locate metadata items irrespective of the underlying media format. If the value of the keySpace property is AVMetadataKeySpaceCommon, this property contains the same key as the key property.

Returns:

- (NSData) dataValue (readonly)

Provides the raw bytes of the value of the metadata item. (read-only)

Returns:

- (NSDate) dateValue (readonly)

The value of the metadata item formatted as a date. (read-only) The value of this property is nil if the metadata value cannot be represented as a date.

Returns:

- (CMTime) duration (readonly)

The duration of the metadata item. (read-only)

Returns:

  • (CMTime)

- (Hash) extraAttributes (readonly)

The additional attributes supplied by the metadata item. (read-only)

Returns:

- (Object) key (readonly)

The key of the metadata item. (read-only) The key property contains the true key used to identify the contents of the metadata item. This value is specific to the key space of the metadata item.

Returns:

- (String) keySpace (readonly)

The key space of metadata item’s key. (read-only) The key space specified by this property is typically the default key space for the metadata container in which the metadata item is stored.AV Foundation uses key spaces to group related sets of keys. For example, the framework defines different key spaces for common keys, iTunes keys, ID3 keys, and QuickTime keys. Key spaces aid in filtering arrays of metadata items.

Returns:

- (NSLocale) locale (readonly)

The locale of the metadata item. (read-only) The locale may be nil if no locale information is available for the metadata item.

Returns:

- (NSNumber) numberValue (readonly)

The value of the metadata item formatted as a number. (read-only) The value of this property is nil if the metadata value cannot be represented as a number.

Returns:

- (String) stringValue (readonly)

The value of the metadata item formatted as a string. (read-only) The value of this property is nil if the metadata value cannot be represented as a string.

Returns:

- (CMTime) time (readonly)

The timestamp of the metadata item. (read-only)

Returns:

  • (CMTime)

- (Object) value (readonly)

The value of the metadata item. (read-only)

Returns:

Class Method Details

+ (Array) metadataItemsFromArray(metadataItems, filteredAndSortedAccordingToPreferredLanguages:preferredLanguages)

Returns the subset of metadata items whose locales match one of the specified language identifiers.

Parameters:

  • metadataItems (Array)

    An array of AVMetadataItem objects to be filtered and sorted.

  • preferredLanguages (Array)

    An array of NSString objects, each of which contains a canonicalized IETF BCP 47 language identifier. The order of the identifiers in the array reflects the preferred language order, with the most preferred language being first in the array. Typically, you pass the user’s preferred languages by retrieving this array from the preferredLanguages class method of NSLocale.

Returns:

  • (Array)

    An array containing the AVMetadataItem objects from the metadataItems parameter that match one of the specified languages.

+ (Array) metadataItemsFromArray(array, withKey:key, keySpace:keySpace)

Returns from a given array an array of metadata items that match a specified key or key space. If the value in the keySpace parameter is AVMetadataKeySpaceCommon, the value of the metadata item’s commonKey property must match the value in the key parameter for the item to be returned. If the key parameter is nil, then all metadata items in the common key space are returned.If the value in the keySpace parameter is nil or is not the constant for the common key space, the value of the metadata item’s key property must match the value in the key parameter for the item to be returned. If the key parameter itself is nil, then all metadata items in the specified key space are returned.

Parameters:

  • array (Array)

    The array of AVMetadataItem objects to be filtered.

  • key (Object)

    The key that must be matched for a metadata item to be included in the output array. The key is compared to the keys in the metadata in the array using isEqual:.If you do not want to filter by key, pass nil.

  • keySpace (String)

    The key space that must be matched for a metadata item to be included in the output array. The key space is compared to the key spaces in the metadata in the array using isEqualToString:.If you do not want to filter by key space, pass nil.

Returns:

  • (Array)

    An array of the metadata items from array that match key or keySpace.

+ (Array) metadataItemsFromArray(array, withLocale:locale)

Returns from a given array an array of metadata items that match a specified locale.

Parameters:

  • array (Array)

    The array of AVMetadataItem objects to be filtered.

  • locale (NSLocale)

    The locale that must be matched for a metadata item to be included in the output array.

Returns:

  • (Array)

    An array containing the AVMetadataItem objects from the array parameter that match the specified locale.

Instance Method Details

- (Object) loadValuesAsynchronouslyForKeys(keys, completionHandler:handler)

Tells the receiver to load the values of any of the specified keys that are not already loaded. For full discussion, see AVAsynchronousKeyValueLoading.

Parameters:

  • keys

    An array of NSString objects, each of which represents one of the required keys.

  • handler

    The block to be invoked when loading succeeds, fails, or is cancelled.

Returns:

- (AVKeyValueStatus) statusOfValueForKey(key, error:outError)

Reports whether the value for a given key is immediately available without blocking. For full discussion, see AVAsynchronousKeyValueLoading.

Parameters:

  • key (String)

    The key whose status you want.

  • outError (Pointer)

    If the status of the value for the key is AVKeyValueStatusFailed, upon return contains an NSError object that describes the failure that occurred.

Returns:

  • (AVKeyValueStatus)

    The current loading status of the value for key.