ef-captions

Renders caption text synchronized to the timeline.

Renders caption text synchronized to the timeline.

AttributeReact propTypeDefaultDescription
captions-srcsrcstringURL 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-scriptcaptionsScriptstringID of a <script> element containing JSON captions data. The script's textContent should be valid JSON conforming to the Caption interface.
targetsamestringID of the element to reference.
durationsameCSS timeHow long this element is active.
offsetsameCSS time0When 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." }
  ]
}