Skip to content

KinoKabaret/webvtt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebVTT parser and validator

Relevant links:

Install

You can simply load the parser.js file into your HTML page and the API will become available on window. Alternatively you can install it using bower (webvtt) or npm (webvtt-parser).

API

This module exports classes to either through window or require()/import; the ones you are likely to need are WebVTTParser and WebVTTSerializer.

To parse a WebVTT string:

import { WebVTTParser } from 'webvtt-parser';
const parser = new WebVTTParser();
const tree = parser.parse(someVTT, 'metadata');

To serialize a WebVTT tree to string:

import { WebVTTSerializer } from 'webvtt-parser';
const seri = new WebVTTSerializer();
const tree = seri.serialize(vttTree.cues)

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.2%
  • HTML 10.8%