Phonegap + Construct 2

0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • So I've been experimenting publish apps to Android via Phonegap:

    scirra.com/forum/experiment-running-a-game-on-an-android_topic43897.html

    But I have found one issue, if I publish a game via Phonegap I get no sound coming from the game on my android app.

    ANyone else have the same issue or a fix?

  • I'm not sure Android's browser supports audio, so I'm guessing they need to add support first.

  • I think that is something you could ask on the Phonegap forum, there is also the fact that sound support for HTML5 is a bit of inconsistent among browsers at this time (Ogg Vorbis is supported by almost all of em, except, you guessed it, IE9).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Android browser does support sound from Android 2.3.x, but only mp3...

    Please add optional mp3 support in the next update - I am 100% willing to take the risk of being asked royalties for using that format, which should already be in the public domain given its popularity and age!

  • (This is an old post - since this thread was made we've added support for PhoneGap)

    The MP3 licensing site states that you're liable for a $2500 license if you distribute your game 5000 times (presumably meaning downloads). So I would prefer to avoid the MP3 format entirely! AAC is better quality, smaller filesize and free to use in games. So everyone should use that! (Actually, everyone should use Ogg Vorbis, but either is better than MP3.)

    Edit: I went through my emails and actually got in touch with the MP3 licensing people a few months back. They seemed to say (through politi-speak) that even free games are liable for this license, based on the argument that "any use of mp3 is designed to take advantage of its ubiquity, create fans... build a reputation, etc... so there are very very few instances where our license is not required".

    I couldn't believe it. That's why we don't support MP3 at all and only use AAC and OGG - it's you lot who are liable for this $2500 license, not us, and we don't want to put anyone at risk, especially when AAC is better in every way.

  • couldn't believe it. That's why we don't support MP3 at all and only use AAC and OGG - it's you lot who are liable for this $2500 license, not us, and we don't want to put anyone at risk, especially when AAC is better in every way.

    Are you sure? GameMaker uses MP3's but there is no mention of the user being liable. I've probably read it wrong, if so sorry about that. <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Yes we are sure unfortunately :( GameMaker either don't know about this licensing issue, OR they have determined it's not their responsibility and it's the users responsibility to find this out for themselves.

    We would hate for a user of our software to be sued, so we've chosen not to include it.

  • <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Thank you for replying so quickly and sorry for reviving a relatively old thread, but the issue of sound not playing on Android and iOS (at least until version 5 - didn't have the time to try it yet) is still there as of now, so I thought that it was ok to reply here.

    Nevertheless, please feel free to move my post to a new thread if you deem it necessary.

    Regarding the royalties issue, I am conscious it concerns only me (or any other game publisher) - not you - and that is why I am asking for the freedom to take this risk!

    With that said, I have found a quick and (very) dirty workaround to play any sound format supported by the browser, but not available in C2 as an export format (*):

    On some condition, go to sound file url in new window -> alert "something" on the main window, so that the user doesn't leave the main window.

    Works with both file:// and http:// protocols in Chrome, provided you choose the corresponding preview mode and popup blocking is disabled in the browser.

    Didn't try it yet on Android's mobile version of chrome, but it should definitely work, although I would not recommend using such a trick in production, due to obvious aesthetic reasons...

    Support for Iframes would be a much more elegant way of achieving the same goal - could it be a "politically correct" solution to enable this (and way more)?

    Also, can we somehow use the existing ajax object to play remote sound files in any browser-supported format?

    (*not necessarily mp3, as wav is also in that case and might be useful for enabling small sfx files to play on iOS)

  • Workarounds using iframes do not avoid the license. If your game uses MP3 technologies to play audio, you're liable for a license, regardless of the actual method you use to play it.

    I had a quick look and the Android browser does not appear to support HTML5 audio at all yet, so MP3 won't help you there. However most of the phones Android is on support Ogg Vorbis, so I would expect Android 4 (due to be released soon) to support Vorbis.

    Safari on iOS should support AAC.

    PhoneGap also provides some mechanisms to play audio via the native engine, which might allow us to fix it. I'll look in to it. In short, it should be fixed soon, so there's still no need for MP3.

  • I tested my Sony Ericsson Xperia Play (Gingerbread 2.3.3) using html5test.com

    And The audio test result is:

    Audio Element      | YES

    PCM Audio Support | NO

    MP3 Support        | YES

    ACC Support        | NO

    Ogg Vorbis Support | NO

    WebM Support       | NO

    So does android really support mp3 or not?

    Btw, i'm using the default browser

  • Oh, maybe they updated to support MP3, or that particular model of phone adds support. However, we're kind of waiting for Android 4 to come out anyway - it has a hardware accelerated canvas, so Android versions before then are probably too slow to play HTML5 games well.

  • I didn't mean that as a workaround to avoid the license issue, but simply as an acceptable compromise for you to allow external media support without encouraging directly use of mp3, or another patent-encumbered format.

    Still, external media support would render possible the streaming of audio from a server located in a country with decent broadband where there is no licence issue with patent-encumbered formats in the US and/or EU (Russia?), but this is out of scope and not even directly related to C2, so I will not further elaborate on that matter here.

    Regarding Android browser support for HTML5 audio, I conducted further tests and came to the following conclusion:

    2.3.x on a real device (HTC Flyer) mimics in-browser support for mp3 only, giving the choice to the user between saving the file to sdcard or playing it in a compatible streaming app, while 4.0 has true support for embedded audio, sadly also only mp3 as of now.

    See the following emulator screenshots -

    http://tinyurl.com/6x4nx4q

    and

    http://tinyurl.com/6yn6kta .

    Didn't test with 3.x as is doesn't seem so relevant since it is reserved to tablets.

    As for Safari mobile, yes it is supposed to, but from what I have seen with both my iPhone 3G running the latest available iOS 4 for armv6 devices and a client's iPad2 supposedly running a newer iOS 4 version (didn't check), it doesn't support the aac outputted by C2 on Windows 7, much like iOS doesn't play any mp4 video, only those that are recognized as compatible by iTunes when syncing with the iDevice.

    Note that I still didn't test with iOS 5 (or at least not knowingly...) - now downloading the sdk on my mac - hopefully it will work!

    Anyways, thank you for taking this issue seriously, and let's cross fingers so that you can solve it in the next update <img src="smileys/smiley1.gif" border="0" align="middle">

    <font color="red">Edit</font>: tested embedded HTML5 sound with Android 3.2 in emulator after being demotivated by the fact that iOS 5 doesn't solve the sound issue we have, and it works <img src="smileys/smiley4.gif" border="0" align="middle"> - see http://tinyurl.com/6gv7bwo !

    (Assuming it really uses HTML5, since Flash doesn't seem to be present on the emulator: tinyurl.com/6hdey48)

    Too bad only mp3 is supported...

    Google, please do something about that!

  • I wanna try this... sounds really cool.

  • Oh, maybe they updated to support MP3, or that particular model of phone adds support. However, we're kind of waiting for Android 4 to come out anyway - it has a hardware accelerated canvas, so Android versions before then are probably too slow to play HTML5 games well.

    Didn't see the new replies when posting the above - please provide us with a workaround in the meantime, for instance by extending the ajax object to allow audio streaming of an arbitrary format, at the risk of the publisher (both technical and legal).

    Many people (like me <img src="smileys/smiley17.gif" border="0" align="middle">) still have 2009 1.5/1.6 phones and even more have 2.x, so 4.0 looks like too far in the future when talking about mainstream adoption.

    Additionaly, as another user mentioned in a thread talking about iPhone support, simple point-and-click HTML5 games made with C2 run fine on existing smartphone hardware (say Android 2.x with armv7), except for sound; it would be too bad to loose that market segment just because of a <img src="smileys/smiley35.gif" border="0" align="middle"> codec issue!

    <font color="red">Update</font>: Tried a pure html5 audio example from w3schools on my Flyer running 2.3.4 (which is what I should've tried in the first place instead of opening an audio file), and it worked!

    Link: http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_audio_all

    So until Google gives us real Chrome alongside with browser ogg support on our Androids, Ashley, please allow us the sin of using mp3 - temptation is too big to resist! <img src="smileys/smiley2.gif" border="0" align="middle">

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)