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&#39;d go about creating a custom &quot;progress bar&quot;.&nbsp; (Like you see as part of &quot;scrub bars&quot;.)<br>
<br>To do this I&#39;d imagine that a playing video would have to &quot;send out&quot; events &quot;fast enough&quot; so that the progress bar could be updated &quot;enough&quot;.<br><br>Perhaps I didn&#39;t read the spec carefully enough, but I don&#39;t see any such event.<br>
<br>I&#39;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(&quot;aVideoElement&quot;);</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">videoElem.addEventListener( &quot;moment&quot;,<br>function()<br>{<br>&nbsp;&nbsp;&nbsp; // Handle the event.<br>&nbsp;&nbsp;&nbsp; // I.e., update the progress bar or something.<br>
&nbsp;&nbsp;&nbsp; //<br>&nbsp;&nbsp;&nbsp; // I&#39;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 &quot;moment&quot; event.&nbsp; (I doesn&#39;t have to be called &quot;moment&quot;.&nbsp; 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 &quot;currentTime&quot; 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>&nbsp;&nbsp;&nbsp; videoElem = document.getElementById(id);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp; &nbsp; // Update the progress bar using: videoElem.currentTime</span><br>}<br><span style="font-family: courier new,monospace;"><br>setTimeout(&quot;</span><span style="font-family: courier new,monospace;">updateProgressBar(\&quot;</span><span style="font-family: courier new,monospace;">aVideoElement</span><span style="font-family: courier new,monospace;">\&quot;)</span><span style="font-family: courier new,monospace;">&quot;, 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.&nbsp; But it doesn&#39;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>