var*_*yar 8 ios phonegap-plugins cordova
我在我的phonegap应用程序中使用phonegap音频插件.我有一些音频文件存储在www/audio文件夹中.
对于android我使用"file:/// android_asset/www/audio"来读取本地文件.
对于IOS,我需要帮助.
谢谢
终于搞定了,参考:链接
为了获得路径,我使用了这个功能
function getPhoneGapPath() {
var path = window.location.pathname;
path = path.substr( path, path.length - 10 );
return path;
};
Run Code Online (Sandbox Code Playgroud)
对于IOS:
var snd = new Media(getPhoneGapPath() +'test.mp3');
对于Android:prepend'file://'
var snd = new Media('file://'+ getPhoneGapPath() +'test.mp3');
| 归档时间: |
|
| 查看次数: |
6649 次 |
| 最近记录: |