Skip to content

DownloadTask.onProgressUpdate

js
    DownloadTask.onProgressUpdate(function callback)

监听下载进度变化的事件

参数

  • function callback: 下载进度变化事件的回调函数

callback 回调函数的参数

  • Object res: 返回下载进度变化的信息

res 的属性说明:

属性类型说明
progressnumber下载进度百分比
totalBytesWrittennumber已经下载的数据长度,单位 Bytes
totalBytesExpectedToWritenumber预期需要下载的数据总长度,单位 Bytes