-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
WebVTT files with extended cue information do not display #877
Comments
Would it be possible to get a reduced test case set up for this? I can't say why that would prevent subtitles from showing but that does surprise me. The current parser was written a while ago, and the vtt spec has changed a bunch since then. I'm currently looking at another option for vtt parsing, but if you can figure out what's blocking captions showing we can probably get the current version patched. |
Confirming that this is still an issue as of 4.4.2. Actually there's a pretty simple quick fix. In the following line, we should actually be checking for The root issue though is splitting on colons is not the right way to split the time up, because currently it splits the flags too, and they get left behind. If we split on spaces first, that would separate out the flags before we split up the time itself. https://github.com/videojs/video.js/blob/v4.4.2/src/js/tracks.js#L505 I can't attack this right at the moment so if someone wants to pick it up please do. |
I wrote tests for this issue. For whoever takes a shot at fixing this, uncomment those lines and run tests. |
I submitted a pull request for this: trmb@56e540f Instead of fixing it inside of parseCueTime I just made sure that it is only sent the time components and not any extra data. (I also removed those commented out tests since they shouldn't apply now) |
The cue information fix will go out with v4.7.0. |
Valid WebVTT files with extended information cause the caption track to NOT be displayed at all. I'd expect it to simply ignore unsupported syntax. No error message is written to the console, either.
See http://dev.w3.org/html5/webvtt/
This works:
WEBVTT
00:00:01.400 --> 00:00:03.400
[Music]
00:00:09.233 --> 00:00:10.633
>>When I was a teenager,
00:00:10.633 --> 00:00:12.200
my father and brother were
00:00:12.200 --> 00:00:16.200
killed in a real tragic accident
00:00:16.200 --> 00:00:19.833
and left me to live on my own
00:00:19.833 --> 00:00:21.600
with my mother, while my two
00:00:21.600 --> 00:00:23.933
older sisters were off in college.
00:00:23.933 --> 00:00:26.333
I grew up fast.
00:00:26.333 --> 00:00:29.300
I grew up very quickly.
.... but this doesn't:
WEBVTT
00:00:01.400 --> 00:00:03.400 line:90% position:26% size:9%
[Music]
00:00:09.233 --> 00:00:10.633 line:90% position:17% size:29%
>>When I was a teenager,
00:00:10.633 --> 00:00:12.200 line:90% position:16% size:31%
my father and brother were
00:00:12.200 --> 00:00:16.200 align:start line:90% position:10% size:38%
killed in a real tragic accident
00:00:16.200 --> 00:00:19.833 align:start line:90% position:12% size:35%
and left me to live on my own
00:00:19.833 --> 00:00:21.600 align:start line:90% position:14% size:33%
with my mother, while my two
00:00:21.600 --> 00:00:23.933 align:start line:90% position:10% size:40%
older sisters were off in college.
00:00:23.933 --> 00:00:26.333 line:90% position:22% size:18%
I grew up fast.
00:00:26.333 --> 00:00:29.300 line:90% position:17% size:28%
I grew up very quickly.
The text was updated successfully, but these errors were encountered: