TextTrackDescription

@objc(THEOplayerTextTrackDescription)
open class TextTrackDescription : NSObject, Codable

A TextTrackDescription object contains a description of a side-loaded text track that will be added to the player.

Remark

MP4/3 streams only support VTT formatted text tracks. AirPlay is not supported with MP4/3 streams.
  • Whether the track should be enabled by default.

    Remark

    This may only be used on one track element per media element.

    Declaration

    Swift

    public var isDefault: Bool?
  • Whether the track should be enabled by default.

    Remark

    This may only be used on one track element per media element.

    Declaration

    Swift

    @objc(isDefault)
    public var isDefault_Objc: Bool { get set }
  • A TextTrackKind object specifying what kind of text track this is.

    Declaration

    Swift

    public var kind: TextTrackKind?
  • A TextTrackKind object specifying what kind of text track this is.

    Declaration

    Swift

    @objc(kind)
    public var kind_Objc: TextTrackKind { get set }
  • src

    Specifies a source URL where the text track can be downloaded from.

    Declaration

    Swift

    @objc
    public var src: URL
  • Specifies the main language of the track.

    Declaration

    Swift

    @objc
    public var srclang: String
  • Specifies a label for the track which can be used to identify it.

    Declaration

    Swift

    @objc
    public var label: String?
  • A TextTrackFormat object specifying what format of text track this is.

    Declaration

    Swift

    public var format: TextTrackFormat?
  • A TextTrackFormat object specifying what format of text track this is.

    Declaration

    Swift

    @objc(format)
    public var format_Objc: TextTrackFormat { get set }
  • Constructs a TextTrackDescription.

    Declaration

    Swift

    public init(src: String, srclang: String, isDefault: Bool? = nil, kind: TextTrackKind? = nil, label: String? = nil, format: TextTrackFormat? = nil)

    Parameters

    src

    The source of the text track.

    srclang

    The language of the text track.

    isDefault

    Whether the text track should be the default one, defaults to nil.

    kind

    The kind of the text track, defaults to nil.

    label

    The label of the text track, defaults to nil.

    format

    The format of the text track, defaults to nil.

  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws