问题
I'm trying to use jPlayer for a web app that will be native compiled for iPhone, Android and Blackberry using the PhoneGap Build service. I'm using the player to play short MP3 audio snippets and it works fine in the web browser.
However, when this is compiled using PhoneGap, the audio won't play and it doesn't display the length of the file in the player. It looks like it can't find the file, although I'm referencing it using a relative path (../audio/myaudio.mp3
).
Does anybody have any experience of getting jPlayer to work on a native app compiled through PhoneGap?
回答1:
This is not likely related to PhoneGap Build at all. It is probably having issues b/c html5 audio support is terrible across many mobile platforms. Html5 audio does not work on Android 2.x or older blackberry devices. Even where html5 audio is supported, it does not always behave as you might expect (can't seek, can't play more than one clip at a time, etc...). You might want to look at phonegap's Media class for consistent audio playback across platforms, even where html5 audio is not supported: http://docs.phonegap.com/en/2.0.0/cordova_media_media.md.html#Media
来源:https://stackoverflow.com/questions/6938154/jplayer-and-phonegap-build-compatibility