summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Constantino <wiiaboo@gmail.com>2017-02-01 12:35:48 +0000
committerRicardo Constantino <wiiaboo@gmail.com>2017-02-01 13:26:38 +0000
commitbbf01346ff684f0f6a8cc8489b00920956dc16eb (patch)
treee597075426284c2166d4b149e71a78d2d8040fb3
parent2493d911225756ef43ca6737a68e29c0bab23162 (diff)
downloadmpv-bbf01346ff684f0f6a8cc8489b00920956dc16eb.tar.bz2
mpv-bbf01346ff684f0f6a8cc8489b00920956dc16eb.tar.xz
osc: allow playlist buttons when looping
Closes #4092
-rw-r--r--player/lua/osc.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index bc4226abba..160457458c 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -1516,6 +1516,7 @@ function osc_init()
local have_pl = (pl_count > 1)
local pl_pos = mp.get_property_number("playlist-pos", 0) + 1
local have_ch = (mp.get_property_number("chapters", 0) > 0)
+ local loop = mp.get_property("loop", "no")
local ne
@@ -1549,7 +1550,7 @@ function osc_init()
ne = new_element("pl_prev", "button")
ne.content = "\238\132\144"
- ne.enabled = (pl_pos > 1)
+ ne.enabled = (pl_pos > 1) or (loop ~= "no")
ne.eventresponder["mouse_btn0_up"] =
function ()
mp.commandv("playlist-prev", "weak")
@@ -1564,7 +1565,7 @@ function osc_init()
ne = new_element("pl_next", "button")
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"] =
function ()
mp.commandv("playlist-next", "weak")