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

[PATCH] Support for multilines subtitles #1

Open
Schnouki opened this issue Feb 24, 2011 · 1 comment
Open

[PATCH] Support for multilines subtitles #1

Schnouki opened this issue Feb 24, 2011 · 1 comment
Assignees

Comments

@Schnouki
Copy link

Hi,

First of all thank you very much for this, it's really nice to have something so easy to use and that works so well to integrate subtitles in HTML5 videos.

In .srt subtitles I'm working on, I often have subtitles that are split on several lines:

1
00:00:08,200 --> 00:00:11,200
First line
second line

When using your lib, only the first line of those is displayed.

Here is a quick and ugly patch to fix this:

@@ -72,6 +72,8 @@
               subtitle = '';
               if (el.currentTime.toFixed(1) > timecode_min(el.subtitles[el.subcount][1]) && el.currentTime.toFixed(1) < timecode_max(el.subtitles[el.subcount][1])) {
                 subtitle = el.subtitles[el.subcount][2];
+                for (i=3; i < el.subtitles[el.subcount].length; i++)
+                  subtitle += '<br/>' + el.subtitles[el.subcount][i];
               }
               if (el.currentTime.toFixed(1) > timecode_max(el.subtitles[el.subcount][1]) && el.subcount < (el.subtitles.length - 1)) {
                 el.subcount++;

I'm sure you can do something less hackish to fix it, but I just wanted to tell you about this (small) issue :)

Regards,
Thomas

@makenosound
Copy link
Member

Hi Schnouki. I haven't been getting notified about any issues on Github, but thanks for the bug. I'll look at integrating a fix soon as I can.

@ghost ghost assigned makenosound May 14, 2011
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