lynx: cancelResourcePrefetch() static method
- This API is used to cancel resource preloading initiated by requestResourcePrefetch.
Syntax
Parameters
data
A collection that describes the details of all resources to be canceled for preloading, with its keys defined as follows:
data: Typearray, each item inside the array corresponds to a resource. The keys for each item are defined as follows:uri: Typestring, represents the CDN address of the resource.type: Typestring, represents the type of resource. The supported resource types are defined as follows:video: Audio/video resources (preloading cancellation for image resources is currently not supported)
params: Custom control parameters for canceling preloading, the supported parameters are as follows:preloadKey: Only forvideotype resources. Represents a unique key that identifies the resource. It is necessary to ensure that thepreloadKeypassed here is consistent with that used when calling requestResourcePrefetch. This is a required parameter.
callback
The callback function that is called after the API execution is completed or fails. The structure of its return parameters is as follows:
code: Typenumber, status code, which may take the following values:0: Success11001: Parameter error
msg: Typestring, a global error messagedetails: Typearray, where each detail represents the cancelation status details of a resource. The structure of each detail is as follows:code: Typenumber, status code, which may take the following values:0: Success11001: Parameter error
msg: Typestring, error messageuri: Typestring, represents the CDN address of the resource.type: Typestring, represents the type of the resource, defined as follows:video: Audio/video resources
Return Value
None (undefined).
Exceptions
- When there is a parameter error,
codewill return the11001error code, and themsgwill contain detailed error information.
Example
Compatibility
LCD tables only load in the browser