- swan.setInnerAudioOption
- 方法参数
- object 参数说明
- 示例
- 图片示例
- 代码示例
- 错误码
- Android
- iOS
- 方法参数
swan.setInnerAudioOption
基础库 3.10.4 版本开始支持。
解释: 对innerAudioContext
进行小程序内部的全局设置。
Web 态说明: 受浏览器限制,Web 态不支持该功能,调用该方法会执行失败回调函数。
方法参数
Object object
object 参数说明
属性名 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
mixWithOther |
Boolean |
否 |
false |
设置是否与其他音频混播。 11.3 |
success |
Function |
否 |
接口调用成功的回调函数 |
|
fail |
Function |
否 |
接口调用失败的回调函数 |
|
complete |
Function |
否 |
接口调用结束的回调函数(调用成功、失败都会执行) |
示例
跳转编辑工具
在开发者工具中打开
在 WEB IDE 中打开
扫码体验
代码示例
请使用百度APP扫码
图片示例
代码示例
- SWAN
- JS
<view class="wrap">
<button type="primary" bindtap="play">play</button>
<button type="primary" bindtap="stop">stop</button>
<button type="primary" bindtap="setInnerAudioOption">setInnerAudioOption</button>
</view>
错误码
Android
错误码 | 说明 |
---|---|
1001 |
执行失败 |
iOS
错误码 | 说明 |
---|---|
202 |
解析失败,请检查参数是否正确 |