TextTrackList

public protocol TextTrackList : EventDispatcherProtocol

A TextTrackList lists all available TextTrack objects that the player can display.

  • The number of text tracks in the list of text tracks.

    Declaration

    Swift

    var count: Int { get }
  • The TextTrack object representing the text track at the index position in the player’s list of text tracks.

    Declaration

    Swift

    func get(_ index: Int) -> TextTrack

    Parameters

    index

    Position of the returned TextTrack.

    Return Value

    The TextTrack at the index position.

  • Returns the TextTrack object representing the text track at the index position in the player’s list of text tracks.

    Declaration

    Swift

    subscript(index: Int) -> TextTrack { get set }

    Parameters

    index

    Position of the returned TextTrack.

    Return Value

    The TextTrack at the index position.

  • Adds the given event listener of the given TextTrackListEventType.

    Remark

    When attaching a listener on the wrong object the application will crash.

    Declaration

    Swift

    func addEventListener<E>(type: EventType<E>, listener: @escaping (E) -> ()) -> EventListener where E : EventProtocol

    Parameters

    type

    TextTrackListEventType of the added event listener.

    listener

    Closure called when event is dispatched.

    Return Value

    EventListener that can be removed.

  • Removes the given event listener of the given TextTrackListEventType.

    Declaration

    Swift

    func removeEventListener<E>(type: EventType<E>, listener: EventListener) where E : EventProtocol

    Parameters

    type

    TextTrackListEventType of the removed event listener.

    listener

    EventListener object that has been return on addEventListener.