playAudio 播放录音

playAudio ^6.8

播放录音

#请求参数

Prop Type Value Comment
url String - 播放录音的地址
loop Boolean - 是否循环播放

#接口调用示例

let params = {
  url: 'Sounds/20200827x.wav',
  loop: false
}

this.$bridge
  .playAudio(params)
  .then(res => {
    this.$alert(res)
  })
  .catch(err => {
    this.$toast(err)
  })
// bridge v0.2.3起支持回调函数,回调函数可触发多次
this.$bridge
  .playAudio(
    params,
    res => {
      this.$alert(res)
    },
    err => {
      this.$toast(err)
    }
  )

#返回参数

  • 成功时返回
Prop Type Comment
code Number 1 播放完成
msg String -

#返回示例

{
    "code": 0,
    "msg": "success"
}
posted on 2024-12-17 09:27  AtlasLapetos  阅读(9)  评论(0)    收藏  举报