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

The subtitles stay when the character has just finished saying the line. #15

Open
Holominanu opened this issue Nov 1, 2023 · 6 comments

Comments

@Holominanu
Copy link

For example, when the character says 'hello everyone' and finishes saying the sentence, during that moment of silence, the phrase 'hello everyone' still remains at the bottom, waiting for another character to say something.

@gignupg
Copy link
Owner

gignupg commented Nov 2, 2023

Hey @Holominanu, you're right, I programmed the extension in such a way that the subtitles get still shown until the next subtitles appear except when the silence is longer than just a few seconds. If the silence is longer than just a few seconds, the subtitles disappear.

@jrc
Copy link

jrc commented Sep 8, 2024

Love this extension, but I actually would like for the subtitle to disappear quickly. The reason for this is I want the English subtitle to flash so I can comprehend what's going on but I'd rather have my eyes follow the native language subtitle, or at least not spend too much time in "English mode". At least that was my idea.

I tried tweaking my srt file to have each subtitle be only 0.5 s, and that didn't work, which is how I found my way here.

@gignupg
Copy link
Owner

gignupg commented Sep 8, 2024

Hi @jrc, thanks for your comment! Unfortunately, I don't have time at the moment to add this feature. But if you want to add it I will gladly accept it!

@jrc
Copy link

jrc commented Sep 10, 2024

Looks like this does the trick, though of course that changes the default behavior.

diff --git a/src/pages/Content/subtitles/Subtitles.jsx b/src/pages/Content/subtitles/Subtitles.jsx
index d157330..327e20f 100644
--- a/src/pages/Content/subtitles/Subtitles.jsx
+++ b/src/pages/Content/subtitles/Subtitles.jsx
@@ -291,6 +291,10 @@ function Subtitles({ video, subsEnabled, speedDisplay, netflix, editRef }) {
     if (subs.length > 1) {
       timeUpdate(subs, video, pos, setPos);
     }
+
+    if (video.currentTime > subs[pos].end) {
+      setDisplaySubtitles(false);
+    }
   }
 
   const pauseHandler = () => {

@gignupg
Copy link
Owner

gignupg commented Sep 11, 2024

Thanks! I'll take a look at it tomorrow!

@gignupg
Copy link
Owner

gignupg commented Sep 14, 2024

@jrc, do you want to do a PR? Also, we only want to do this when the silence indicator is disabled. Because when it's enabled we want the subtitles to stick around til the next ones...

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

3 participants