亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - 微信小程序 音頻不能播放(本地和線上)
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-04-11 12:20:12
0
0
490

想要實(shí)現(xiàn)循環(huán)播放一組短音頻。在 wept 運(yùn)行環(huán)境中是ok的,但在小程序的官方開發(fā)工具,以及在微信中調(diào)試,都有報(bào)錯(cuò);另外嘗試了先調(diào)用 downloadFile ,然后在調(diào)用 playVoice的方式,依然是在 wept環(huán)境中ok,但其他地方報(bào)錯(cuò),無法播放。怎解決?

let index = 0,
    audioUrls: [
    'https://s.baidu.com/miniapps/018k8b.wav',
    'https://s.baidu.com/miniapps/028k8b.wav',
    'https://s.baidu.com/miniapps/038k8b.wav',
];

playTimer = setInterval(function(){
    if(isSuccessCur){
        isSuccessCur = false;
        wx.playVoice({
            filePath: audioUrls[index],
            complete:function(){
                isSuccessCur = true;
                ++ index;
                if(index === audioUrls.length){
                    clearInterval(playTimer);
                    that.setData({
                        isPalyingAudio: false
                    }) 
                }
            },
            fail:function(e){
                console.log(e);
            },
           
                
        })

 }

 },50);
PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證0級講師

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template