ef-captions
Renders caption text synchronized to the timeline.
Renders caption text synchronized to the timeline.
| Attribute | React prop | Type | Default | Description |
|---|---|---|---|---|
captions-src | src | string | — | URL or path to a JSON file containing custom captions data. The JSON should conform to the Caption interface with 'segments' and 'word_segments' arrays. |
captions-script | captionsScript | string | — | ID of a <script> element containing JSON captions data. The script's textContent should be valid JSON conforming to the Caption interface. |
target | same | string | — | ID of the element to reference. |
duration | same | CSS time | — | How long this element is active. |
offset | same | CSS time | 0 | When this element starts within a parent fixed-mode group. |
Caption data format
{
"segments": [
{ "start": 0, "end": 3.2, "text": "Welcome to Editframe." }
],
"word_segments": [
{ "start": 0, "end": 0.6, "text": "Welcome" },
{ "start": 0.6, "end": 0.9, "text": "to" },
{ "start": 0.9, "end": 1.8, "text": "Editframe." }
]
}