mp3 audio playback not working with Cordova 3.5 on iOS

前端 未结 3 1464
遇见更好的自我
遇见更好的自我 2021-02-14 10:14

Recently I upgraded our iOS Project from Cordova 3.3 to 3.5.

mp3 files (that were previously downloaded into the iOS standard documents folder) will not play using the

3条回答
  •  醉梦人生
    2021-02-14 11:18

    I haven't played around with media on iOS recently but if I look at the docs it states:

    var myMedia = new Media("audio/beer.mp3")
    myMedia.play()  
    // first looks for file in www/audio/beer.mp3 then in 
    /documents/tmp/audio/beer.mp3
    

    So, if I were you I'd try a relative path of:

    "../Downloads/testsound.mp3"
    

    which should change:

    /documents/tmp/../Downloads/testsound.mp3
    

    into just:

    /documents/Downloads/testsound.mp3
    

提交回复
热议问题