DownloadTask.onProgressUpdate
DownloadTask.onProgressUpdate(function callback)
监听下载进度变化事件
输入
callback function
监听事件的回调函数
输出
callback 回调函数接收的对象扩展属性:
属性 | 类型 | 说明 |
---|---|---|
progress | number | 下载进度百分比 |
totalBytesWritten | number | 已经下载的数据长度,单位 Bytes |
totalBytesExpectedToWrite | number | 预期需要下载的数据总长度,单位 Bytes |