Phonegap + Construct 2

Discussion and feedback on Construct 2

Post » Mon Oct 31, 2011 11:48 am

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
B
17
S
3
G
3
Posts: 109
Reputation: 2,747

Post » Mon Oct 31, 2011 12:17 pm

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.
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,208

Post » Mon Oct 31, 2011 8:33 pm

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


Edit: 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 - see http://tinyurl.com/6gv7bwo !
(Assuming it really uses HTML5, since Flash doesn't seem to be present on the emulator: http://tinyurl.com/6hdey48)
Too bad only mp3 is supported...
Google, please do something about that! stiepan2011-11-01 16:14:17
B
10
G
2
Posts: 15
Reputation: 1,325

Post » Mon Oct 31, 2011 8:53 pm

I wanna try this... sounds really cool.
B
202
S
37
G
13
Posts: 136
Reputation: 29,488

Post » Tue Nov 01, 2011 12:06 am

[QUOTE=Ashley] 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.[/QUOTE]

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 ) 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 codec issue!

Update: 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! stiepan2011-11-01 16:15:26
B
10
G
2
Posts: 15
Reputation: 1,325

Post » Tue Nov 01, 2011 5:55 pm

[QUOTE=SocialLie] I wanna try this... sounds really cool.[/QUOTE]

Just found a simple workaround to enable local mp3 support without negative side-effects on existing functionality:
in the exported project's media subfolder, batch-convert all m4a to mp3 with the software of your choice, or for better quality, start with the uncompressed sound files (wav) if you have them.
Then open c2runtime.js with a text editor, search for "m4a" and replace it with "mp3".
That's it!
The project will still have sound enabled in all currently supported browsers, using mp3 instead of m4a for Safari and IE 9.
Unfortunately, it doesn't enable sound on mobile webkit - be it Apple's or Google's version - so there's no point to do this as of now, because it will only slightly increase the project's size due to mp3 compression being generally weaker than m4a and additionally it might put you at risk with the format's license restriction for games.

Ashley:
Probably the method used to create/initialize the audio object in c2runtime.js doesn't play well with those mobile webkit flavors (in fact I even think this was already discussed here or in another thread) - could you use a method that outputs the same html code as in the w3schools html5 sound example I posted, which does work correctly on all mainstream html5 browsers, including the one in Android 2.3?
This should solve the sound issue on iOS and Android, for the latter provided that it supports ogg or m4a (who knows, anyone can change, even Google!..) in an upcoming version; in the meantime, my mp3 workaround would give Android in-game sound to the reckless .stiepan2011-11-01 17:59:37
B
10
G
2
Posts: 15
Reputation: 1,325

Post » Tue Nov 01, 2011 5:58 pm

Yes, that would be really awesome if we can stream audio on our mobile phone. Please implement this feature in C2's next release.
B
17
S
3
G
3
Posts: 109
Reputation: 2,747

Post » Tue Nov 01, 2011 7:18 pm

Phonegap is free now? and will be expensive in some weeks? or construct will make a contract with the phonegap? =x
B
202
S
37
G
13
Posts: 136
Reputation: 29,488

Post » Tue Nov 01, 2011 8:44 pm

[QUOTE=SocialLie] Phonegap is free now? and will be expensive in some weeks? or construct will make a contract with the phonegap? =x[/QUOTE]

PhoneGap was purchased by Adobe for inclusion into their toolset but to the best of my knowledge, it is still open source and free. PhoneGap Build on the other hand is in beta and the costs are still up in the air and may be for some time while Adobe/Nitobi figure out what the next steps are with that product.
B
22
S
5
G
6
Posts: 57
Reputation: 4,487

Post » Wed Nov 02, 2011 3:19 pm

Update: sound - Ogg this time - works with a few glitches in FireFox for Android.

So for webapps, the problem is kinda already solved; kind of, because the glitches are really annoying, and with the current beta of FireFox for Android it isn't better.

Now for native Android, a wizard could use fennec source code to build an Android wrapper for c2 games, but I fear not to be that one...
Ashley?
B
10
G
2
Posts: 15
Reputation: 1,325

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: TheRealDannyyy, Yahoo [Bot], Zonacas and 12 guests