Jeff
Jeff

Reputation: 35

How can I tell if my soundjs soundInstance is paused vs completed?

I'm using soundjs to build a simple sound mixer with standard pause/play/scrub functionality for each track.

I have everything working well, from creating a manifest, to creating soundInstances per "track" when they are added to a play list.

But I cannot find in the documentation or available information on soundjs how to dynamically establish whether the play state of a specific soundInstance is playing or paused.

Though I can track the "playState" property, this does not appear to tell me what I need to know. It only says whether a soundInstance is "playFinished" or "playSucceeded".

Checking this property on a soundInstance which has been already paused through soundInstance.pause() yields a "playSucceed". Checking it again after the soundInstance has been resumed through a soundInstance.resume() also yields a "playSucceeded" value.

While I can track play state separately, it would seem like a much cleaner approach to just be able to check the soundInstance itself to determine things like: "completed" (stopped), "paused", "playing", etc.

Is there no better way to do this through the soundInstance?

Thanks

Jeff

Upvotes: 0

Views: 344

Answers (1)

OJay
OJay

Reputation: 1239

this has been added to SoundJS NEXT available on github as SoundInstance.paused

Hope that helps.

Upvotes: 0

Related Questions