Skip to content

Module: src/text/srtParser

Converts an SRT-formatted string to a WebVTT-formatted string.

Parameters:
Name Type Description
data string

The SRT input data.

Author
Silvia Pfeiffer
License
MIT
See
https://github.com/silviapfeiffer/silviapfeiffer.github.io/blob/master/index.html
Returns

A WebVTT-formatted string.

Type string
Source
srtParser.js, line 10

Methods

private, static convertSrtCue(caption) → string

Converts a single SRT cue entry to a WebVTT cue entry.

Parameters:
Name Type Description
caption string

The SRT cue text (including timecode and content).

Returns

A WebVTT cue string, or an empty string if parsing fails.

Type string
Source
srtParser.js, line 33