DownloadTask.onProgressUpdate

DownloadTask.onProgressUpdate(function callback)

监听下载进度变化事件

输入

callback function

监听事件的回调函数

输出

callback 回调函数接收的对象扩展属性:

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