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

Validator doesn't notice if the hours field in the timestamp (if present) has only one digit #44

Open
yclicc opened this issue Jul 5, 2023 · 1 comment

Comments

@yclicc
Copy link

yclicc commented Jul 5, 2023

Related to #17 but this time for the hours field. The WebVTT format requires two digits at least if the hour field is present (see https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API#cue_timings ). This caused issues for me downstream with the AblePlayer video viewer as it silently failed to deal with captions after the hour mark when this wasn't correct.

@davemevans
Copy link
Contributor

Whilst the format does require that cue timings must have two or more digits if hours are in use (https://w3c.github.io/webvtt/#webvtt-timestamp), the algorithm specified for parsing timestamps explicitly does not validate that hours has two or more digits (https://www.w3.org/TR/webvtt1/#collect-a-webvtt-timestamp).

As stated in #17 (comment), webvtt.js implements that timestamp parsing algorithm as written in the spec, with the validator based 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

No branches or pull requests

2 participants