howler.js: seek() returning howler object unexpectedly

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 15
  • Comments: 15

Most upvoted comments

My workaround since long time ago is:

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

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

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.