收藏
回答

小程序是否支持多个本地音频顺序播放

框架类型 API/组件名称 终端类型 操作系统 微信版本 基础库版本
小程序 wx.createInnerAudioContext() 微信iOS客户端 6.6.2 1.6.0

你想反馈一个 Bug 还是 提一个需求?


如果是 Bug:Bug


* Bug 表现是什么?预期表现是什么?


* 如何复现?

//播放声音

play: function () {

     wx.getSavedFileList({

      success: function (res) {

        var LEN = res.fileList.length

        if (LEN > 0) {

          console.log('number of files:'+LEN)

          for (var i = 0; i < LEN; i++) {

            InnerAudioContext.src = res.fileList[i].filePath;

            InnerAudioContext.play();

            console.log('File' + i + " :  " + InnerAudioContext.src)

          }

        }


        InnerAudioContext.onPlay(() => {

          console.log('onPlay()');

        });


        InnerAudioContext.onError((res) => {

          console.log(res.errMsg)

          console.log(res.errCode)

        });

      }

    })

}


* 提供一个最简复现 Demo

number of files:2

index.js? [sm]:94 File0 :  http://store/wx22fa435613e4a846.o6zAJsww-VE9mPPuvHzlEPwDQOm8.a1e62f616556cf7a33124d5db0cb211b.durationTime=10003.mp3

index.js? [sm]:94 File1 :  http://store/wx22fa435613e4a846.o6zAJsww-VE9mPPuvHzlEPwDQOm8.c209cfdbf56e82e60e2ffef07fc0b37b.durationTime=10002.mp3

index.js? [sm]:105 onPlay()


能读取到所有 音频文件名,但 只有最后一个音频文件播放出来




如果是需求:


* 你希望有什么能力?


* 你需要这个能力的场景是 ?


回答关注问题邀请回答
收藏

1 个回答

  • 那夜捉猹的润不土°
    那夜捉猹的润不土°
    2018-04-03

    我也遇到了相似的场景,亲如果解决了,请告诉我下,谢谢

    2018-04-03
    有用
    回复
登录 后发表内容