One Logo Pool Ball
AVFoundation · IOS API REFERENCE

AVAsset

class · iOS 4.0+ · SDK 27.1

class AVAsset

Members (46)

init · iOS 4.0+ · Deprecated in iOS 18.0

init

TypeScript
static init(URL: string): AVAsset
Swift declaration
convenience init(url URL: URL)
method

cancelLoading

TypeScript
cancelLoading(): void
Swift declaration
func cancelLoading()
method · iOS 6.0+ · Deprecated in iOS 16.0

chapterMetadataGroups

TypeScript
chapterMetadataGroupsBestMatchingPreferredLanguages(preferredLanguages: Array<string>): Array<AVTimedMetadataGroup>
Swift declaration
func chapterMetadataGroups(bestMatchingPreferredLanguages preferredLanguages: [String]) -> [AVTimedMetadataGroup]
method · iOS 4.3+ · Deprecated in iOS 16.0

chapterMetadataGroups

TypeScript
chapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeys(locale: _Foundation_Locale, commonKeys?: (Array<AVMetadataKey>) | null): Array<AVTimedMetadataGroup>
Swift declaration
func chapterMetadataGroups(withTitleLocale locale: Locale, containingItemsWithCommonKeys commonKeys: [AVMetadataKey]?) -> [AVTimedMetadataGroup]
method · iOS 15.0+

findUnusedTrackID

TypeScript
findUnusedTrackID(completionHandler: ((arg0: number, arg1: (NativeError) | null) => void)): void
Swift declaration
func findUnusedTrackID() async throws -> CMPersistentTrackID
method · iOS 15.0+

loadChapterMetadataGroups

TypeScript
loadChapterMetadataGroupsBestMatchingPreferredLanguagesCompletionHandler(preferredLanguages: Array<string>, completionHandler: ((arg0: (Array<AVTimedMetadataGroup>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadChapterMetadataGroups(bestMatchingPreferredLanguages preferredLanguages: [String]) async throws -> [AVTimedMetadataGroup]
method · iOS 15.0+

loadMediaSelectionGroup

TypeScript
loadMediaSelectionGroup(mediaCharacteristic: AVMediaCharacteristic, completionHandler: ((arg0: (AVMediaSelectionGroup) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadMediaSelectionGroup(for mediaCharacteristic: AVMediaCharacteristic) async throws -> AVMediaSelectionGroup?
method · iOS 15.0+

loadMetadata

TypeScript
loadMetadata(format: AVMetadataFormat, completionHandler: ((arg0: (Array<AVMetadataItem>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadMetadata(for format: AVMetadataFormat) async throws -> [AVMetadataItem]
method · iOS 15.0+

loadTrack

TypeScript
loadTrack(trackID: number, completionHandler: ((arg0: (AVAssetTrack) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadTrack(withTrackID trackID: CMPersistentTrackID) async throws -> AVAssetTrack?
method · iOS 15.0+

loadTracks

TypeScript
loadTracksWithMediaCharacteristicCompletionHandler(mediaCharacteristic: AVMediaCharacteristic, completionHandler: ((arg0: (Array<AVAssetTrack>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadTracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) async throws -> [AVAssetTrack]
method · iOS 15.0+

loadTracks

TypeScript
loadTracksWithMediaTypeCompletionHandler(mediaType: AVMediaType, completionHandler: ((arg0: (Array<AVAssetTrack>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadTracks(withMediaType mediaType: AVMediaType) async throws -> [AVAssetTrack]
method · iOS 5.0+ · Deprecated in iOS 16.0

mediaSelectionGroup

TypeScript
mediaSelectionGroup(mediaCharacteristic: AVMediaCharacteristic): (AVMediaSelectionGroup) | null
Swift declaration
func mediaSelectionGroup(forMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) -> AVMediaSelectionGroup?
method · iOS 4.0+ · Deprecated in iOS 16.0

metadata

TypeScript
metadataForFormat(format: AVMetadataFormat): Array<AVMetadataItem>
Swift declaration
func metadata(forFormat format: AVMetadataFormat) -> [AVMetadataItem]
method · iOS 4.0+ · Deprecated in iOS 16.0

track

TypeScript
track(trackID: number): (AVAssetTrack) | null
Swift declaration
func track(withTrackID trackID: CMPersistentTrackID) -> AVAssetTrack?
method · iOS 4.0+ · Deprecated in iOS 16.0

tracks

TypeScript
tracksWithMediaCharacteristic(mediaCharacteristic: AVMediaCharacteristic): Array<AVAssetTrack>
Swift declaration
func tracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) -> [AVAssetTrack]
method · iOS 4.0+ · Deprecated in iOS 16.0

tracks

TypeScript
tracksWithMediaType(mediaType: AVMediaType): Array<AVAssetTrack>
Swift declaration
func tracks(withMediaType mediaType: AVMediaType) -> [AVAssetTrack]
method · iOS 4.0+ · Deprecated in iOS 16.0

unusedTrackID

TypeScript
unusedTrackID(): number
Swift declaration
func unusedTrackID() -> CMPersistentTrackID
get · iOS 11.0+ · Deprecated in iOS 16.0

allMediaSelections

TypeScript
get allMediaSelections(): Array<AVMediaSelection>
Swift declaration
var allMediaSelections: [AVMediaSelection] { get }
get · iOS 4.3+ · Deprecated in iOS 16.0

availableChapterLocales

TypeScript
get availableChapterLocales(): Array<_Foundation_Locale>
Swift declaration
var availableChapterLocales: [Locale] { get }
get · iOS 5.0+ · Deprecated in iOS 16.0

availableMediaCharacteristicsWithMediaSelectionOptions

TypeScript
get availableMediaCharacteristicsWithMediaSelectionOptions(): Array<AVMediaCharacteristic>
Swift declaration
var availableMediaCharacteristicsWithMediaSelectionOptions: [AVMediaCharacteristic] { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

availableMetadataFormats

TypeScript
get availableMetadataFormats(): Array<AVMetadataFormat>
Swift declaration
var availableMetadataFormats: [AVMetadataFormat] { get }
get · iOS 9.0+ · Deprecated in iOS 16.0

canContainFragments

TypeScript
get canContainFragments(): boolean
Swift declaration
var canContainFragments: Bool { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

commonMetadata

TypeScript
get commonMetadata(): Array<AVMetadataItem>
Swift declaration
var commonMetadata: [AVMetadataItem] { get }
get · iOS 9.0+ · Deprecated in iOS 16.0

isCompatibleWithAirPlayVideo

TypeScript
get isCompatibleWithAirPlayVideo(): boolean
Swift declaration
var isCompatibleWithAirPlayVideo: Bool { get }
get · iOS 5.0+ · Deprecated in iOS 16.0

isCompatibleWithSavedPhotosAlbum

TypeScript
get isCompatibleWithSavedPhotosAlbum(): boolean
Swift declaration
var isCompatibleWithSavedPhotosAlbum: Bool { get }
get · iOS 4.3+ · Deprecated in iOS 16.0

isComposable

TypeScript
get isComposable(): boolean
Swift declaration
var isComposable: Bool { get }
get · iOS 9.0+ · Deprecated in iOS 16.0

containsFragments

TypeScript
get containsFragments(): boolean
Swift declaration
var containsFragments: Bool { get }
get · iOS 5.0+ · Deprecated in iOS 16.0

creationDate

TypeScript
get creationDate(): (AVMetadataItem) | null
Swift declaration
var creationDate: AVMetadataItem? { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

duration

TypeScript
get duration(): _CoreMedia_CMTime
Swift declaration
var duration: CMTime { get }
get · iOS 4.3+ · Deprecated in iOS 16.0

isExportable

TypeScript
get isExportable(): boolean
Swift declaration
var isExportable: Bool { get }
get · iOS 4.2+ · Deprecated in iOS 16.0

hasProtectedContent

TypeScript
get hasProtectedContent(): boolean
Swift declaration
var hasProtectedContent: Bool { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

lyrics

TypeScript
get lyrics(): (string) | null
Swift declaration
var lyrics: String? { get }
get · iOS 8.0+ · Deprecated in iOS 16.0

metadata

TypeScript
get metadata(): Array<AVMetadataItem>
Swift declaration
var metadata: [AVMetadataItem] { get }
get · iOS 13.0+ · Deprecated in iOS 16.0

minimumTimeOffsetFromLive

TypeScript
get minimumTimeOffsetFromLive(): _CoreMedia_CMTime
Swift declaration
var minimumTimeOffsetFromLive: CMTime { get }
get · iOS 10.2+ · Deprecated in iOS 16.0

overallDurationHint

TypeScript
get overallDurationHint(): _CoreMedia_CMTime
Swift declaration
var overallDurationHint: CMTime { get }
get · iOS 4.3+ · Deprecated in iOS 16.0

isPlayable

TypeScript
get isPlayable(): boolean
Swift declaration
var isPlayable: Bool { get }
get · iOS 9.0+ · Deprecated in iOS 16.0

preferredMediaSelection

TypeScript
get preferredMediaSelection(): AVMediaSelection
Swift declaration
var preferredMediaSelection: AVMediaSelection { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

preferredRate

TypeScript
get preferredRate(): number
Swift declaration
var preferredRate: Float { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

preferredTransform

TypeScript
get preferredTransform(): _CoreFoundation_CGAffineTransform
Swift declaration
var preferredTransform: CGAffineTransform { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

preferredVolume

TypeScript
get preferredVolume(): number
Swift declaration
var preferredVolume: Float { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

providesPreciseDurationAndTiming

TypeScript
get providesPreciseDurationAndTiming(): boolean
Swift declaration
var providesPreciseDurationAndTiming: Bool { get }
get · iOS 4.3+ · Deprecated in iOS 16.0

isReadable

TypeScript
get isReadable(): boolean
Swift declaration
var isReadable: Bool { get }
get · iOS 5.0+

referenceRestrictions

TypeScript
get referenceRestrictions(): AVAssetReferenceRestrictions
Swift declaration
var referenceRestrictions: AVAssetReferenceRestrictions { get }
get · iOS 7.0+ · Deprecated in iOS 16.0

trackGroups

TypeScript
get trackGroups(): Array<AVAssetTrackGroup>
Swift declaration
var trackGroups: [AVAssetTrackGroup] { get }
get · iOS 4.0+ · Deprecated in iOS 16.0

tracks

TypeScript
get tracks(): Array<AVAssetTrack>
Swift declaration
var tracks: [AVAssetTrack] { get }
method · iOS 15.0+

loadChapterMetadataGroups

TypeScript
loadChapterMetadataGroupsWithTitleLocaleContainingItemsWithCommonKeys(locale: _Foundation_Locale, commonKeys?: Array<AVMetadataKey>): Promise<Array<AVTimedMetadataGroup>>
Swift declaration
func loadChapterMetadataGroups(withTitleLocale locale: Locale, containingItemsWithCommonKeys commonKeys: [AVMetadataKey] = []) async throws -> [AVTimedMetadataGroup]

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. - Parameters: - 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. - 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.metadataItems(from:filteredAndSortedAccordingToPreferredLanguages:)`. Filtering of the metadata items according to locale can be accomplished using `AVMetadataItem.metadataItems(from:withLocale:)`.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

AVAsset.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All AVFoundation types →