Jump to content

phaser cordova media


guruyaya
 Share

Recommended Posts

Hi guys

I've created a game using Phaser, and built it with Phonegap for android. Now it works kinda well on most devices, but it looks like older devices make no sounds. I managed to get that Phaser is using Audio tags, that have quite a problematic support on older devices (such as Galaxy S3). I got that most suggest to just work with Cordova media plugin.

I think I have the needed talent to either edit Phaser, or find a way to create a plugin, that will utilize Cordova media plugin, whenever it's available. However, I really don't want to do any work that was already done. If any of you know of a similar plugin, that allows the usage of the cordova media plugin, within phaser  - it'll be very much appriciated.

Thanks in advance

Yair

Link to comment
Share on other sites

Are you using ogg file format? If not, try with ogg.

Try also to use crosswalk webview for maximum compatibility.

My game (in the signature) uses phaser, crosswalk, ogg files and the sound plays in Galaxy S3, you can test it yourself (Not great sounds, I'm afraid, just some whistle and cheering during the goals).

Link to comment
Share on other sites

Thanks for your reply.

I was trying a few things before I went this route. Changing to OGG didn't play any better than other formats. As for crosswalk, it did solve some issues, but created several others:

1. On some devices, it didn't pause the game, when I went out of it (to the home screen for example).

2. For some reason, it took a long time to load the sounds, but it started the game anyway. Now, I have some big MP3 files, for background music. So, the game started, but no effects were heard until a very long time passed, and then, I got all the effects at once.

Now I'm fairly sure that 1 and 2 are solvable, but dealing with them kinda sucks by itself. The next 2 issues, are by design, and made me just skip this solution:

3. Crosswalk create 2 apks - one for Intel, and one for Arm. This doubles the maintenance issues.

4. Crosswalk creates a bloated APK, that takes a lot of memory, and application space. This is a silly game, and I don't want it removed because of these issues. No one will allow this game to stay with these issues around.

Now, for what I see, the Cordova-media plugin is fairly predictable and takes much less space in the device and memory. And adding this option, seems to me, like something that the Phaser community can use. I just don't want to do it myself, if someone else already took care of it.

Link to comment
Share on other sites

Hi, loading sounds should be fast, but decoding may take long time. Especially if there is bug in version of Chromium you use - see this post:

 Cordova works well for me. Phaser uses WebAudio by default and audio tags only if WebAudio is not available.

 If I remember well G3 was problematic device regarding sounds... but not sure if someone found some solution.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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