Elapsed Time Slider

I am looking at putting in some elapsed time / total time sliders for various devices - this includes Kodi, but also some other media players. I conceptually understand how to do this, but I am trying to figure out a way to implement it in such a way that does not require polling every second. I do understand I can poll every 5 seconds, but I do not prefer seeing the time jump every 5 seconds, and that causes other issues if I need quicker polling for other commands. So I prefer to keep the polling interval down at 1 second.

In conventional Javascript, I would use a setInterval and update a variable every second, then every 10 seconds or so, send a command to the device to sync up the current playback time. However, I am not seeing a good way to do this with a plugin. Any ideas?

This was something I figured would come up at some point. Right now there really isn’t a good way for User Plugins to create an Elapsed Time Slider. There is the MediaPlaybackTime Capability that the Sonos, HEOS, Onkyo, & UPnP integrations use. However, it’s not currently possible to start or stop that capability’s timer in a Plugin.

Ok no worries - thank you! I will live without it for the time being. I don’t see much value in having it poll every second simply to accomplish this goal.

I am using MediaPlaybackTime on my HEOS device, so that’s working well.