Skip to content

Commit

Permalink
Merge pull request #66 from Samillion/dev_mouse_seek_opts
Browse files Browse the repository at this point in the history
Add option to control pause state while seeking with mouse move
  • Loading branch information
Samillion authored Oct 20, 2024
2 parents bc250fb + 9e62b5b commit 32667ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/USER_OPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Create `modernz.conf` in your mpv script-opts directory:
| seekrangealpha | 150 | transparency of seekranges |
| livemarkers | yes | update seekbar chapter markers on duration change |
| osc_on_seek | no | show osc when seeking |
| mouse_seek_pause | yes | should the video pause while seeking with mouse move? (on button hold) |
| automatickeyframemode | yes | set seekbarkeyframes based on video length to prevent laggy scrubbing on long videos |
| automatickeyframelimit | 600 | videos of above this length (in seconds) will have seekbarkeyframes on |

Expand Down
2 changes: 2 additions & 0 deletions modernz.conf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ seekrangealpha=150
livemarkers=yes
# show osc when seeking? or input.conf: x script-message-to modernz osc-show
osc_on_seek=no
# should the video pause while seeking with mouse move? (on button hold)
mouse_seek_pause=yes
# set seekbarkeyframes based on video length to prevent laggy scrubbing on long videos
automatickeyframemode=yes
# videos of above this length (in seconds) will have seekbarkeyframes on
Expand Down
3 changes: 2 additions & 1 deletion modernz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ local user_opts = {
livemarkers = true, -- update seekbar chapter markers on duration change

osc_on_seek = false, -- show osc when seeking? or input.conf: x script-message-to modernz osc-show
mouse_seek_pause = true, -- should the video pause while seeking with mouse move? (on button hold)

automatickeyframemode = true, -- set seekbarkeyframes based on video length to prevent laggy scrubbing on long videos
automatickeyframelimit = 600, -- videos of above this length (in seconds) will have seekbarkeyframes on
Expand Down Expand Up @@ -1977,7 +1978,7 @@ local function osc_init()
-- mouse move events may pile up during seeking and may still get
-- sent when the user is done seeking, so we need to throw away
-- identical seeks
if mp.get_property("pause") == "no" then
if mp.get_property("pause") == "no" and user_opts.mouse_seek_pause then
state.playingWhilstSeeking = true
mp.commandv("cycle", "pause")
end
Expand Down

0 comments on commit 32667ea

Please sign in to comment.