Type Method

identifier(forKey:keySpace:)

Provides the metadata identifier that’s equivalent to a key and key space.

Declaration

class func identifier(forKey key: Any, keySpace: AVMetadataKeySpace) -> AVMetadataIdentifier?

Parameters

key

The metadata key.

keySpace

The metadata key space.

Return Value

A metadata identifier equivalent to key and keySpace, or nil if no identifier can be constructed

Discussion

Metadata keys that are not instances of NSString, NSNumber, or NSData cannot be converted to metadata identifiers; they also cannot be written to media resources via AVAssetExportSession or AVAssetWriter. Metadata item keySpaces must be a string of one to four printable ASCII characters.

For custom identifiers, the keySpace AVMetadataKeySpaceQuickTimeMetadata is recommended. This keySpace defines its key values to be expressed as reverse-DNS strings, which allows third parties to define their own keys in a well established way that avoids collisions.

See Also

Accessing Metadata Values

var value: (NSCopying & NSObjectProtocol)?

The value of the metadata item.

var time: CMTime

The timestamp of the metadata item.

var duration: CMTime

The duration of the metadata item.

var locale: Locale?

The locale of the metadata item.

var dataValue: Data?

The raw bytes of the value for the metadata item.

var extraAttributes: [AVMetadataExtraAttributeKey : Any]?

The additional attributes supplied by the metadata item.

struct AVMetadataExtraAttributeKey

A value that defines extra attribute keys.

var dataType: String?

The data type of the metadata item's value.

var extendedLanguageTag: String?

The IETF BCP 47 (RFC 4646) language identifier of the metadata item.

var startDate: Date?

The start date of the timed metadata.

struct AVMetadataKeySpace

A value that defines a metadata key space.

var identifier: AVMetadataIdentifier?

The identifier of the metadata item.

class func key(forIdentifier: AVMetadataIdentifier) -> Any?

Returns the metadata key associated with the identifier.

class func keySpace(forIdentifier: AVMetadataIdentifier) -> AVMetadataKeySpace?

Returns the metadata key space associated with the identifier.

struct AVMetadataIdentifier

A value that defines the metadata identifiers for different file formats.