Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eoinsha/vtt-cue-object


https://github.com/eoinsha/vtt-cue-object

Last synced: 15 days ago
JSON representation

Awesome Lists containing this project

README

        

vtt-cue-object
===

[![Build Status](https://travis-ci.org/eoinsha/vtt-cue-object.svg?branch=master)](https://travis-ci.org/eoinsha/vtt-cue-object)

Simple wrapper around [vtt.js](https://github.com/mozilla/vtt.js) that runs without any browser and produces an object representation of WebVTT cues.

# Usage

```
var VttToObject = require('vtt-cue-object');
var vttText = '...'; // (WebVTT subtitles as a string)
VttToObject(vttText, function (err, obj) {
if (!err) {
// obj has startTime and endTime (decimal seconds) and text (string)
}
});