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

Add support for automatically having OSC visible on pause. #8107

Closed
rasmus-kirk opened this issue Sep 21, 2020 · 7 comments
Closed

Add support for automatically having OSC visible on pause. #8107

rasmus-kirk opened this issue Sep 21, 2020 · 7 comments

Comments

@rasmus-kirk
Copy link

Hi, it would be nice for an option that allows the bottom bar to be visible when the video is paused. I think the easiest way to do this would be to add it to the OSC visibility cycle:

Expected behavior of the wanted feature

Cycling between OSC visibility should include the option of showing it when video is paused.

Alternative behavior of the wanted feature

Only allows cycling between never / auto (mouse-move) / always

Log file

None

@avih
Copy link
Member

avih commented Sep 21, 2020

I think the easiest way to do this...

No. The easiest way is that you use a script similar to this one:

mp.observe_property("pause", "bool", function(name, val)
    mp.commandv("script-message", "osc-visibility", val and "always" or "auto")
end)

However, I think there's currently a bug in mpv which sometimes prevents it from becoming visible when pausing.

@oe-d
Copy link

oe-d commented Sep 22, 2020

However, I think there's currently a bug in mpv which sometimes prevents it from becoming visible when pausing.

Yeah, that happens on windows.

mp.observe_property("pause", "bool", function(name, val)
    mp.commandv("script-message", "osc-visibility", val and "always" or "auto", "no-osd")
    mp.osd_message(" ", 0.001)
end)

@rasmus-kirk
Copy link
Author

Thanks, both of you, this works great! I was tinkering around with trying to remove the osd message yesterday but it would not work properly. @oe-d I wonder why the mp.osd_message(" ", 0.001) is needed? I tried removing it, but the OSC would not always show up on pause without it.

@rasmus-kirk
Copy link
Author

To be clear it works perfectly if I include it.

@oe-d
Copy link

oe-d commented Sep 22, 2020

Graphics sometimes doesn't render if the player is paused and there's no mouse movement or osd messages. Clicking the mute icon when paused doesn't update the graphic until you move the mouse or unpause. It can be done though, as uosc renders when paused.

@oe-d
Copy link

oe-d commented Sep 22, 2020

This won't block the default osd.

overlay = mp.create_osd_overlay("ass-events")
mp.observe_property("pause", "bool", function(name, val)
    mp.commandv("script-message", "osc-visibility", val and "always" or "auto", "no-osd")
    overlay:update()
    mp.add_timeout(0.05, function() overlay:remove() end)
end)

@rasmus-kirk
Copy link
Author

Thank you, I'll try using that, I'm closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants