Class VttCue

java.lang.Object
org.wicketstuff.html5.media.webvtt.VttCue

public class VttCue extends Object
A cue block containing the translations

Base on the browser cues can be styled with CSS. So you only have to include a CSS file into the HTML page the video is embedded.

Further information:
http://tiffanybbrown.com/2013/12/14/subtitles-and-captions-with-webvtt/
Author:
Tobias Soloschenko
  • Constructor Details

    • VttCue

      public VttCue(String cueId, VttTime startTime, VttTime stopTime, String text)
      Creates a cue with the required arguments
      Parameters:
      cueId - the id of the cue
      startTime - the start time of the cue
      stopTime - the end time of the cue
      text - the text of the cue
  • Method Details

    • getLine

      public String getLine()
      Gets the position the text will appear vertically
      Returns:
      the position the text will appear vertically
    • setLine

      public VttCue setLine(String line)
      Sets the position the text will appear vertically (number, percentage e.g. 20% or 10)
      Parameters:
      line - the position the text will appear vertically
      Returns:
      the cue to perform further operations
    • getPosition

      public String getPosition()
      Gets the position of the text
      Returns:
      the position of the text
    • setPosition

      public VttCue setPosition(String position)
      Sets the position the text will appear horizontally (percentage e.g. 20%)
      Parameters:
      position - the position of the text
      Returns:
      the cue to perform further operations
    • getSize

      public String getSize()
      Gets the size (width of the text area)
      Returns:
      the size (width of the text area)
    • setSize

      public VttCue setSize(String size)
      Sets the size (width of the text area)
      Parameters:
      size - the size of the text area (percentage e.g. 40%)
      Returns:
      the cue to perform further operations
    • getAlignment

      public VttCue.Alignment getAlignment()
      Gets the alignment of the text
      Returns:
      the alignment of the text
    • setAlignment

      public VttCue setAlignment(VttCue.Alignment alignment)
      Sets the alignment of the text
      Parameters:
      alignment - the alignment of the text
      Returns:
      the cue to perform further operations
    • getVertical

      public VttCue.Vertical getVertical()
      Gets the vertical behavior
      Returns:
      the vertical behavior
    • setVertical

      public VttCue setVertical(VttCue.Vertical vertical)
      Sets the text to be displayed vertically rather than horizontally, such as in some Asian languages
      Parameters:
      vertical - the vertical behavior
      Returns:
      the cue to perform further operations
    • getVoiceSpan

      public String getVoiceSpan()
      Gets the voice span applied to the cue
      Returns:
      the voice span applied to the cue
    • setVoiceSpan

      public VttCue setVoiceSpan(String voiceSpan)
      Sets a voice span applied to the cue
      Parameters:
      voiceSpan - the voice span applied to the cue
      Returns:
      the cue to perform further operations
    • getRegion

      public VttRegion getRegion()
      Gets the region applied to the cue
      Returns:
      the region applied to the cue
    • setRegion

      public VttCue setRegion(VttRegion vttRegion)
      Sets the region applied to the cue
      Parameters:
      vttRegion - the region applied to the cue
      Returns:
      the cue to perform further operations
    • getNote

      public String getNote()
      Gets the note of the cue
      Returns:
      the note of the cue
    • setNote

      public VttCue setNote(String note)
      Sets the note of the cue
      Parameters:
      note - the note to be set to the cue
      Returns:
      the cue to perform further operations
    • getCueId

      public String getCueId()
      Gets the cue id
      Returns:
      the cue id
    • getStartTime

      public VttTime getStartTime()
      Gets the start time
      Returns:
      the start time
    • getStopTime

      public VttTime getStopTime()
      Gets the stop time
      Returns:
      the stop time
    • getText

      public String getText()
      Gets the text content
      Returns:
      the content as String
    • getRepresentation

      public StringBuilder getRepresentation()
      Gets the representation as builder
      Returns:
      thre representation as builder