[whatwg] What is the purpose of timeupdate?

Brian Campbell Brian.P.Campbell at dartmouth.edu
Fri Oct 30 23:18:44 PDT 2009


As a multimedia developer, I am wondering about the purpose of the  
timeupdate event on media elements. On first glance, it would appear  
that this event would be useful for synchronizing animations, bullets,  
captions, UI, and the like. The spec specifies a rate of 4 to 66 Hz  
for these events. The high end of this (30 or more Hz) is pretty  
reasonable for displaying things in sync with the video. The low end,  
however, 4 Hz, is far too slow for most types of synchronization;  
everything feels laggy at this frequency. From my testing on a two  
year old MacBook Pro, Firefox is giving me about 25 timeupdate events  
per second, while Safari and Chrome are giving me the bare minimum, of  
4 timeupdate events per second.

At 4 timeupdate events per second, it isn't all that useful. I can  
replace it with setInterval, at whatever rate I want, query the time,  
and get the synchronization I need, but that makes the timeupdate  
event seem to be redundant. At 25 timeupdate events per second, it is  
reasonably useful, and can be used to synchronize various things to  
the video.

So, I'm wondering if there's a purpose for the timeupdate event that  
I'm missing. If it is intended for any sort of synchronization with  
the video, I think it should be improved to give better guarantees on  
the interval between updates, or just dropped from the spec; it's not  
useful enough in its current form. To improve it, the maximum interval  
between updates could be reduced to about 40 ms, or perhaps the  
interval could be made settable so the author could control how often  
they want to get the event.

-- Brian



More information about the whatwg mailing list