Skip to content

Function: trim() ​

ts
function trim(url, options): Promise<TrimResult>;

Trim a video or audio file without showing any UI.

Parameters ​

ParameterTypeDescription
urlstringLocal path or URL of the media.
optionsPartial<TrimOptions>Trim range and output options. Times are in milliseconds.

Returns ​

Promise<TrimResult>

The trimmed range and the output path.

Example ​

ts
const { outputPath } = await trim(videoUri, {
  startTime: 5_000,
  endTime: 25_000,
});

Released under the MIT License.