DEV Community

Discussion on: My random thoughts on Svelte

Collapse
 
joelellis profile image
Joel Ellis

Updating time for video and audio happens in requestAnimationFrame. Why don't in requestIdleCallback?

  1. requestIdleCallback is an experimental API and is not supported in Safari.
  2. requestAnimationFrame is the correct function to use anyway - the data of playback position is typically a part of the UI, and it's both important that it's up to date and unnecessary to update many times per frame.
Collapse
 
gf_developer profile image
GF

Good points, thanks for explanation!