webOS Nation Forums >  webOS Developers >  webOS Development > Phonegap audio issues.
Phonegap audio issues.
  Reply
 
Thread Tools Display Modes
Old 02/24/2013, 10:00 PM   #1 (permalink)
Member
 
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, 11:26 PM   #2 (permalink)
Member
 
Grabber5.0's Avatar
 
Posts: 4,066
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
*How to install .patch files on your device*
Developer of: SMS Auto Forward/Reply, GPS Viewer,
Keyring converters for CSV, eWallet, & CodeWallet
Touchpad patches:Keyring HD,ClassicNote HD, YouTube HD (for 2.1 app), Show email recipient addresses for contacts
Phone patches: Forums fixes and enhancements patch, Weather Channel fix
All-device patches: Update GlobalSign certs, Google Sync https fix, Yahoo contact sync fix


Last edited by Grabber5.0; 02/24/2013 at 11:31 PM.
Grabber5.0 is offline   Reply With Quote
Old 02/26/2013, 07:44 PM   #3 (permalink)
Member
 
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
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0