public class TextTrack : Track, Equatable, CustomStringConvertible
Text track metadata (subtitles/captions) and rendering hints.
public class TextTrack : Track, Equatable, CustomStringConvertible
Text track metadata (subtitles/captions) and rendering hints.
init(id:format:isPlatformRendered:source:primary:roles:properties:label:language:sourceUrl:isForced:kind:)
Creates a text track descriptor.
Swift
public init(
id: String,
format: TextFormat,
isPlatformRendered: Bool,
source: String = "",
primary: Bool = false,
roles: Roles = Roles(),
properties: Properties = Properties(),
label: String = "",
language: String = "",
sourceUrl: URL? = nil,
isForced: Bool = false,
kind: String = "")
id
|
Stable track identifier. |
format
|
Subtitle/text payload format. |
isPlatformRendered
|
Whether rendering is delegated to platform player. |
source
|
Source/adaptation-set identifier. |
primary
|
Whether this track is marked primary. |
roles
|
Role metadata map. |
properties
|
Extra property metadata map. |
label
|
User-visible track label. |
language
|
Language code. |
sourceUrl
|
Optional URL to sideloaded/remote track source. |
isForced
|
Whether this is a forced subtitle track. |
kind
|
Provider-defined text-track kind. |
Track type discriminator.
Swift
public let trackType: TrackType
Track identifier.
Swift
public let id: String
Source group identifier (provider-defined).
Swift
public let source: String
Whether this is marked as primary track.
Swift
public let primary: Bool
Role metadata.
Swift
public let roles: Roles
Extra property metadata.
Swift
public let properties: Properties
User-visible label.
Swift
public let label: String
Text format type.
Swift
public let format: TextFormat
Language code for this text track.
Swift
public let language: String
Optional remote/local source URL.
Swift
public let sourceUrl: URL?
Indicates forced-subtitle semantics.
Swift
public let isForced: Bool
Provider-defined text-track kind.
Swift
public let kind: String
Indicates whether platform renderer (e.g. AVPlayer) displays this track.
Swift
public let isPlatformRendered: Bool
Compares two text tracks field-by-field.
Swift
public static func == (lhs: TextTrack, rhs: TextTrack) -> Bool
Human-readable diagnostic representation.
Swift
public var description: String { get }