Closed TheJanusz closed 3 months ago
Will it helpful if parseTime
and stringifyTime
is provided?
import { parseTime, stringifyTime } from 'ass-compiler';
The provided methods for conversion definitely help. I guess I just wanted to learn why are they necessary in the first place?
EDIT: For my use caseit would be easier to work with timecodes directly.
ass-compiler
is original separated from ASS.js, which is used for rendering ASS, parsing times into floats is the way to 'use' it.
Other use cases like sorting or converting to SRT, VTT subtitles are also requires floats.
Subtitle editor is surely a use case, but if take more things like validation into consideration, maybe raw string is harder to handle with.
The provided API call parse
, keep it as raw string makes me feel it's not parsed.
Thank you for the explanation! I suspected it was for compatibility with something. I will continue using the conversion methods then.
Feel free to close this issue. I appreciate you taking time to help.
I am curious about the rationale for parsing time values into floats. I want to use ass-compiler for a subtitle editor and I'm using HTML time inputs which take in (and return) timecodes, so I need to parse these back and forth.
Would you consider adding a setting to disable time parsing? Or accept a PR for it?