iOS Phonegap Media Object - How do I access a resource in the WWW folder?

后端 未结 6 1844
孤独总比滥情好
孤独总比滥情好 2020-12-29 00:00

I\'m developing an application with phonegap, and I have a sound file I want to play that\'s in a path like so www/Sounds/sound.mp3, and I\'m trying to access this file usin

6条回答
  •  忘掉有多难
    2020-12-29 00:22

    As of Cordova 3.3+, the 2 other answers aren't correct. It should work even if you just pass it a file name.

    But, it will only work in iOS if the file extension is .wav.

    This will work:

    var media = new Media('recording.wav', ...);
    

    This won't:

    var media = new Media('recording.mp3', ...);
    

提交回复
热议问题