TextTrackCue_Objc

@objc(THEOplayerTextTrackCue)
public protocol TextTrackCue_Objc

A TextTrackCue object represents an individual cue and provides methods and properties to access the data and events to act on changes to cue state. Depending on the TextTrack’s type, a cue might have different properties.

  • The cue’s content.

    Remark

    • The type depends of the cue type.

    Declaration

    Swift

    var content: Any? { get }
  • If the cue’s type is WebVtt, the contentString is used. It contains the text track cue text in raw unparsed form.

    Declaration

    Swift

    var contentString: String? { get }
  • If the cue’s type is WebVtt, the contentDictionary is used. It contains the text track cue info in a dictionary.

    Declaration

    Swift

    var contentDictionary: [String : String]? { get }
  • The time in seconds and relative to a THEOplayer instance’s currentTime at which the cue becomes inactive.

    Remark

    • Supports double-precision floating-point format.

    Declaration

    Swift

    @available(*, deprecated, message: "This property will no longer be optional with the next major release.")
    @objc(endTime)
    var endTime_Objc: NSNumber? { get }
  • id

    The cue’s unique ID.

    Declaration

    Swift

    var id: String { get }
  • The time in seconds and relative to a THEOplayer instance’s currentTime at which the cue becomes active.

    Remark

    • Supports double-precision floating-point format.

    Declaration

    Swift

    @available(*, deprecated, message: "This property will no longer be optional with the next major release.")
    @objc(startTime)
    var startTime_Objc: NSNumber? { get }
  • The track the given cue belongs to.

    Declaration

    Swift

    @objc(track)
    var track_Objc: TextTrack_Objc? { get }
  • Adds the given event listener of the given TextTrackCueEventType.

    Remark

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

    Declaration

    Swift

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

    Parameters

    type

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

    Declaration

    Swift

    func removeEventListener(type: String, listener: EventListener)

    Parameters

    type

    TextTrackCueEventType of the removed event listener.

    listener

    EventListener object that has been return on addEventListener.