Using setInterval() to make data reactive
Use events and callbacks to react to things as they happen instead of repeatedly checking for changes.
You can use the .then function to do whatever needs to be done once the data is received.
You can learn about the &lt;video&gt; element events here: https://www.w3schools.com/tags/ref_av_dom.asp