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

Timestamps with one digit allowed #17

Closed
swegen opened this issue Jan 30, 2019 · 7 comments · Fixed by #20
Closed

Timestamps with one digit allowed #17

swegen opened this issue Jan 30, 2019 · 7 comments · Fixed by #20

Comments

@swegen
Copy link

swegen commented Jan 30, 2019

The spec requires that a WebVTT timestamp has two or more ASCII digits for hours (if non-zero) and two ASCII digits for minutes.

WEBVTT

1:23.456 --> 1:23:45.678

However, the validator accepts above input as valid. The first value length in a timestamp before the first colon is not checked.

@annevk
Copy link
Member

annevk commented Jan 30, 2019

Well spotted. And this seems to have been a requirement since forever. However, I don't think it makes much sense given that one digit parses fine and seems perfectly reasonable?

@swegen
Copy link
Author

swegen commented Jan 30, 2019

I tested this with Firefox and it parses a timestamp with one digit hour just fine, but completely skips a cue using short timestamp with one digit minute.

@annevk
Copy link
Member

annevk commented Jan 30, 2019

Yeah, that's correct. Minutes have to be exactly two digits. (The specification also describes parser requirements. My implementation has a parser implementation per the specification and intertwined with that a validator.)

@swegen
Copy link
Author

swegen commented Jan 30, 2019

But still, your parser accepts the one digit minutes like below, for example.

WEBVTT

0:00.000 --> 1:00.000

@annevk
Copy link
Member

annevk commented Jan 30, 2019

Apologies, that does seem like a bug.

@yclicc
Copy link

yclicc commented Jul 4, 2023

The hours (if present) also have to be at least two digits, but the validator currently doesn't check that. It marked my VTT as OK but then when I loaded it into AblePlayer (which recommends using your validator) it didn't load any captions past the hour mark.

@annevk
Copy link
Member

annevk commented Jul 4, 2023

File a new issue on that?

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

Successfully merging a pull request may close this issue.

3 participants