onetune / spotify-web-helper

🎛 Control Spotify from node.js
62 stars 11 forks source link

Seek event #28

Closed itotallyrock closed 7 years ago

itotallyrock commented 7 years ago

Attempt to solve #17. Works the same way as the original issue suggested, on a compare status call, it compares the previous position to where it should be at the time of the compare. If there is a difference of five or more seconds then a seek event will be emitted with the new position.

itotallyrock commented 7 years ago

In hindsight, I feel the 5 seconds is a bit high. After just using Spotify and having test running the delta was always zero within several decimal places (this biggest non seek was 0.00005) unless there is an actual seek. So perhaps having it set to 500ms or double the seekInterval to guarantee that it is accounted for.

So I'll most likely add a commit changing that down to .5 instead of 5.