I like Phonegap a lot! Just wondering, how can I insert an audioplayer with Phonegap in my iPhone app? Or any audio at all?
HowTo
- Place your beep.wav in the Resources folder
- Execute new Media('beep.wav').play();
- See notification source in demo code
Supported Devices
- iphone
- Formats: .wav, .aiff
- Note that while .mp3 works in the Simulator, it does not work on the actual device (On the EDGE version >= 0.8.2, .mp3 works on the device).
?
In the edge version of phonegap, the sound file must be included in the www folder. For the above example, beep.wav would need to be in the www folder. Older versions of PhoneGap may have required the file to be in the Resources group of your xcode project.
You may also reference audio files in a subfolder. Executing new Media('audio/mysound.wav').play(); will play a wave file in www/audio/mysound.wav.
References
Feature Requests / Plans
Comments (1)
Joshua said
at 5:54 pm on Mar 5, 2009
I know that you can play short audio sounds, but I'm stumped about adding longer audio in here without it going through QuickTime. Is this possible?
You don't have permission to comment on this page.