charlie_says Posted February 20, 2018 Share Posted February 20, 2018 Hi, I'm working on a game that may need to be playable on IE11 (ugh!) Having got my basic game now working, I've found that the sound is failing, with the error: Object doesn't support property or method 'addEventListener' It seems that pixi sound should work, but, it's not clear to me why this isn't happening for me... Any ideas? Quote Link to comment Share on other sites More sharing options...
Garlov Posted February 20, 2018 Share Posted February 20, 2018 I'm guessing that you're using the pixi-sound extension? In that case, is this the same problem that you are having: https://github.com/pixijs/pixi-sound/issues/27 ? If it's not you'd have to make a small fiddle or something, so we can look at your code and test it. If you are not using any special effects or anything in your pixi.js project, might I suggest using howler.js instead. I use that in most of my projects without any problems. Quote Link to comment Share on other sites More sharing options...
charlie_says Posted February 20, 2018 Author Share Posted February 20, 2018 It could be that... I'm not doing anything very exciting, just loading & playing sounds. I don't really mind going over to howler, but the thing I liked about PIXI-sound was that it made use of the PIXI loader to manage that - how easy is that to do with howler? Quote Link to comment Share on other sites More sharing options...
Garlov Posted February 20, 2018 Share Posted February 20, 2018 I have a project here with a pixi loader I made, using howler.js. You can ignore most of the code, just look at the loadSounds in LoadingBar.js: https://github.com/GravitonDigital/PixiLoader/blob/dcbccaf442b7c96079081afb90f52e1b310057f7/src/scripts/LoadingBar.js#L119 Quote Link to comment Share on other sites More sharing options...
charlie_says Posted February 20, 2018 Author Share Posted February 20, 2018 Thanks @Garlov I'm not sure that's going to work for me that easily... I'm dynamically loading (& preloading) sounds throughout. I'm going to make a simple sound test, to see if I can find where the issue is arising. Quote Link to comment Share on other sites More sharing options...
charlie_says Posted February 20, 2018 Author Share Posted February 20, 2018 Ok, further investigation shows that PIXI sound works fine in IE11 (I'm sure the authors knew this already.) The issue is completely with the loader... this (from the PIXI sound demo) works as expected PIXI.loader.add('startGame', 'start_game.{mp3, ogg}'); but, because I have quite a lot of resources to be loaded, I use an array, like so: let audioFiles = []; // sounds for (i = 1; i < 11; i++) { audioFiles.push({ name: 'sfx' + i, url: 'sfx' + i + '.{mp3, ogg}'}); } which doesn't appear to work. Any ideas? Quote Link to comment Share on other sites More sharing options...
charlie_says Posted February 21, 2018 Author Share Posted February 21, 2018 I didn't come up with a better solution than checking for IE11 so if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) { // just load mp3s } else { // load sound files as normal } Quote Link to comment Share on other sites More sharing options...
Garlov Posted February 21, 2018 Share Posted February 21, 2018 Looks like the same problem that I had with loading textures on iPhones. That is the reason I created my custom PIXI.Loader project. The built in loader tries to load everything at once, which works fine in most cases, but on iPhone something seems to get lost in the mix, and the loading is never finished. That is why I'm not doing any parallel loading in my PIXI.Loader project, but only start to load the next asset when the previous one is done. This seems to fix it for iPhones. I'm not actually sure if it's the same problem with IE11, but it looks like it if you're only having that problem when loading multiple sounds at once. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.