Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSD-info when video is paused #8155

Closed
Solarunit opened this issue Oct 9, 2020 · 10 comments
Closed

OSD-info when video is paused #8155

Solarunit opened this issue Oct 9, 2020 · 10 comments

Comments

@Solarunit
Copy link

Please add an OSD-info when video is paused - a text "Paused" at the top left corner of the video. The duration can be 2 sec or (preferably) until the video is unpaused.

Screenshot

@CogentRedTester
Copy link
Contributor

Add osd-msg between the key and command in input.conf:

SPACE osd-msg cycle pause

@Solarunit
Copy link
Author

@CogentRedTester unfortunately it doesn't work reliable

@oe-d
Copy link

oe-d commented Oct 12, 2020

Space no-osd cycle_values osd-msg1 Paused ""; cycle pause

@CogentRedTester
Copy link
Contributor

The following lua script should also work. Just replace the pause character with whatever text you want:

local ov = mp.create_osd_overlay('ass-events')
ov.data = "⏸️"

mp.observe_property('pause', 'bool', function(_, paused)
    if paused then ov:update()
    else ov:remove() end
end)

@Solarunit
Copy link
Author

Solarunit commented Oct 12, 2020

@oe-d this is perfect but the problem is - in 50% cases there is no osd-msg at all when I pause the video.

UPD: The osd-msg will show when you drag the mouse and the bottom control panel will appear. (see gif)

mpv

@CogentRedTester how to apply this lua script?

@oe-d
Copy link

oe-d commented Oct 12, 2020

That's mpv being stupid and sometimes not rendering the osd when the player is paused. Devs should probably look into that.

To use the script, save the text as a lua file and put it in .../mpv/scripts/ (https://mpv.io/manual/stable/#files)

@Solarunit
Copy link
Author

Solarunit commented Oct 13, 2020

To use the script, save the text as a lua file and put it in .../mpv/scripts/ (https://mpv.io/manual/stable/#files)

thanks!

That's mpv being stupid and sometimes not rendering the osd when the player is paused.

well, for me it happens very often (also when using @CogentRedTester script)

Devs should probably look into that.

I hope they do

@Akemi
Copy link
Member

Akemi commented Oct 13, 2020

if there isn't an open issue for it(?), no one will most likely look at it.

since the initial feature request has been fulfilled, i will close this.

@Akemi Akemi closed this as completed Oct 13, 2020
@CogentRedTester
Copy link
Contributor

@Solarunit Yes it looks like the OSD tends not to update for a short period of time after a pause. I've modified the script to wait for 0.1 seconds before adding the pause icon, and that seems to have fixed it:

local mp = require 'mp'
local ov = mp.create_osd_overlay('ass-events')
ov.data = [[{\fs100\an5}]] .. "⏸"

mp.observe_property('pause', 'bool', function(_, paused)
    mp.add_timeout(0.1, function()
        if paused then ov:update()
        else ov:remove() end
    end)
end)

I've also modified the style of the pause icon to be larger and in the center of the screen. Changing the ov.data line back to what it was before will undo the change if you don't like it.

@Solarunit
Copy link
Author

The script is working fine @CogentRedTester
Thanks!

lostthing added a commit to lostthing/mpv-osc-morden-x that referenced this issue Dec 21, 2021
When mouse click or keyboard press trigger play/pause, the button on osc interface don't update in time, this patch will fix it for better ux.

More info: mpv-player/mpv#8155 (comment)
dexeonify added a commit to dexeonify/mpv-config that referenced this issue Dec 29, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants