문제

Possible Duplicate:
access files from assets/www directory

I'm writing android app using phonegap and want to play mp3 on click in the button, my mp3 is located in the www folder. Unfortunately I tried to use "android_asset/ww/sample.mp3" as a src for new Media(src, Succ, Err); and file is not played. Is that path correct ? I'm using Cordova 2.0.0 and Eclipse.

도움이 되었습니까?

해결책 2

I've sorted this out, looks like from cordova version 2.0.0 there is some bug that doesn't allow to play local files (remote works fine). I took a step back and used cordova-1.9.0 and it works fine with path "/android_asset/www/sample.mp3"

다른 팁

use :

window.resolveLocalFileSystemURI("file:///android_asset/www/foo.html", onResolveSuccess, onFail);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top