lrodriguez Posted June 21, 2014 Share Posted June 21, 2014 I'm starting to learn Phaser, for that I'm building a small Android game, I have found 1 problem which maybe can help me. Audio problem: I have read the forum and I saw that some people have had similar problems, it is suggested that the time to package the game for android using CocoonJS, and other audio solves my problem but it breaks my game. on the other hand when I use build.phonegap.com the game is fine, but the audio is broken. I have my project on github if they want to try: https://github.com/luisrodriguezmartinez/Phaser-primer-Juego-.git The Android application with phonegap enpaquetado are here: https://build.phonegap.com/apps/973892/share Unfortunately coconjs not permitted to share the apk, but can download the project here and pack it with phonegap so they can see what I've detailed https://github.com/luisrodriguezmartinez/Phaser-primer-Juego-.git Thank you very much for your help. Link to comment Share on other sites More sharing options...
lrodriguez Posted June 22, 2014 Author Share Posted June 22, 2014 help.? Link to comment Share on other sites More sharing options...
Videlais Posted June 22, 2014 Share Posted June 22, 2014 Audio problem: I have read the forum and I saw that some people have had similar problems, it is suggested that the time to package the game for android using CocoonJS, and other audio solves my problem but it breaks my game. ... Unfortunately coconjs not permitted to share the apk, but can download the project here and pack it with phonegap so they can see what I've detailed https://github.com/luisrodriguezmartinez/Phaser-primer-Juego-.git I'm not sure what you mean when you write that CocoonJS doesn't allow you to share the APK. You probably could have uploaded it to GitHub and posted it along with the other files, right? But, then again, maybe you meant they don't produce a sharable URL? Not sure. Anyway, I tested what you posted to see if I would see the same result. For me, the game ran good (although with some problems) in Canvas+ and well in WebView. However, I didn't hear any sound with either. And I didn't investigate too much to see what the problem might be. (The sound issue might be related to another only recently fixed problem in Phaser with CocoonJS.) What I did find, though, and is probably part of the problem with your code with Canvas+ in CocoonJS, is that you are using things like getElementById (in reference here) that won't work well in Canvas+. So, in reference to CocoonJS breaking your game, what did you mean? I'm one of the people who tracks issues between Phaser and CocoonJS, so I'm curious if this might be something undocumented. Link to comment Share on other sites More sharing options...
lrodriguez Posted June 22, 2014 Author Share Posted June 22, 2014 thank you very much for your answer, I just want to detail the following with phonegap the game works fine, only the audio can be heard with the game coconjs malfunctions and audio if you listen. I've searched for "getElementById" in my code and I have not found to try removing it, you could always tell me. I emphasize that the problem is in a galaxy s3 android mini in windows all well, and I'm using both mp3 and ogg: game.load.audio ('blud', ['assets/sound/blud.mp3', 'assets / sound / blud.ogg']); game.load.audio ('plam', ['assets/sound/64119_atari66_beeps.mp3', 'assets/sound/64119__atari66__beeps.ogg']); Link to comment Share on other sites More sharing options...
Videlais Posted June 24, 2014 Share Posted June 24, 2014 Sorry for the long delay. I wasn't able to get back to the forum until today. The getElementById is part of the Phaser.Game call. It is the fourth parameter in your call here. When you are using Canvas+ mode, it limits how getElementById works. It can't find the element by its ID of 'Primer Juego'. That's all I meant by that. It throws a warning when using Canvas+ mode. There was a new post today in the "Common Phaser + CocoonJS Issues" thread that was a solution to the sound issue that might help you here. There seems to be a race condition between enabling touch support and the loading of sounds. It should be fixed in the next version of Phaser, but many people, like you, are having problems at the moment. Link to comment Share on other sites More sharing options...
Recommended Posts