html52.com
我爱小程序-开发者交流社区

ios微信小程序wx.createInnerAudioContext音频播放bug?

wx.createInnerAudioContext

环境信息:

微信版本:8.0.29

基础库:2.30.0

iPhone7,系统版本:12.2

在ios上执行innerAudioContext.play();播放音频就会报错:eval script evaluate_i #26 failed TypeError: Cannot read property 'setValidInit' of undefined

注:在安卓上相同的代码能正常播放

const app = getApp()

Page({

  data: {

    innerAudioContext: null

  },

  onLoad() {

    this.innerAudioContext = wx.createInnerAudioContext({

      useWebAudioImplement: false

    });

    this.innerAudioContext.src = 'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3';

  },

  playAudio() {

    console.log('播放');

    this.innerAudioContext.play();

  },

  pauseAudio(){

    console.log('暂停');

    this.innerAudioContext.pause();

  }

})

播放或暂停就会报错:

https://developers.weixin.qq.com/s/HGc4yVmC7zFJhttps://developers.weixin.qq.com/s/HGc4yVmC7zFJ

网友回复

社区技术运营专员-阳光:

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付