Platforms to show: All Mac Windows Linux Cross-Platform

AVMetadataItemMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
An AVMetadataItem object represents an item of metadata associated with an audiovisual asset or with one of its tracks.
Example
// load file and look for cover art

Dim file As FolderItem = SpecialFolder.Desktop.Child("test.m4a")
Dim a As AVURLAssetMBS = AVURLAssetMBS.URLAssetWithFile(file)

Dim iTunesMetadataKeyCoverArtString As String = AVFoundationMBS.AVMetadataiTunesMetadataKeyCoverArt
Dim iTunesMetadataKeyCoverArtNumber As Integer = OSTypeFromStringMBS(iTunesMetadataKeyCoverArtString)

Dim items() As AVMetadataItemMBS = a.metadata

For Each item As AVMetadataItemMBS In items

Dim key As Variant = item.key
Dim Val As Variant = item.value

If key.IntegerValue = iTunesMetadataKeyCoverArtNumber Or key.StringValue = iTunesMetadataKeyCoverArtString Then

Dim v As MemoryBlock = Val
window1.Backdrop = picture.FromData(v)
End If

Next

To create metadata items for your own assets, you use the mutable subclass, AVMutableMetadataItem.

Metadata items have keys that accord with the specification of the container format from which they're drawn. Full details of the metadata formats, metadata keys, and metadata key spaces supported by AV Foundation are available among the defines in AVMetadataFormat.h.

You can load values of a metadata item "lazily" using the methods from the AVAsynchronousKeyValueLoading protocol (see "Asynchronous Loading"). The AVAsset class and other classes in turn provide their metadata lazily so that you can obtain objects from those arrays without incurring overhead for items you don't ultimately inspect.

You can filter arrays of metadata items using the methods of this class. For example, you can filter by key and key space, by locale, and by preferred language.

Load Status Constants

Constant Value Description
AVKeyValueStatusCancelled 4 Indicates that the attempt to load the property was cancelled.
AVKeyValueStatusFailed 3 Indicates that the attempt to load the property failed.
AVKeyValueStatusLoaded 2 Indicates that the property is ready for use.
AVKeyValueStatusLoading 1 Indicates that the property is not fully loaded.
AVKeyValueStatusUnknown 0 Indicates that the property status is unknown.

Sub classes:

Some methods using this class:

Some properties using for this class:

Some events using this class:

Some examples using this class:

Blog Entries

Xojo Developer Magazine


The items on this page are in the following plugins: MBS AVFoundation Plugin.


AVMetadataItemFilterMBS   -   AVMetadataObjectMBS


The biggest plugin in space...