# TextTrack Class

    public class TextTrack : Track, Equatable, CustomStringConvertible

Text track metadata (subtitles/captions) and rendering hints.

### Lifecycle

- `init(id:format:isPlatformRendered:source:primary:roles:properties:label:language:sourceUrl:isForced:kind:)`

  Creates a text track descriptor.

  #### Declaration

  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 = "")

  #### Parameters

  `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.

### Public

- `trackType`

  Track type discriminator.

  #### Declaration

  Swift

      public let trackType: TrackType

- `id`

  Track identifier.

  #### Declaration

  Swift

      public let id: String

- `source`

  Source group identifier (provider-defined).

  #### Declaration

  Swift

      public let source: String

- `primary`

  Whether this is marked as primary track.

  #### Declaration

  Swift

      public let primary: Bool

- `roles`

  Role metadata.

  #### Declaration

  Swift

      public let roles: Roles

- `properties`

  Extra property metadata.

  #### Declaration

  Swift

      public let properties: Properties

- `label`

  User-visible label.

  #### Declaration

  Swift

      public let label: String

- `format`

  Text format type.

  #### Declaration

  Swift

      public let format: TextFormat

- `language`

  Language code for this text track.

  #### Declaration

  Swift

      public let language: String

- `sourceUrl`

  Optional remote/local source URL.

  #### Declaration

  Swift

      public let sourceUrl: URL?

- `isForced`

  Indicates forced-subtitle semantics.

  #### Declaration

  Swift

      public let isForced: Bool

- `kind`

  Provider-defined text-track kind.

  #### Declaration

  Swift

      public let kind: String

- `isPlatformRendered`

  Indicates whether platform renderer (e.g. AVPlayer) displays this track.

  #### Declaration

  Swift

      public let isPlatformRendered: Bool

- `==(_:_:)`

  Compares two text tracks field-by-field.

  #### Declaration

  Swift

      public static func == (lhs: TextTrack, rhs: TextTrack) -> Bool

- `description`

  Human-readable diagnostic representation.

  #### Declaration

  Swift

      public var description: String { get }