Open nakkamarra opened 1 month ago
You're right, for this to work we would need to add a Comments []string
attribute to the Subtitles struct, set it properly when reading the webvtt and write it properly when writing the webvtt.
I'm not planning on adding this anytime soon, but I'm welcoming PRs (for which I can obviously offer guidance) 👍
You're right, for this to work we would need to add a
Comments []string
attribute to the Subtitles struct, set it properly when reading the webvtt and write it properly when writing the webvtt.I'm not planning on adding this anytime soon, but I'm welcoming PRs (for which I can obviously offer guidance) 👍
Hey thanks for the response @asticode, sure I'll give it a shot and put up PR.
When I read a webvtt file using the
ReadFromWebVTT
function, do some work, and attempt to write the captions back out toWriteToWebVTT
, the optional data after the WebVTT file signature is dropped.Example:
file.vtt:
output:
This isn't a huge deal, it doesn't seem to cause issues with parsing. But I would expect it to work, as it's technically valid according to the spec:
A WebVTT file body consists of the following components, in the following order: