我是这样的 : getDuration(){ that.innerAudioContext.play(); that.innerAudioContext.onPlay(()=>{ that.innerAudioContext.onTimeUpdate(()=>{ that.duration = 0 let duration2 = that.innerAudioContext.duration || that.duration if (duration2 && duration2 != duration) { that.duration = duration2 console.log(that.duration) that.innerAudioContext.stop(); } }) }) }, 因为onTimeUpdate事件会实时促发只要判断that.innerAudioContext.duration是否有值就行,优化可以加 if (duration2 && duration2 != that.duration) {}防止性能消耗
如何获取到音频文件是时长,duration获得是0this.innerAudioContext.src = data.sound; let duration = this.innerAudioContext.duration; console.log(duration) 输出来的是0
2022-03-25我是 把 配置中的provider改成默认是appID:wx2b03c6e691cd7370就行了,如果改成自己的appID就会报 插件申请成功,待审核确认 "plugins" : { "live-player-plugin" : { "version" : "1.3.2", "provider" : "wx2b03c6e691cd7370" } },
插件申请成功,待审核确认?开发者工具报 “插件申请成功,待审核确认” 怎么才能审核通过啊
2022-03-09