Jump to content

Phaser Audio Problem with Phonegap!


lenten1111
 Share

Recommended Posts

Hello,

 

I have a few games which run good on desktop and not bad on android with geckoview (app size too big because of geckoview). Now i'm trying to bring them to WP8 and maybe reduce android app size with phonegap. But problem about audio, there no audio working (the same with cocoonjs, i tried). I also tried use phonegap media api, its working but i can't figure out how to use phonegap api inside my phaser game state. Could somebody please give me an example how to use phonegap api inside my phaser game state? Thanks :)

Link to comment
Share on other sites

As with the thread @JP91 links to, you will need the Media plugin for Cordova/PhoneGap to play audio files.

 

Instructions for installing and using it can be found on its GitHub page. (In the last couple of days, I've also started to patch Phaser for greater Cordova/PhoneGap support too. Greater compatibility is coming.)

 

As for CocoonJS (and ultimately the Media plugin as well), you need to check file formats. Certain devices will only play certain types. In most cases, WAV is universally playable; OGG for Android and MP4 for iOS. (We keep track of the CocoonsJS-specific issues in this thread to help people out with that library.)

Link to comment
Share on other sites

My problem is how to embed phonegap audio code inside phaser play state which have animations, audio for each animation. It like how to get 2 different codes work together, an example like that.

 

I don't know of any tutorial or example for that, unfortunately.

 

I've started looking at ways it might be possible to write a patch to add in Cordova.Media support into Phaser's existing Loader and Audio objects, but haven't made too much progress yet. Because Cordova.Media doesn't conform to the W3C specification, I've been researching ways to either add some conditional loading or just write a plugin for Phaser that overwrites the audio object as Media.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...