Fast Forward Button with .seekcur

Need help with MPD?
Post Reply
Mordred
Posts: 1
Joined: January 9th, 2019, 9:00 pm

Fast Forward Button with .seekcur

Post by Mordred » January 9th, 2019, 9:20 pm

Hello,

for a few Days i am trying to build a Fast Forward Button with the .seekcur command.
Neither Google or this Board seems to know my Problem till now ;)

So here it is:
if (datetime.now() - buttonPressedTime).total_seconds()>=2:
client = connectMPD()
client.seekcur(-5)
client.close()
time.sleep(1.5)
is working fine (Fast Backwards) but if i change client.seekcur(-5) against client.seekcur(+5) it jumps to Second 5 of the playing Track not as expected relative 5 seconds futher.

Am I'm doing something wrong?

Thanks for your Help

max
Forum team
Posts: 853
Joined: January 15th, 2013, 3:43 pm

Re: Fast Forward Button with .seekcur

Post by max » January 10th, 2019, 7:12 am

It's probably that the client library you use (you didn't say which one) interprets positive integers as absolute position inside the song. Read the library's documentation on how to specify positive relative offsets.

Post Reply