Howler.js: support timeupdate event ?

Created on 19 Jun 2018  路  4Comments  路  Source: goldfire/howler.js

timeupdate event

The timeupdate event is fired when the time indicated by the currentTime attribute has been updated.

Most helpful comment

this should be part of the functionality.

All 4 comments

+1 This would be useful.

The audio demo player uses something like this:

```
audio = new Howl({
src: url,
onplay: function () {
requestAnimationFrame(step.bind(this);
}.bind(this)
};

function step() {
var self = this;
// Get the Howl we want to manipulate.
var sound = self.playlist[self.index].howl;

// Determine our current seek position.
var seek = sound.seek() || 0;
timer.innerHTML = self.formatTime(Math.round(seek));
progress.style.width = (((seek / sound.duration()) * 100) || 0) + '%';

// If the sound is still playing, continue stepping.
if (sound.playing()) {
  requestAnimationFrame(self.step.bind(self));
}

},
```

The issue with this is that it uses requestAnimationFrame which is only fired when the tab is active. For your audio player demo this wont be an issue because you use this to show real time progress bar, but for my case i need to manipulate the audio. Thus right now if user switches tabs in my software the audio goes out of sync with the rest of items on my website causing issues. Please add support for this, thank you.

this should be part of the functionality.

It would be pretty useful feature. Please add

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FFankias picture FFankias  路  3Comments

kamkha picture kamkha  路  3Comments

distante picture distante  路  5Comments

joshbruce picture joshbruce  路  4Comments

SandMoshi picture SandMoshi  路  3Comments