Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eoinsha/vtt-cue-object
https://github.com/eoinsha/vtt-cue-object
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/eoinsha/vtt-cue-object
- Owner: eoinsha
- License: isc
- Created: 2016-10-20T14:13:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T05:26:10.000Z (over 7 years ago)
- Last Synced: 2024-10-17T02:23:39.903Z (3 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)
}
});