-
Notifications
You must be signed in to change notification settings - Fork 8
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
Video pauses when clicking progress bar #33
Comments
You can rebind the e: for clarification: when the |
That's useful. Is it possible to have both |
This is a limitation of mpv's keybinding system: e: the above is patently false. mpv can bind multiple actions to a single key with the syntax While mpv-progressbar has the ability to dispatch click events internally, mpv cannot dispatch events to the script as well as to a normal command. Additionally, mpv has no idea where the script click zones are, so even if it could bind multiple commands, it would have no way to handle them appropriately. This is a major limitation of mpv's mouse handling. The only way to do this currently would be to absorb the click-to-pause functionality into mpv-progressbar. This behavior is niche enough (I suspect), that I don't think it makes sense to implement it wholesale. However, it should be straightforward to add functionality that allows users to specify arbitrary mouse zones in a config file. I think this would be useful enough that I'll add it when I get a chance. In the long term, I'd like to see mpv's mouse handling be improved in a way that such behavior could be supported more natively. While mpv has a deprecated private api that sort of tried to handle this use case, I recall trying it and having it not actually work correctly. I've also attempted to avoid using private apis as much as possible. |
That's a good idea. Thanks for your interest! Would this feature also add the ability to drag the progress bar for seeking in real time (without having to release the button) and avoid dragging the window at the same time? |
The |
It would make more sense if you linked zones directly rather than making people look for it on the scripts page. More importantly, and I may be wrong, I don't think zones would fix the problem at all because afaik, you still can't get around single target mouse dispatch. So the left click could go to zones, but then mpv-progressbar wouldn't receive the left clicks. Additionally, I don't like zones much because it's very limited. It can only break the window into a grid of 9 zones. I am interested in allowing users to specify arbitrarily shaped/sized areas. |
But that's exactly what E.g. put It works (with the minor inconvenience that if you click at the bottom 20% but outside of the bar itself - nothing will happen. But the top 80% will trigger a pause, and clicking the bar would work as expected). [edit] - minor fixes. |
Here's a fairly simple solution, although it requires modifying the progressbar.lua file: On lines 804 to 806 of progressbar.lua, you'll find the following text:
Immediately before that, add the following:
So now lines 804-809 of progressbar.lua should look like this:
Make sure the indentation is correct. You can change "cycle pause" to whatever MPV command you want. Disclaimer: I have no idea what I'm doing. I looked at the code for progressbar.lua and the code for zones.lua mentioned above and this is what I came up with. It seems to be working for me. |
Should be possible to use That's (apparently) what the default osc does to listen for mouse clicks without interfering with user-binding when not focused. |
I changed my mouse bindings so left click pauses the video (rather than right click) with
MOUSE_BTN0 cycle pause
. Unfortunately this makes this progress bar unusable because clicks will only pause the video. Is there any workaround for this?The text was updated successfully, but these errors were encountered: