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

后端 未结 6 1793
孤独总比滥情好
孤独总比滥情好 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:21

    Better try this to take into account any HTML5 History API code that might add in history entries with directories ("/"):

    function get_phonegap_path () {
     var path = window.location.pathname
     return path.slice(0, path.indexOf("/www/") + 5)
    }
    

提交回复
热议问题