Class: shaka.cea.Cea708Window

Constructor

new Cea708Window(windowNum)

Parameters:
Name Type Description
windowNum number
Source:

Members

AnchorId :number

Possible AnchorId values.
Type:
  • number
Source:

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 16 rows that can be indexed from 0 to 15.
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:

parentService_ :number

Number for the parent service (1 - 63).
Type:
  • number
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

adjustRegion_(region)

Support window positioning by mapping anchor related values to CueRegion. https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#positioning-in-cea-708
Parameters:
Name Type Description
region shaka.text.CueRegion
Source:

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(visible, verticalAnchor, horizontalAnchor, anchorId, relativeToggle, rowCount, colCount)

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(endTime, serviceNumber) → {shaka.extern.ICaptionDecoder.ClosedCaption}

Parameters:
Name Type Description
endTime number
serviceNumber number Number of the service emitting this caption.
Source:
Returns:
Type
shaka.extern.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_(count)

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(char)

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(backgroundColor)

Parameters:
Name Type Description
backgroundColor string
Source:

setPenItalics(italics)

Parameters:
Name Type Description
italics boolean
Source:

setPenLocation(row, col)

Parameters:
Name Type Description
row number
col number
Source:

setPenTextColor(textColor)

Parameters:
Name Type Description
textColor string
Source:

setPenUnderline(underline)

Parameters:
Name Type Description
underline boolean
Source:

setStartTime(pts)

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: