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

Show Second Subtitles when hovering over the top quarter of the Video #119

Closed
Juiin opened this issue Sep 21, 2022 · 5 comments
Closed

Show Second Subtitles when hovering over the top quarter of the Video #119

Juiin opened this issue Sep 21, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@Juiin
Copy link

Juiin commented Sep 21, 2022

Migaku mpv has this feature which is very convienent. It displays the second Subtitles at the Top of the Screen when you hover over it with you mouse. I'm not sure if it is possible technically to only display the Second Subtitles and not the Primary ones, since they would be duplicated with the ones from Memento, but even if it displays both, i still think it would be a nice feature.

Basically Show Subtitles when your Mouse is over the top 25% of the Screen and Hide them otherwise, it would save me from using a hotkey.

@ripose-jp ripose-jp added the enhancement New feature or request label Sep 22, 2022
@ripose-jp
Copy link
Owner

This will be possible when mpv 0.35 releases. Until then, mpv isn't capable of displaying primary and secondary subtitles independently.

@Juiin
Copy link
Author

Juiin commented Sep 22, 2022

As i mentioned in the post, regardless of whether the primary subs are still visible or not, i still think this would be a great feature, if it is not too hard to implement.

Basically the way i used second subtitles with migaku mpv is to check my comprehension or check the english when i don't understand something. There i just need to hover over the top part of the screen, read the line, and move my mouse to hide the subs again. For me personally it would not matter if the primary subs become hard to read during this time, because they are displayed twice. That would just be polish.

@mansuen
Copy link

mansuen commented Jan 2, 2023

@ripose-jp now that mpv 0.35 has been released, is this enhancement considered for a future update? I think this would be very useful. I think that the secondary subtitles are sometimes distracting and it would be very convenient if they were hidden on default as they suggested. Thank you for developing Memento, it's an incredible application!

@ripose-jp
Copy link
Owner

It's completely possible and not particularly difficult to implement. Considering there is demand, I can bang it out some time soon. If you want though there's a script in #41 that will let you just toggle the secondary subtitle visibility with Alt+v without bringing up OSC text. You can also put secondary-sub-visibility=no in your mpv.conf to hide them by default.

Also I don't get notifications when someone reacts to a post, so I didn't know this one was popular.

ripose-jp added a commit that referenced this issue Mar 13, 2023
Allow the user to set whether or not to show primary and secondary
subtitle based on cursor position. Right now primary subtitles are
hardcoded to show if the cursor is on the bottom 20% of the screen.
Likewise secondary subtitles are hardcoded to show at the top 20% of the
screen. This assuming that subtitles are positioned in these two regions
as is convention. If someone is a freak and likes primary subtitles
located at the top of the screen for some reason, this setting will not
work for them. The only reason I don't have adjustable regions for
showing subtitles is due to the complexity of the settings UI. If I get
around to allowing for config files to be edited, I will absolutely add
adjustable regions.

This is made possible by a new HitTestWidget. This inherit from
a QWidget and overrides the mouseMoveEvent() to watch for mouse
movements. It can contain multiple regions to handle actions for, so
when the cursor interacts with that region it will automatically fire
off the region handler. This makes it easy to add more functionality
based on cursor position in the future.

All of this functionality is disabled by default.

Closes #119
ripose-jp added a commit that referenced this issue Mar 13, 2023
Allow the user to set whether or not to show primary and secondary
subtitle based on cursor position. Right now primary subtitles are
hardcoded to show if the cursor is on the bottom 20% of the screen.
Likewise secondary subtitles are hardcoded to show at the top 20% of the
screen. This assuming that subtitles are positioned in these two regions
as is convention. If someone is a freak and likes primary subtitles
located at the top of the screen for some reason, this setting will not
work for them. The only reason I don't have adjustable regions for
showing subtitles is due to the complexity of the settings UI. If I get
around to allowing for config files to be edited, I will absolutely add
adjustable regions.

This is made possible by a new HitTestWidget. This inherit from
a QWidget and overrides the mouseMoveEvent() to watch for mouse
movements. It can contain multiple regions to handle actions for, so
when the cursor interacts with that region it will automatically fire
off the region handler. This makes it easy to add more functionality
based on cursor position in the future.

All of this functionality is disabled by default.

Closes #119
@ripose-jp
Copy link
Owner

This has been implemented for both primary and secondary subtitles. I'll merge into master when I'm sure it works properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants