Howler.js: seek() returning howler object unexpectedly

Created on 14 Jun 2019  路  14Comments  路  Source: goldfire/howler.js

If the seek() function is called while audio is loaded, except the play lock is true, it will return the howler object instead of the current time.

https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/src/howler.core.js#L1579

Most helpful comment

My workaround since long time ago is:

let time = Number(mySound.seek())
if (isNaN(time)) {
  time = mySound._sounds[0]._seek
}

All 14 comments

This happens to me also

How to deal with this problem

Me too

Need help with this also.

Same here. Plus, is it useful to add it to the _queue array if the seek call has no arguments? I have a problem where I read the time with seek() each frame to display the time, and the array keeps filling up if playLock is true. No reason to run a seek() later when playLock is false. Could even fix so any seek(time) that exists earlier in the queue for a specific sound is removed to avoid jumping all over the file later.

My workaround since long time ago is:

let time = Number(mySound.seek())
if (isNaN(time)) {
  time = mySound._sounds[0]._seek
}

Definitely still an issue, but @inear's workaround works great.

I also have this issue, took me a while to find out what was happening!

I had the same problem, especially .wav

This is an issue we are running up against as well. Next month this issue will be a year old!

@goldfire, what are your thoughts on this?

Same problem here. I have a feeling that it's somehow related to this issue too. @goldfire can you investigate.

Shouldn't the _playLock flag be considered only when seek is a number?

Still an issue...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bestander picture bestander  路  4Comments

Glutch picture Glutch  路  3Comments

jmeyers91 picture jmeyers91  路  4Comments

tvbird picture tvbird  路  4Comments

lili21 picture lili21  路  4Comments