-
Notifications
You must be signed in to change notification settings - Fork 13
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
Restart playback with space
key binding
#291
Comments
Try
|
The only problem with that is pressing space will always go back to beginning (even in the middle of playback) so it's not ideal. |
I think I misunderstood. I still don't quite understand, you said:
That's from the beginning, right? If you meant to do it automatically, you can use the loop button. Again, sorry if I'm misunderstanding the request. |
Did you mean you want to assign the keybind automatically at end of playback otherwise the keybind is normal? You can add this as a script: ie: mp.observe_property("eof-reached", "bool", function(_, val)
if val then
mp.set_key_bindings({
{"SPACE", function() mp.command("seek 0 absolute; cycle pause") end}
}, "my-playback-restart", "force")
mp.enable_key_bindings("my-playback-restart")
else
mp.disable_key_bindings("my-playback-restart")
end
end) |
Perfect ! That's exactly what I was looking for. Thank you so much |
You are very welcome, and happy new year! 🥳 |
Happy New Year & ty for all the support. 👍🏻 |
Sam, I want |
Try: mp.observe_property("eof-reached", "bool", function(_, val)
if val then
mp.set_key_bindings({
{"SPACE", function() mp.command("seek 0 absolute; cycle pause") end},
{"MBTN_LEFT", function() mp.command("seek 0 absolute; cycle pause") end},
}, "my-playback-restart", "force")
mp.enable_key_bindings("my-playback-restart")
else
mp.disable_key_bindings("my-playback-restart")
end
end) But this conflicts with |
Great, It's working perfectly. Thanks. You're right about the conflict, though. |
Updated
|
Very quick work. Thanks Sam |
Expected behavior of the wanted feature
I was looking for a simple way to bind space to restart playback when end of file is reached, same way that YouTube does it.
control.lua can achieve this, for example with
space script-binding control/cycle-pause
, but it contains lots of extra stuff.If there's enough interest maybe this feature can be added in directly to ModernZ, or optionally under a wiki page.
The text was updated successfully, but these errors were encountered: