createInnerAudioContext
版本要求:
BaseKit≥2.3.2@ray-js/ray≥0.3.23
支持平台:
iOSAndroid
方法签名
createInnerAudioContext(params: )SDK 最低版本
- iOS
ThingSmartBaseKitBizBundle - ≥ 5.2.1
- Android
com.thingclips.smart:thingsmart-bizbundle-basekit - ≥ 5.2.0
描述
创建内部audio上下文InnerAudioContext对象
参数
| 属性 | 类型 | 必填 | 说明 |
|---|---|---|---|
complete | () => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
success | () => void | 否 | 接口调用成功的回调函数 |
fail | (params: Object) => void | 否 | 接口调用失败的回调函数 |
fail 回调参数
| 属性 | 类型 | 说明 |
|---|---|---|
errorMsg | string | 错误信息 |
errorCode | string | number | 错误码 |
| 错误扩展 |
返回值
类型:InnerAudioContext
InnerAudioContext
| 属性 | 类型 | 说明 | BaseKit 最低版本 | SDK 最低版本 |
|---|---|---|---|---|
pause | function | 暂停 | - | — |
resume | function | 恢复 | - | — |
play | function | 播放 | - | — |
seek | function | 跳转到指定位置 | - | — |
stop | function | 停止。停止后的音频再播放会从头开始播放 | - | — |
destroy已废弃 | function | 销毁当前实例 ↳ destroyPlayer | - | — |
destroyPlayer | function | 销毁当前实例 | v3.17.4 |
|
onTimeUpdate | function | 监听音频播放进度更新事件(进度为系统返回,双端可能不一致) | v2.4.3 | — |
offTimeUpdate | function | 取消监听音频播放进度更新事件 | v3.19.0 |
|
onPlayerStatusUpdate | function | 监听音频播放状态事件 | v3.19.0 |
|
offPlayerStatusUpdate | function | 取消监听音频播放状态事件 | v3.19.0 |
|