- Version
- 1.0.0
- License
- MIT
- Source
- SubtitleRendererIsd.js, line 13
Constructor
new SubtitleRendererIsd(player, parent)
Methods
canRender(cue) → boolean
Determines whether this renderer is suitable for rendering the given cue.
It only renders cues that contain an isd object and no text.
| Name | Type | Description |
|---|---|---|
cue |
Object |
The subtitle cue object. |
- Returns
-
True if this renderer can handle the cue, false otherwise.
- Type boolean
- Source
- SubtitleRendererIsd.js, line 41
render(cue, currentCues)
Renders a TTML subtitle cue to the DOM using DomSmith.
The rendered node is stored in the currentCues map, so it can be removed later.
| Name | Type | Description |
|---|---|---|
cue |
Object |
The subtitle cue to render. |
currentCues |
Map |
Map of active cues to DOM elements. |
- Source
- SubtitleRendererIsd.js, line 53
private #renderIsd(contents) → Array
Recursively converts ISD (Intermediate Synchronic Document) structure into a DOMSmith node tree.
Currently only supports div, p, span, and br elements with optional text content.
| Name | Type | Description |
|---|---|---|
contents |
Array |
The TTML ISD contents array. |
- Returns
-
Array of DomSmith node descriptors.
- Type Array
- Source
- SubtitleRendererIsd.js, line 71
clear()
Clears the current subtitle output.
- Source
- SubtitleRendererIsd.js, line 101
destroy()
Destroys the renderer and cleans up DOM and references.
- Source
- SubtitleRendererIsd.js, line 110