DownloadTask.offProgressUpdate(listener: Function)

Requires:
BaseKit≥2.0.1
Platforms:
iOSAndroid

Description

Stop listening for download progress change events

Parameters

ParameterTypeRequiredDescription
YesEvent listener callback function

Return Value

None

Examples

import { downloadFile } from '@ray-js/ray'

// Remove the progress listener: first get the download task handle via ty.downloadFile, then register and remove the progress listener on the handle.
const downloadTask = await downloadFile({
  url: "https://airtake-public-data-1254153901.cos.ap-shanghai.myqcloud.com/ttttestfile/test_video.mp4",
});

const handler = e => {
  console.log(e);
};
downloadTask.onProgressUpdate(handler);
downloadTask.offProgressUpdate(handler);