小程序开放平台

文档中心
暂无目录

xhs.createInnerAudioContext

更新时间:2024-11-14 11:47:48

创建内部 audio 上下文 InnerAudioContext 对象。

返回值

InnerAudioContext

示例代码

const innerAudioContext = xhs.createInnerAudioContext()
innerAudioContext.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E061FF02C31F716658E5C81F5594D561F2E88B854E81CAAB7806D5E4F103E55D33C16F3FAC506D1AB172DE8600B37E43FAD&fromtag=46'

innerAudioContext.play() // 播放

innerAudioContext.pause() // 暂停

innerAudioContext.stop() // 停止
该文档是否对您有帮助?