Usage:
/**
* selector: string or video element
*/
var grabber = new SubtitleGrabber(selector);
/**
* return TextTrack Array
*/
grabber.getTextTracks();
/**
* index: selected track index, encoding: character encoding
* callBack: function
*/
grabber.getSrtLines(index, encoding, callBack);
grabber.getSrtLines(0, 'utf-8', function(lines){console.log(lines);});
/**
* download video
*/
grabber.downloadVideo();
/**
* download srt file
*/
grabber.downloadSrt(index, encoding, filename);
grabber.downloadSrt(0, 'utf-8', 'video.srt');
|