Skip to content

监听播放进度 ​

方法名 ​

onPlayListener

用法 ​

用法示例 ​

js
module.onPlayListener(res => {
  console.log(res)
});

参数说明 ​

无

回调 ​

回调示例 ​

json
{
    "data": {
        "percent": 0.013805481982651363,
        "position": 4738,
        "duration": 343197
    },
    "message": "",
    "code": 0
}

回调说明 ​

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
data.percentFloat当前播放的进度,<1
data.positionInteger当前播放位置,单位:毫秒
data.durationInteger音频总时长,单位:毫秒
codeInteger返回类型,0.成功,其他:失败