Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtitles can be compiled in non-chronological order #28

Closed
autotel opened this issue Nov 13, 2019 · 1 comment
Closed

Subtitles can be compiled in non-chronological order #28

autotel opened this issue Nov 13, 2019 · 1 comment
Assignees

Comments

@autotel
Copy link
Contributor

autotel commented Nov 13, 2019

I don't know if this qualifies as an issue, but in case it is any use for you.

It is possible to compile a vtt with subtitles in non chronological order. In order to produce this:

let webvtt=require("node-webvtt");
console.log(webvtt.compile({
    "valid":true,
    "cues":[
        {
           "identifier":"",
           "start":30,
           "end":31,
           "text":"This is a subtitle",
           "styles":"align:start line:0%"
        },
       {
          "identifier":"",
          "start":0,
          "end":1,
          "text":"Hello world!",
          "styles":""
       },
       {
          "identifier":"",
          "start":60,
          "end":61,
          "text":"Foo",
          "styles":""
       },
       {
          "identifier":"",
          "start":110,
          "end":111,
          "text":"Bar",
          "styles":""
       }
    ]
 }));

Whether this is a bug or not, depends on whether a non-chronological vtt file is admissible.

@osk
Copy link
Owner

osk commented Nov 13, 2019

I would categorize that as a bug since the resulting webvtt is invalid. I'll add a check against this and update. Thanks!

@osk osk self-assigned this Dec 30, 2019
@osk osk closed this as completed in c312489 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants