Instance Method

hasMediaCharacteristic(_:)

Returns a Boolean value that indicates whether the track references media with the specified media characteristic.

Declaration

func hasMediaCharacteristic(_ mediaCharacteristic: AVMediaCharacteristic) -> Bool

Parameters

mediaCharacteristic

The media characteristic of interest.

For possible values, such as visual, audible, or legible, see Media Characteristics in AVFoundation Constants.

Return Value

true if the track references media with the specified characteristic, otherwise false.

See Also

Retrieving Track Information

var asset: AVAsset?

The asset of which the track is a part.

var trackID: CMPersistentTrackID

The persistent unique identifier for this track.

var mediaType: AVMediaType

The media type for the track.

struct AVMediaCharacteristic

The options for specifying media type characteristics.

var formatDescriptions: [Any]

The format descriptions of the media samples referenced by the track.

var isEnabled: Bool

A Boolean value that indicates whether the track is enabled according to the state stored in its container.

var isPlayable: Bool

A Boolean value that indicates whether the track is playable in the current environment.

var isSelfContained: Bool

A Boolean value that indicates whether the track references sample data contained only within its storage container.

var estimatedDataRate: Float

The estimated data rate, in bits per second, of the media data referenced by the track.

var totalSampleDataLength: Int64

The total number of bytes of sample data required by the track.

var isDecodable: Bool

A Boolean value that indicates whether the receiver is decodable in the current environment.