Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoundJs with preloadjs fails when sound already cached in browser #283

Closed
bknill opened this issue Nov 2, 2017 · 5 comments
Closed

SoundJs with preloadjs fails when sound already cached in browser #283

bknill opened this issue Nov 2, 2017 · 5 comments
Labels

Comments

@bknill
Copy link

bknill commented Nov 2, 2017

I'm registering the sound in Preload and playing the sound very soon afterwards.
If I clear the cache it plays fine,

If I reload the page I get this error

soundjs.min.js:18 Uncaught TypeError: Cannot read property 'length' of null
    at WebAudioPlugin.a._handlePreloadComplete (soundjs.min.js:18)
    at soundjs.min.js:17
    at a._dispatchEvent (soundjs.min.js:17)
    at a.dispatchEvent (soundjs.min.js:17)
    at a._sendComplete (soundjs.min.js:17)
    at a.b._handleAudioDecoded (soundjs.min.js:18)
    at AudioContext.<anonymous> (soundjs.min.js:17)

Any clues what might cause it?

@lannymcnie lannymcnie added the bug label Nov 3, 2017
@lannymcnie
Copy link
Member

There is an issue where the list of early-created sounds was being cleaned up improperly, which I have corrected. I also put in some error-handling which will prevent this particular error - however I am not entirely sure it will prevent whatever is causing the problem you posted.

I have pushed the fix to GitHub, and will build new NEXT libs shortly. I might sneak this change into the 1.0.x that is getting posted to the CDN.

If you are able to, I would appreciate a sanity test of the fix, and if it still persists, or there is other odd behaviour, a simple test case would be awesome.

Thanks!

@weituotian
Copy link

@lannymcnie not work!

@aitutor22
Copy link

I'm still having this issue with the next version. Is there something I need to be doing?

@jfraboni
Copy link

Same, still experiencing this issue.

@nguyenhuutinh
Copy link

try this
createjs.Sound.removeAllSounds();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants