- Version
- 1.1.0
- License
- MIT
- Source
- SubtitleRendererIsd.js, line 13
Constructor
new SubtitleRendererIsd(player, parent)
Members
private #currentCues :Map<any, {ele: HTMLElement}>
Active cue map managed by this renderer.
- Type
- Map<any, {ele: HTMLElement}>
- Source
- SubtitleRendererIsd.js, line 23
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 47
update(activeCues)
Syncs active cues with the renderer, adding new ones and removing inactive ones.
| Name | Type | Description |
|---|---|---|
activeCues |
Array<TextTrackCue> |
Currently active cues. |
- Source
- SubtitleRendererIsd.js, line 57
render(cue)
Renders a TTML subtitle cue to the DOM using DomSmith. The rendered node is stored internally so it can be removed later.
| Name | Type | Description |
|---|---|---|
cue |
Object |
The subtitle cue to render. |
- Source
- SubtitleRendererIsd.js, line 74
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 92
private #removeCue(cue)
Remove a single cue from DOM and state.
| Name | Type | Description |
|---|---|---|
cue |
TextTrackCue |
Cue to remove. |
- Source
- SubtitleRendererIsd.js, line 123
clear()
Clears the current subtitle output.
- Source
- SubtitleRendererIsd.js, line 136
destroy()
Destroys the renderer and cleans up DOM and references.
- Source
- SubtitleRendererIsd.js, line 149