1
mirror of https://github.com/mpv-player/mpv synced 2024-11-07 01:47:00 +01:00

osc: allow playlist buttons when looping

Closes #4092
This commit is contained in:
Ricardo Constantino 2017-02-01 12:35:48 +00:00
parent 2493d91122
commit bbf01346ff
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531

View File

@ -1516,6 +1516,7 @@ function osc_init()
local have_pl = (pl_count > 1) local have_pl = (pl_count > 1)
local pl_pos = mp.get_property_number("playlist-pos", 0) + 1 local pl_pos = mp.get_property_number("playlist-pos", 0) + 1
local have_ch = (mp.get_property_number("chapters", 0) > 0) local have_ch = (mp.get_property_number("chapters", 0) > 0)
local loop = mp.get_property("loop", "no")
local ne local ne
@ -1549,7 +1550,7 @@ function osc_init()
ne = new_element("pl_prev", "button") ne = new_element("pl_prev", "button")
ne.content = "\238\132\144" ne.content = "\238\132\144"
ne.enabled = (pl_pos > 1) ne.enabled = (pl_pos > 1) or (loop ~= "no")
ne.eventresponder["mouse_btn0_up"] = ne.eventresponder["mouse_btn0_up"] =
function () function ()
mp.commandv("playlist-prev", "weak") mp.commandv("playlist-prev", "weak")
@ -1564,7 +1565,7 @@ function osc_init()
ne = new_element("pl_next", "button") ne = new_element("pl_next", "button")
ne.content = "\238\132\129" ne.content = "\238\132\129"
ne.enabled = (have_pl) and (pl_pos < pl_count) ne.enabled = (have_pl and (pl_pos < pl_count)) or (loop ~= "no")
ne.eventresponder["mouse_btn0_up"] = ne.eventresponder["mouse_btn0_up"] =
function () function ()
mp.commandv("playlist-next", "weak") mp.commandv("playlist-next", "weak")