Track_Objc

@objc(THEOplayerTrack)
public protocol Track_Objc

A track object.

Remark

  • Either a TextTrack or a MediaTrack.
  • A specific track type (e.g. TextTrack) will always be used.
  • The kind of the track.

    Remark

    The values for this property depend on the specific type of the track.

    Declaration

    Swift

    var kind: String { get }
  • The language of the track.

    Remark

    This is often an ISO639/2 language string.

    Example:

    "fra" for French
    

    Declaration

    Swift

    var language: String { get }

    Return Value

    The language of the track.

  • The label of the track.

    Remark

    • An empty string if there is no track.
    • When the label is an empty string, you should introduce a custom one.

    Declaration

    Swift

    var label: String { get }
  • id

    The identifier of the track.

    Remark

    This identifier can be used to destinguished between related tracks, e.g. tracks in the same list.

    Declaration

    Swift

    var id: String { get }
  • uid

    A unique identifier of the track.

    Remark

    • This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.
    • This identifier is a randomly generated number.

    Declaration

    Swift

    var uid: Int { get }
  • Adds the given event listener of the given TextTrackEventType.

    Remark

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

    Declaration

    Swift

    @discardableResult
    func addEventListener(type: String, listener: @escaping (EventProtocol) -> ()) -> EventListener

    Parameters

    type

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

    Declaration

    Swift

    func removeEventListener(type: String, listener: EventListener)

    Parameters

    type

    TextTrackEventType of the removed event listener.

    listener

    EventListener object that has been return on addEventListener.