diff options
author | dudemanguy <random342@airmail.cc> | 2017-10-20 13:59:18 -0500 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2018-01-03 15:35:39 +0000 |
commit | c809b73db6ec1c70b9d46f33dd93a99ad005beb6 (patch) | |
tree | 45ebfa5877e1eeb7cb5a91817c149d1a0672a934 | |
parent | 3cb616a2862e5b86f06345c9e9ba2d518b6100b7 (diff) | |
download | mpv-c809b73db6ec1c70b9d46f33dd93a99ad005beb6.tar.bz2 mpv-c809b73db6ec1c70b9d46f33dd93a99ad005beb6.tar.xz |
osc: add seekbarkeyframes as a user option
-rw-r--r-- | DOCS/man/osc.rst | 9 | ||||
-rw-r--r-- | player/lua/osc.lua | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 5e5568ce7a..126d0532a5 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -171,6 +171,15 @@ Configurable Options marker with guide), or bar (fill). Default pre-0.21.0 was 'slider'. +``seekbarkeyframes`` + Default: yes + + Controls the mode used to seek when dragging the seekbar. By default, + keyframes are used. If set to false, exact seeking on mouse drags + will be used instead. Keyframes are preferred, but exact seeks may be + useful in cases where keyframes cannot be found. Note that using exact + seeks can potentially make mouse dragging much slower. + ``deadzonesize`` Default: 0.5 diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 58ee482d1e..2480515b78 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -34,6 +34,7 @@ local user_opts = { layout = "bottombar", seekbarstyle = "bar", -- slider (diamond marker), knob (circle -- marker with guide), or bar (fill) + seekbarkeyframes = true, -- use keyframes when dragging the seekbar title = "${media-title}", -- string compatible with property-expansion -- to be shown as OSC title tooltipborder = 1, -- border of tooltip in bottom/topbar @@ -1784,8 +1785,8 @@ function osc_init() local seekto = get_slider_value(element) if (element.state.lastseek == nil) or (not (element.state.lastseek == seekto)) then - mp.commandv("seek", seekto, - "absolute-percent", "keyframes") + mp.commandv("seek", seekto, "absolute-percent", + user_opts.seekbarkeyframes and "keyframes" or "exact") element.state.lastseek = seekto end |