captions-control
v1.3.0
Published
Library for modifying vtt subtitles.
Downloads
3
Readme
Library for modifying vtt subtitles.
const captions_control = require("captions_control")
captions_control.FFMPEG_PATH = ""
// If you are using convert then set this to a ffmpeg executable
captions_control.convert(text, type?)
// text may be a file, or a string.
// If it is a string then you should specify type as the text's extension (srt, ect)
// Returns a string of the text converted to the vtt format
captions_control.style(text, style, start?, end?)
// Gives CSS to the subtitles. style is a array of CSS.
// start should be the second it starts giving the CSS to the cues.
// end should be the second it finishes giving the CSS to the cues.
// Example of style array: ["color: red"]
captions_control.trim(text, modify_time, start?, end?)
// Trims the video so only the seconds in between
// Start and end will be visible.
// If modify_time is true, it will substract the time and start
// So it considers the new cues the start
captions_control.position(text, position, start?, end?)
// Changes the position of the cues in between
// Start and end
// Example of position array: ["line:63%", "position:72%" ,"align:start"]
// Learn more here: https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API