-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Allow control over OSC logo #10201
Comments
Hmm, how come? Can't you just save whatever the value of the osc property is first somewhere, turn it off, and then restore back the old value? Number 3 is not likely to happen. The mpv logo is actually just ASS that's compiled into the executable so it's not really setup for "user-friendly" tinkering. |
From the client API I think I can only get the state after startup by reading the conf file and also the script-opts property, so it's a bit inconvenient, slow and don't cover the use case that the user might change the state after startup. I proposed an okay solution here: CogentRedTester/mpv-file-browser#55 There are probably many scripts with that issue, one of mine here: https://github.com/stax76/mpv-scripts/blob/main/src/osm.lua For 1., if there are no objections, I can build it and send a PR when I have time. |
It seems like the OSC stores the current visibility state in the I tested and it gets updated when you cycle the visibility mode with a keybind. Edit: yes, it does so in this line |
I didn't really know about shared-script-properties. Your screenshot is very interesting, I didn't know it can be used in such ways. I have similar functionality in mpv.net, properties can be searched with the command palette and when the selected property is invoked the value is shown, and it can be selected in order to copy it to the clipboard. |
Oh my mistake, I mixed up |
CogentRedTester/mpv-file-browser#55 (comment) Still helpful would be osc options |
How so? I mean it's not hard of course, but is there value in letting |
The option of adding |
From a quick look in the code and some brief testing it would probably be as simple as modifying the following code (and adding the option obviously): Converting this: Lines 2575 to 2605 in f20dbcd
To this: if (user_opts.hide_logo) then
render_wipe()
else
-- render idle message
msg.trace("idle message")
local icon_x, icon_y = 320 - 26, 140
local line_prefix = ("{\\rDefault\\an7\\1a&H00&\\bord0\\shad0\\pos(%f,%f)}"):format(icon_x, icon_y)
local ass = assdraw.ass_new()
-- mpv logo
for i, line in ipairs(logo_lines) do
ass:new_event()
ass:append(line_prefix .. line)
end
-- Santa hat
if is_december and not user_opts.greenandgrumpy then
for i, line in ipairs(santa_hat_lines) do
ass:new_event()
ass:append(line_prefix .. line)
end
end
ass:new_event()
ass:pos(320, icon_y+65)
ass:an(8)
ass:append("Drop files or URLs to play here.")
set_osd(640, 360, ass.text)
end
-- I admit I don't know what this is for, so I'm not sure if it can be disabled too
if state.showhide_enabled then
mp.disable_key_bindings("showhide")
mp.disable_key_bindings("showhide_wc")
state.showhide_enabled = false
end Edit: I used a hide_logo option but showlogo might fit the naming scheme better |
But you can just send a script message to the osc to turn off the visibility and then show your logo. I don't see what the difference is in practice. Am I just missing something here? |
Users who don't want a logo at all (maybe the same people who want to disable the Santa hat). I guess the advantage is that you don't have to worry about restoring the OSC visibility to the same value or about overwriting other script-opts, you can just enable/disable the logo and no other OSC behaviour would be disabled. See my comment here for an analysis of what can go wrong when using the visibility option: CogentRedTester/mpv-file-browser#55 (comment). |
I see, that was informative. We don't like touching the osc much because it's complicated but this part is thankfully trivial. |
I just don't think should control the visibility of osc in other scripts, because users may use other osc scripts. It is better to implement the corresponding options by osc script(Including other user's osc script). In fact, after seeing this issue, I added corresponding options of |
This is mainly for other user scripts that may conflict with the osc logo in some way. While you can use script-message and shared-script-properties (highly discouraged in the documentation for some reason) to work around this, there's still some brittle edge cases and complicated logic that can pop up. Adding an option for these two things (the logo and the "drop files..." text) is really trivial and would make things easier for scripts. Discussed in a couple of issues below: mpv-player#10201 CogentRedTester/mpv-file-browser#55
Made a PR for this. I made the actual logo and the message text (Drop files...) separate options since the santa hat is already a separate option. |
This is mainly for other user scripts that may conflict with the osc logo in some way. While you can use script-message and shared-script-properties (highly discouraged in the documentation for some reason) to work around this, there's still some brittle edge cases and complicated logic that can pop up. Adding an option for these two things (the logo and the "drop files..." text) is really trivial and would make things easier for scripts. Discussed in a couple of issues below: mpv-player#10201 CogentRedTester/mpv-file-browser#55
With that, I can add the mpv.net overlay logo without having to worry that the osc logo is still sometimes visible, thanks! Regarding the overlap problem, the auto profile solution works well and is interesting as it shows advanced mpv concepts, the downside is that it requires user configuration. Here is another idea without user configuration: mpv would provide a new property If this could work, maybe provide this too, if it's not difficult to build, script authors have then a choice to decide which model they prefer and support. |
My last idea tried to solve a problem that doesn't even exist, the problem at hand is really only that an overlay script can overlap with the osc logo. So here is the next idea: A new osc message called
This way, scripts that show overlays only have to send the message before adding the overlay, no action is needed closing the overlay. mpv.net and other osc scripts can easily receive the message and act upon. |
For something like that, I think we could follow the |
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. #10201 CogentRedTester/mpv-file-browser#55
@stax76: Is it okay to close this one now? I know the third request isn't technically fulfilled. |
Yes, it's fine, thank you for improving the osc, I close it. |
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player/mpv#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
1. Completely hide the logo
Allow to completely hide the logo and logo caption via
showlogo
option.Use cases:
2. Hide and show the logo via script message
Use cases:
There are many menu scripts that conflict with the logo, personally I use file-browser (excellent script) and ogm (on screen menu), but there must be many like various bookmark scripts etc. Disabling the osc temporarily altogether would not work because the initial state (always, never, auto) cannot be accessed and thus be restored.
3. Allow replacing the logo with an image file
Allow replacing the logo with an image file and scale option, default is 0.5 which is half the height of the window. mpc has such a feature (without scale option).
The text was updated successfully, but these errors were encountered: