cniw / mpv-discordRPC

Discord Rich Presence integration for mpv Media Player
MIT License
133 stars 10 forks source link

Time left continues to decrease when the mpv is paused #9

Open cankaratepe23 opened 4 years ago

cankaratepe23 commented 4 years ago

On Windows 10, mpv version 0.32.0-288-gee70e8ce50 and mpv-discordRPC version 1.4.1-UNKNOWN I did not change any settings after installation.

When mpv is paused, Discord presence updates properly to show that the player is paused, but the remaining time continues ticking down, for around 15 seconds, after which, it jumps back to the proper time and continues ticking down.

e.g.:

Everything else works fine i.e. the current timestamp ("AV:") does not change while the time left counter is ticking down.

Here's a screen recording from the Discord desktop app to better illustrate my issue (username and tag blurred for privacy):

mpv-discordRPC

cniw commented 4 years ago

https://github.com/cniw/mpv-discordRPC/blob/6b49467cd644e2d72d7e2d836f052742cbca13e3/mpv_discordRPC.conf#L6-L10

@Mmedic23 sorry, slow response.

You can change the value to periodic_timer=1, the mpv_discordRPC.conf file is in the script-opts folder.

Should be understood that this only affects your local rpc on discord native client because the discord server limits it in 15 seconds each updates, so if you look at it from another device it will be the same.

hopefully this can solve your problem

cankaratepe23 commented 4 years ago

Is it not possible to pause the timer while the player is paused as well? Does it have to count down continuously?

cniw commented 4 years ago

it's possible, you just need to edit your configuration file as i said above but it has limitations caused by discord server it self. @Mmedic23 btw, have you tried it?

there 2 options can be used to display time stamps: elapsed or remaining modes, even that can be hidden but i need to edit the main script.

cankaratepe23 commented 4 years ago

Yes I have tried it, and it works as I expected: the "time left" counter ticks down 1 second and immediately jumps back, continuously.

What I'm curious about is why it counts down even when it knows the player is paused. For example, can the script not hold the last value for "time left" when the player is paused and show that while it's paused?

I don't have much experience with lua, mpv or discord-rpc so please excuse me if it's a limitation on one of those.