Hello,<br><br>(Sorry if this has come up before and I missed it.)<br><br>I was looking over the spec and looking to see how I'd go about creating a custom "progress bar". (Like you see as part of "scrub bars".)<br>
<br>To do this I'd imagine that a playing video would have to "send out" events "fast enough" so that the progress bar could be updated "enough".<br><br>Perhaps I didn't read the spec carefully enough, but I don't see any such event.<br>
<br>I'd expect to be able to do something like...<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">videoElem = document.getElementById("aVideoElement");</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">videoElem.addEventListener( "moment",<br>function()<br>{<br> // Handle the event.<br> // I.e., update the progress bar or something.<br>
//<br> // I'll need a way to know a what point in time the video is at now.<br>}<br>,false);</span><br clear="all"></div><br>Note I used the fictitious "moment" event. (I doesn't have to be called "moment". I just made up something.)<br>
<br><b>Is there anything like this already?</b><br><br><br>Or do you just set up a timer and poll the "currentTime" attribute.<br><br>I.e., something like...<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">function updateProgressBar(id)<br>
{<br> videoElem = document.getElementById(id);<br> <br> // Update the progress bar using: videoElem.currentTime</span><br>}<br><span style="font-family: courier new,monospace;"><br>setTimeout("</span><span style="font-family: courier new,monospace;">updateProgressBar(\"</span><span style="font-family: courier new,monospace;">aVideoElement</span><span style="font-family: courier new,monospace;">\")</span><span style="font-family: courier new,monospace;">", 100);<br>
<br></span></div><br>I suppose the advantage of the polling method is that you can specify how often you do the update. But it doesn't seems to make for poorer developer usability.<br><br><br>-- <br>Charles Iliya Krempeaux, B.Sc.<br>
<a href="http://ChangeLog.ca/">http://ChangeLog.ca/</a><br><br>