Skip to content

Commit

Permalink
Fix play/pause button to update more consistently
Browse files Browse the repository at this point in the history
If you pause or resume the video too quickly, either by clicking the
pause/play button or through keypress, the OSC does not update itself
immediately. This workaround adds a small delay after pausing so that
the OSC can update itself promptly.

Original commit from: cyl0/ModernX@8cd17a3
Code taken from here: mpv-player/mpv#8155 (comment)
Related issues:
mpv-player/mpv#8172
mpv-player/mpv#8350
  • Loading branch information
dexeonify committed Dec 29, 2021
1 parent e83fd04 commit 3ce4f07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/modernx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,7 @@ end

function pause_state(name, enabled)
state.paused = enabled
mp.add_timeout(0.1, function() state.osd:update() end)
if user_opts.showonpause then
if enabled then
state.lastvisibility = user_opts.visibility
Expand Down

0 comments on commit 3ce4f07

Please sign in to comment.