Skip to content

Instantly share code, notes, and snippets.

@caiw
Created July 11, 2017 18:05
Show Gist options
  • Select an option

  • Save caiw/c27183117e3bc2b721c9fba22e14b7d7 to your computer and use it in GitHub Desktop.

Select an option

Save caiw/c27183117e3bc2b721c9fba22e14b7d7 to your computer and use it in GitHub Desktop.
// http://cai.zone/2013/07/a-quick-javascript-hack-to-fake-adjustin-html5-audio-elements-timeupdate-event-frequency/
var audio_clock;
$(audiohtml).bind("timeupdate", onAudioUpdate);
$(audiohtml).bind("play", function(){
audio_clock = setInterval(function(){
onAudioUpdate();
}, 100);
});
$(audiohtml).bind("pause", function(){
clearInterval(audio_clock);
});
function onAudioUpdate() {
// Move the elements here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment