Function: isValidFile()
ts
function isValidFile(url): Promise<FileValidationResult>;Check whether a file is a playable audio or video file.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Local path or URL of the file. |
Returns
Promise<FileValidationResult>
Whether the file is valid, its type and its duration.
Example
ts
const { isValid, fileType, duration } = await isValidFile(uri);