Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

AVAssetMBS.availableChapterLocales as NSLocaleMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The locales available for chapters in the asset. (read-only)

Feedback, Comments & Corrections

AVAssetMBS.availableMediaCharacteristicsWithMediaSelectionOptions as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: An array of media characteristics for which a media selection option is available. (read-only)
Notes: The value of this property is an array of strings, each string indicating a media characteristic for which a media selection option is available.

Feedback, Comments & Corrections

AVAssetMBS.availableMetadataFormats as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: An array of strings, each representing a metadata format that's available to the asset. (read-only)
Notes: Metadata formats may include ID3, iTunes metadata, and so on. For more details, see AVMetadataItem.

Feedback, Comments & Corrections

AVAssetMBS.cancelLoading
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Cancels the loading of all values for all observers.
Notes: Deallocation of an instance of the asset will implicitly invoke this method if any loading requests are still outstanding.

Feedback, Comments & Corrections

AVAssetMBS.chapterMetadataGroupsBestMatchingPreferredLanguages as AVTimedMetadataGroupMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of chapters whose locale best matches the the list of preferred languages.
Notes:
preferredLanguages: Optional, an array of strings, 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. If you don't pass an array, the plugin automatically passes NSLocaleMBS.preferredLanguages.

Returns an array of AVTimedMetadataGroup objects.

Each object in the returned array contains an AVMetadataItem object representing the chapter title. The time range 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 are 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.

You can use the metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages: method to further filter the metadata items in each group. You can also filter the returned items based on locale using the metadataItemsFromArray:withLocale: method.

Special Considerations
Becomes callable without blocking when the data in the availableChapterLocales property is already loaded.

See also:

Feedback, Comments & Corrections

AVAssetMBS.chapterMetadataGroupsBestMatchingPreferredLanguages(preferredLanguages() as string) as AVTimedMetadataGroupMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of chapters whose locale best matches the the list of preferred languages.
Notes:
preferredLanguages: Optional, an array of strings, 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. If you don't pass an array, the plugin automatically passes NSLocaleMBS.preferredLanguages.

Returns an array of AVTimedMetadataGroup objects.

Each object in the returned array contains an AVMetadataItem object representing the chapter title. The time range 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 are 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.

You can use the metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages: method to further filter the metadata items in each group. You can also filter the returned items based on locale using the metadataItemsFromArray:withLocale: method.

Special Considerations
Becomes callable without blocking when the data in the availableChapterLocales property is already loaded.

See also:

Feedback, Comments & Corrections

AVAssetMBS.chapterMetadataGroupsWithTitleLocale(locale as NSLocaleMBS, commonKeys() as string) as AVTimedMetadataGroupMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of chapters with a given title locale and containing specified keys.
Notes:
locale: The locale of the metadata items carrying chapter titles to be returned (the method supports the IETF BCP 47 specification of locales).
commonKeys: An array of common keys of AVMetadataItem to include in the returned array. AVMetadataCommonKeyArtwork is the only supported key.

Returns an array of AVTimedMetadataGroup objects.

Each object in the returned array contains an AVMetadataItem object representing the chapter title, and the time range property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.

An AVMetadataItem with the specified common key is added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and the metadata group overlap.

The locale of items not carrying chapter titles need not match the specified locale parameter. You can filter the returned items based on locale using metadataItemsFromArray.

Feedback, Comments & Corrections

AVAssetMBS.commonMetadata as AVMetadataItemMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: An array of metadata items for each common metadata key for which a value is available. (read-only)
Notes: The value is an array of AVMetadataItem objects, one for each common metadata key for which a value is available. You can filter the array by locale using metadataItemsFromArray (AVMetadataItem) or by key using metadataItemsFromArray (AVMetadataItem).

Feedback, Comments & Corrections

AVAssetMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The private constructor.

Feedback, Comments & Corrections

AVAssetMBS.copy as AVAssetMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Creates a copy of the object.

Feedback, Comments & Corrections

AVAssetMBS.duration as CMTimeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The duration of the asset. (read-only)
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.mov")
dim a as AVAssetMBS = AVAssetMBS.assetWithFile(f)

MsgBox str(a.duration.Seconds)+" seconds"
Notes: If providesPreciseDurationAndTiming is false, a best-available estimate of the duration is returned. You can set the degree of precision required for timing-related properties at initialization time for assets initialized with URLs (see AVURLAssetPreferPreciseDurationAndTimingKey in AVURLAsset).

Feedback, Comments & Corrections

AVAssetMBS.loadValuesAsynchronouslyForKeys(keys() as string, tag as Variant = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Tells the asset to load the values of any of the specified keys that are not already loaded.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.m4v")
dim a as AVAssetMBS = AVAssetmbs.assetWithFile(f)

if a = nil then
MsgBox "failed to read file at all"
Return
end if

// request duration property
a.loadValuesAsynchronouslyForKeys array("duration")

dim e as NSErrorMBS
dim Status as Integer = a.statusOfValueForKey("duration", e)
while status < a.AVKeyValueStatusLoaded
// wait for loading in background
status = a.statusOfValueForKey("duration", e)
wend

// got it?
if status <> a.AVKeyValueStatusLoaded then
MsgBox "Failed to load duration."
if e <> nil then
MsgBox e.LocalizedDescription
end if

else
MsgBox str(a.duration.Seconds)+" seconds long."
end if
Notes:
keys: An array containing the required keys.

Calls AVFoundationMBS.AssetLoadValuesAsynchronouslyForKeysFinished on completion.
The completion event will be invoked exactly once per invocation of this method:

  • Synchronously if an I/O error or other format-related error occurs immediately.
  • Asynchronously at a subsequent time if a loading error occurs at a later stage of processing, or if cancelLoading is invoked on an AVAsset instance.

The completion states of the keys you specify in keys are not necessarily the same—some may be loaded, and others may have failed. You must check the status of each key individually.

If you want to receive error reporting for loading that's still pending, you can call this method at any time—even after an asset has begun to load data for operations in progress or already completed. If a fatal error has already occurred, the completion event is invoked synchronously.

Feedback, Comments & Corrections

AVAssetMBS.mediaSelectionGroupForMediaCharacteristic(mediaCharacteristic as string) as AVMediaSelectionGroupMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an AVMediaSelectionGroup object that contains one or more options with the specified media characteristic.
Notes:
mediaCharacteristic: A media characteristic for which you wish to obtain the available media selection options.
Only AVMediaCharacteristicAudible and AVMediaCharacteristicLegible 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.

Returns an AVMediaSelectionGroup object that contains one or more options with the media characteristic specified by mediaCharacteristic, or nil if none could be found.

You can invoke this method without blocking when the key availableMediaCharacteristicsWithMediaSelectionOptions has been loaded.
You can filter the options in the returned media selection group according to playability, locale, and additional media characteristics can be accomplished using the filtering methods defined in the AVMediaSelectionGroup class.

Feedback, Comments & Corrections

AVAssetMBS.metadata as AVMetadataItemMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 14.4 Yes No No Yes, macOS only No
Function: Provides access to an array of AVMetadataItems for all metadata identifiers for which a value is available.
Notes: Available in Mac OS X 10.10.

Feedback, Comments & Corrections

AVAssetMBS.metadataForFormat(Format as string) as AVMetadataItemMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of AVMetadataItem objects, one for each metadata item in the container of the specified format.
Notes:
format: The metadata format for which you want items.

Returns an array of AVMetadataItem objects, one for each metadata item in the container of the specified format, or nil if there is no metadata of the specified format.

You can filter the array by locale using metadataItemsFromArray (AVMetadataItem) or by key using metadataItemsFromArray (AVMetadataItem).
Becomes callable without blocking when availableMetadataFormats has been loaded.

Feedback, Comments & Corrections

AVAssetMBS.naturalSize as CGSizeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The encoded or authored size of the visual portion of the asset.

Feedback, Comments & Corrections

AVAssetMBS.preferredTransform as CGAffineTransformMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The preferred transform to apply to the visual content of the asset for presentation or processing. (read-only)
Notes: The value is often, but not always, the identity transform.

Feedback, Comments & Corrections

AVAssetMBS.readTimeCodeObjects as AVTimeCodeMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 17.5 Yes No No Yes, macOS only No
Function: Reads time codes from asset.
Notes:
Raises exception if not possible.
Returns empty array if nothing found.

Provides details on time codes.

Feedback, Comments & Corrections

AVAssetMBS.readTimeCodes as String()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 16.5 Yes No No Yes, macOS only No
Function: Reads time codes from asset.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.m4v")
dim a as AVAssetMBS = AVAssetMBS.assetWithFile(f)
dim timecodes() as string = a.readTimeCodes

break // see in debugger
Notes:
Raises exception if not possible.
Returns empty array if nothing found.

Format is 2 digit hours, double colon, 2 digit minutes, double colon, 2 digit seconds, double colon, 2 digit frames.
e.g. "01:02:03:04"

Please use readTimeCodeObjects for more options.

Feedback, Comments & Corrections

AVAssetMBS.statusOfValueForKey(key as string, byref error as NSErrorMBS) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Reports whether the value for a given key is immediately available without blocking. (required)
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.m4v")
dim a as AVAssetMBS = AVAssetmbs.assetWithFile(f)

if a = nil then
MsgBox "failed to read file at all"
Return
end if

// request duration property
a.loadValuesAsynchronouslyForKeys array("duration")

dim e as NSErrorMBS
dim Status as Integer = a.statusOfValueForKey("duration", e)
while status < a.AVKeyValueStatusLoaded
// wait for loading in background
status = a.statusOfValueForKey("duration", e)
wend

// got it?
if status <> a.AVKeyValueStatusLoaded then
MsgBox "Failed to load duration."
if e <> nil then
MsgBox e.LocalizedDescription
end if

else
MsgBox str(a.duration.Seconds)+" seconds long."
end if
Notes:
key: The key whose status you want.
error: If the status of the value for the key is AVKeyValueStatusFailed, upon return contains an NSError object that describes the failure that occurred.

Returns the current loading status of the value for key. For possible values, see "Protocol Methods."

You use this method to determine the availability of the value for a key. This method does not cause an asset 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 and wait for invocation of the completion handler to be informed of availability.

Feedback, Comments & Corrections

AVAssetMBS.trackGroups as AVAssetTrackGroupMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 14.0 Yes No No Yes, macOS only No
Function: An array containing all of the track groups in the asset. (read-only)
Notes:
This is an array of AVAssetTrackGroup instances, each representing a different grouping of tracks in the asset.
Available in OS X v10.9 and later.

Feedback, Comments & Corrections

AVAssetMBS.tracks as AVAssetTrackMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The tracks contained by the asset. (read-only)
Notes: Tracks are instances of AVAssetTrack.

Feedback, Comments & Corrections

AVAssetMBS.tracksWithMediaCharacteristic(mediaCharacteristic as string) as AVAssetTrackMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of AVAssetTrack objects of the asset that present media with a specified characteristic.
Notes:
mediaCharacteristic: The media characteristic according to which receiver filters its asset tracks.
Return san array of AVAssetTrack objects that present media with mediaCharacteristic, or nil if no tracks with the specified characteristic are available.
You can call this method without blocking when tracks has been loaded.

Feedback, Comments & Corrections

AVAssetMBS.tracksWithMediaType(mediaType as string) as AVAssetTrackMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of the asset tracks of the asset that present media of a specified type.
Notes:
mediaType: The media type according to which the asset filters its tracks.
Media types are defined in AVAssetTrack.

Returns an array of AVAssetTrack objects of the asset that present media of mediaType.
You can call this method without blocking when tracks has been loaded.

Feedback, Comments & Corrections

AVAssetMBS.trackWithTrackID(PersistentTrackID as Integer) as AVAssetTrackMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns the track with a specified track ID.
Notes:
trackID: The trackID of the requested asset track.

Returns the track with track ID trackID, or nil if no track with the specified ID is available.
You can call this method without blocking when tracks has been loaded.

Feedback, Comments & Corrections

AVAssetMBS.unusedTrackID as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an ID that is currently unused by any of the tracks in the asset.

Feedback, Comments & Corrections

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




Links
MBS Xojo PDF Plugins