Tuesday, 15 May 2012

javascript - How to detect an audio has reaches 30 seconds into playing? -



javascript - How to detect an audio has reaches 30 seconds into playing? -

i have sound tag streams music web url. 1 time song gets on 30 seconds want run piece of code. whats best way accomplish this?

add handler timeupdate event raised audio control. within handler, @ control's currenttime property.

var audiocontrol = document.getelementbyid('myaudio'); audiocontrol.ontimeupdate = function () { if (audiocontrol.currenttime >= 30) { // } }

javascript html5 windows-8 java-metro-framework

No comments:

Post a Comment