Understand the Subtitle Node structure
masterThe library works with an array of Node objects. Currently, it supports two types of nodes:
header: Represents the file header (e.g.,WEBVTT - Header content).cue: Represents an actual subtitle entry containing timing and text.
A cue node's data object contains:
start: Start time in milliseconds.end: End time in milliseconds.text: The subtitle text.settings: (Optional) VTT settings likealignorline.
[
{
type: 'header',
data: 'WEBVTT - Header content'
},
{
type: 'cue',
data: {
start: 150066,
end: 158952,
text: 'With great power comes great responsibility'
}
}
]