webOS Nation Forums >  webOS Developers >  webOS Development > Phonegap audio issues.
Phonegap audio issues.
Thread Tools Display Modes
Old 02/24/2013, 09:00 PM   #1 (permalink)
happyferretE's Avatar
Posts: 7
I'm curious,

has anyone managed to play audio inside a Phonegap wrapped app?
I've a function inside my code that queries the browser for .OGG support and, assuming it finds this to be beyond the browser's capabilities, reverts to a compatible format (.WAV for WebOS. iOS releases of my software would revert to M4A).

While this seems to work fine on Android (playing the OGG audio) and inside Internet Explorer (reverting to an MP3 version), it simply won't work inside WebOS.

Is there something I'm missing here? According to HTML5Test.com, neither OGG nor AAC are an option for WebOS 2.x' browser, so shouldn't it play the .WAV then? Or this some internal conflict between the browser object and Phonegap's alternative audio API?

I'm using the most recent Phonegap Build release (2.3).
happyferretE is offline   Reply With Quote
Old 02/24/2013, 10:26 PM   #2 (permalink)
Grabber5.0's Avatar
Posts: 5,207
So far I've had no luck with html5 audio objects in any webOS browser over 2.0. It works fine in 1.4.5, but on 2.1, 2.2.4, and 3.0.5 it doesn't render the player correctly and does not play (I only enabled the controls to debug the no-audio problem). It played wav and mp3 fine - I can't remember if I tried the ogg file or not. I don't know if Enyo+Phonegap is more like a browser environment than a normal app, but your situation makes me wonder. I don't know if it could be incorporated or not, but the newest version of the SoundManager 2 js framework has great auto detection and uses either Flash or HTML5 objects to play audio and video and works on all versions of webOS I've tested with it.
Matt Williams
Grabber Software
*How to install .patch files on your device*

Last edited by Grabber5.0; 02/24/2013 at 10:31 PM.
Grabber5.0 is online now   Reply With Quote
Old 02/26/2013, 06:44 PM   #3 (permalink)
happyferretE's Avatar
Posts: 7
Ok. I just tried to implement the audio via a simple HTML5 audio tag. This did the trick, somehow.

So it seems the 3rd party framework/game engine I'm using is providing audio in a way that is not compatible with WebOS. I can probably fix this by replacing this particular piece of code with Enyo specific code (never used Enyo before, so I hope this solution won't end up being overly bloated compared to using the game engine's methods on all other platforms).

A problem that still persists is the lack of video. Using the standard HTML5 video tag and an OGG file re-encoded to MP4, I end up only seeing the WebOS half-moon card icon alongside the audio of the MP4 movie. In fact, controls don't seem to work in any case, since playing WAV audio through the audio tag will not yield me any controls either.

I do hope I won't have to tightly integrate with Enyo or Mojo. I really don't see the point of an outlandish framework for something as simple as audio/video and a few buttons. Most of which can either be done in pure JS/HTML or with the help of jquery mobile.
happyferretE is offline   Reply With Quote


Thread Tools
Display Modes


Content Relevant URLs by vBSEO 3.6.0