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?