Frage

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.

War es hilfreich?

Lösung 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"

Andere Tipps

use :

window.resolveLocalFileSystemURI("file:///android_asset/www/foo.html", onResolveSuccess, onFail);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top