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

fixes shared-script-properties deprecation in mpv 0.37.0 #50

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions src/patched_osc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2458,15 +2458,21 @@ function update_margins()
reset_margins()
end

utils.shared_script_property_set("osc-margins",
string.format("%f,%f,%f,%f", margins.l, margins.r, margins.t, margins.b))
mp.set_property_native("user-data/osc/margins", margins)
if mp.del_property then
mp.set_property_native("user-data/osc/margins", margins)
else
utils.shared_script_property_set("osc-margins",
string.format("%f,%f,%f,%f", margins.l, margins.r, margins.t, margins.b))
end
end

function shutdown()
reset_margins()
utils.shared_script_property_set("osc-margins", nil)
mp.del_property("user-data/osc")
if mp.del_property then
mp.del_property("user-data/osc")
else
utils.shared_script_property_set("osc-margins", nil)
end
end

--
Expand Down Expand Up @@ -3148,7 +3154,11 @@ function visibility_mode(mode, no_osd)
end

user_opts.visibility = mode
utils.shared_script_property_set("osc-visibility", mode)
if mp.del_property then
mp.set_property_native("user-data/osc/visibility", mode)
else
utils.shared_script_property_set("osc-visibility", mode)
end
mp.set_property_native("user-data/osc/visibility", mode)

if not no_osd and tonumber(mp.get_property("osd-level")) >= 1 then
Expand Down Expand Up @@ -3181,8 +3191,11 @@ function idlescreen_visibility(mode, no_osd)
user_opts.idlescreen = false
end

utils.shared_script_property_set("osc-idlescreen", mode)
mp.set_property_native("user-data/osc/idlescreen", user_opts.idlescreen)
if mp.del_property then
mp.set_property_native("user-data/osc/idlescreen", user_opts.idlescreen)
else
utils.shared_script_property_set("osc-idlescreen", mode)
end

if not no_osd and tonumber(mp.get_property("osd-level")) >= 1 then
mp.osd_message("OSC logo visibility: " .. tostring(mode))
Expand Down