Class: shaka.cea.Cea708Window

Constructor

new Cea708Window(windowNumnon-null)

Parameters:
Name Type Description
windowNum number
Source:

Members

MAX_COLS :number

Can be indexed 0-31 for 4:3 format, and 0-41 for 16:9 formats. Thus the absolute maximum is 42 columns for the 16:9 format.
Type:
  • number
Source:

MAX_ROWS :number

Maximum of 15 rows that can be indexed from 0 to 14.
Type:
  • number
Source:

TextJustification :number

Caption type.
Type:
  • number
Source:

anchorId_ :number

If valid, ranges from 0 to 8, specifying one of 9 locations on window: 0________1________2 | | | 3________4________5 | | | 6________7________8 Diagram is valid as per CEA-708-E section 8.4.4. Each of these locations corresponds to a WebVTT region's "region anchor".
Type:
  • number
Source:

backgroundColor_ :string

Indicates the background color at the current pen position.
Type:
  • string
Source:

col_ :number

Column that the current pen is pointing at.
Type:
  • number
Source:

colCount_ :number

Indicates the number of columns in this window's buffer/memory.
Type:
  • number
Source:

horizontalAnchor_ :number

Horizontal anchor. Loosely corresponds to a WebVTT viewport X anchor.
Type:
  • number
Source:

italics_ :boolean

Indicates whether the current pen position is italicized.
Type:
  • boolean
Source:

memory_ :Array.<!Array.<?shaka.cea.CeaUtils.StyledChar>>

An array of rows of styled characters, representing the current text and styling of text in this window.
Type:
Source:

relativeToggle_ :boolean

Indicates whether the horizontal and vertical anchors coordinates specify a percentage of the screen, or physical coordinates on the screen.
Type:
  • boolean
Source:

row_ :number

Row that the current pen is pointing at.
Type:
  • number
Source:

rowCount_ :number

Indicates the number of rows in this window's buffer/memory.
Type:
  • number
Source:

startTime_ :number

Type:
  • number
Source:

textColor_ :string

Indicates the text color at the current pen position.
Type:
  • string
Source:

underline_ :boolean

Indicates whether the current pen position is underlined.
Type:
  • boolean
Source:

verticalAnchor_ :number

Vertical anchor. Loosely corresponds to a WebVTT viewport Y anchor.
Type:
  • number
Source:

visible_ :boolean

Indicates whether this window is visible.
Type:
  • boolean
Source:

windowNum_ :number

A number from 0 - 7 indicating the window number in the service that owns this window.
Type:
  • number
Source:

Methods

backspace()

Erases a character from the buffer and moves the pen back.
Source:

carriageReturn()

Handles CR. Increments row - if last row, "roll up" all rows by one.
Source:

createNewRow_() → {Array.<?shaka.cea.CeaUtils.StyledChar>}

Allocates and returns a new row.
Source:
Returns:
Type
Array.<?shaka.cea.CeaUtils.StyledChar>

defineWindow(visiblenon-null, verticalAnchornon-null, horizontalAnchornon-null, anchorIdnon-null, relativeTogglenon-null, rowCountnon-null, colCountnon-null)

Parameters:
Name Type Description
visible boolean
verticalAnchor number
horizontalAnchor number
anchorId number
relativeToggle boolean
rowCount number
colCount number
Source:

display()

Sets the window to visible.
Source:

forceEmit(endTimenon-null, serviceNumbernon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}

Parameters:
Name Type Description
endTime number
serviceNumber number Number of the service emitting this caption.
Source:
Returns:
Type
shaka.cea.ICaptionDecoder.ClosedCaption

hide()

Sets the window to invisible.
Source:

horizontalCarriageReturn()

Handles HCR. Moves the pen to the beginning of the cur. row and clears it.
Source:

isPenInBounds_()

Source:

isVisible() → {boolean}

Source:
Returns:
Type
boolean

moveUpRows_(countnon-null)

Moves up rows in the buffer.
Parameters:
Name Type Description
count number
Source:

resetMemory()

Resets the memory buffer.
Source:

resetPen()

Reset the pen to 0,0 with default styling.
Source:

setCharacter(charnon-null)

Sets the unicode value for a char at the current pen location.
Parameters:
Name Type Description
char string
Source:

setJustification(justificationnon-null)

Parameters:
Name Type Description
justification shaka.cea.Cea708Window.TextJustification
Source:

setPenBackgroundColor(backgroundColornon-null)

Parameters:
Name Type Description
backgroundColor string
Source:

setPenItalics(italicsnon-null)

Parameters:
Name Type Description
italics boolean
Source:

setPenLocation(rownon-null, colnon-null)

Parameters:
Name Type Description
row number
col number
Source:

setPenTextColor(textColornon-null)

Parameters:
Name Type Description
textColor string
Source:

setPenUnderline(underlinenon-null)

Parameters:
Name Type Description
underline boolean
Source:

setStartTime(ptsnon-null)

Sets the start time for the cue to be emitted.
Parameters:
Name Type Description
pts number
Source:

toggle()

Toggles the visibility of the window.
Source: