Open XCanG opened 7 years ago
There's no public API for it. One workaround is that once you have the ASS
object, you can iterate over each Dialogue
in ass.dialogues
and change its _start
and _end
private properties.
var ass = libjass.ASS.fromUrl(...).then(ass => { shift(ass, 2.000); return ass; });
function shift(ass, time) {
for (const dialogue of ass.dialogues) {
dialogue._start += time;
dialogue._end += time;
}
}
Will be something like that added in API or not?
The thing is I know website where libjass is used, also it have video and subtitles for it, but that subtitles are not syncronized (need add about +2 seconds to every line), I can't change any website resourses, but, will be great if I can call function from libjass what will automatically retime every line, something like
assObject.setTimeShifting(2000);
(+2000 ms, may be negative).I check API and don't find function, so it looks like it not exist. Would be great having something like that in this library.