diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2017-03-27 17:44:24 +0100 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2017-03-27 18:00:56 +0100 |
commit | dc00ad537f74dc6010afdc5c4f03a32a8bf2793a (patch) | |
tree | 1ae7c06df6d81fa3eb0969d05b4a977f9da06c1c /player | |
parent | ebf61267f4349e28fa97c0c14c66631cbf24efba (diff) |
osc: make title configurable and use property expansion on it
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/osc.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 8997ae4ac6..569bb208ac 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -34,6 +34,8 @@ local user_opts = { layout = "bottombar", seekbarstyle = "bar", -- slider (diamond marker), knob (circle -- marker with guide), or bar (fill) + title = "${media-title}", -- string compatible with property-expansion + -- to be shown as OSC title tooltipborder = 1, -- border of tooltip in bottom/topbar timetotal = false, -- display total time instead of remaining time? timems = false, -- display timecodes with milliseconds? @@ -1511,12 +1513,8 @@ function osc_init() ne = new_element("title", "button") ne.content = function () - local title = mp.get_property_osd("media-title") - if not (title == nil) then - return (title) - else - return ("mpv") - end + local title = mp.command_native({"expand-text", user_opts.title}) + return not (title == "") and title or "mpv" end ne.eventresponder["mouse_btn0_up"] = function () |