Interface TextTrackCue

  • All Implemented Interfaces:
    com.theoplayer.android.api.event.EventDispatcher

    
    public interface TextTrackCue
     implements EventDispatcher<E>
                        

    Represents a cue of a text track.

    • Depending on the TextTrack's type, a cue might have different properties.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String getId() The identifier of the cue.
      abstract long getUid() A unique identifier of the text track cue.
      abstract double getStartTime()
      abstract void setStartTime(double startTime) Set playback position at which the cue becomes active, in seconds.
      abstract double getEndTime()
      abstract void setEndTime(double endTime) Set playback position at which the cue becomes inactive, in seconds.
      abstract JSONObject getContent() The content of the cue, it depends on the TextTrack's getType.
      • Methods inherited from class com.theoplayer.android.api.event.EventDispatcher

        addEventListener, removeEventListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getUid

         abstract long getUid()

        A unique identifier of the text track cue.

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

         abstract double getStartTime()
        Returns:

        The playback position at which the cue becomes active, in seconds.

      • setStartTime

         abstract void setStartTime(double startTime)

        Set playback position at which the cue becomes active, in seconds.

      • getEndTime

         abstract double getEndTime()
        Returns:

        The playback position at which the cue becomes inactive, in seconds.

      • setEndTime

         abstract void setEndTime(double endTime)

        Set playback position at which the cue becomes inactive, in seconds.

      • getContent

        @Nullable() abstract JSONObject getContent()

        The content of the cue, it depends on the TextTrack's getType.

        • 'emsg': Content is a Uint8Array representing the binary message data from the 'emsg' box.
        • 'eventstream': Content is the value of the 'messageData' attribute which was specified in the manifest.
        • 'ttml': Content is an intermediate TTML document’s body element. This is a view of a TTML document where all nodes in the document are active during the cue’s startTime and endTime. As a result, all begin, dur and end properties have been removed. TTML Styles, Regions and Metadata are stored in cue.styles, cue.regions, cue.metadata respectively. Combining those properties with the given content should suffice to render a TTML cue.
        • 'webvtt': Content is the cue text in raw unparsed form.
        • Null when the type is unknown.
        Returns:

        The content of the cue, represented by a JSONObject. (Nullable)