ty.p2p.onDownloadTotalProgressUpdate
下载总进度回调
需引入
P2PKit
,且在>=2.0.3
版本才可使用
参数
function callback
下载总进度回调的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string |
是 | 设备id | |
progress | number |
是 | 上传/下载进度 |
函数定义示例
/**
* 下载总进度回调
*/
export function onDownloadTotalProgressUpdate(
listener: (params: {
/** 设备id */
deviceId: string
/** 上传/下载进度 */
progress: number
}) => void
): void
ty.p2p.offDownloadTotalProgressUpdate
取消监听:下载总进度回调
需引入
P2PKit
,且在>=2.0.3
版本才可使用
参数
function callback
取消监听:下载总进度回调的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string |
是 | 设备id | |
progress | number |
是 | 上传/下载进度 |
函数定义示例
/**
* 取消监听:下载总进度回调
*/
export function offDownloadTotalProgressUpdate(
li