Skip to content

Function: isValidFile() ​

ts
function isValidFile(url): Promise<FileValidationResult>;

Check whether a file is a playable audio or video file.

Parameters ​

ParameterTypeDescription
urlstringLocal 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);

Released under the MIT License.