Skip to main content

Mute

Do you ever wish that you were like Adam Sandler in the movie Click and you could mute people when they got annoying? This is the next best thing.

const compressedFile = modfy.compress(
{
inputFiles: ['video.mp4'],
mute: true
},
'sync' // Can be 'async' | 'sync' | 'client',
'https://yourdomain.com/modfyWebhook'
)

Arguments#

ParameterTypeDescription
mutebooleantrue if this operation is enabled

undefined Full class reference is below

Typing#

modfy.convert(
{
inputFiles: AcceptedFiles,
to: ToFile
},
processType: ProcessType,
webhookUrl?: string
): Promise<Uint8Array> | Promise<{ id: string, uuid: string }>
type ToFile = {
format: FormatKey // From the keys of the default formats
codec?: CodecKey // From the keys of the default codecs
}
type ProcessType = "sync" | "client" | "async"
/**
* This interface is a wrapper for a file object which takes a buffer
* with the mimeType and name of the file
*/
type ModfyFile = {
name: string
mimeType?: string
buffer: Buffer
}
type StoredFiles = File[] | ModfyFile[]
/**
* This type represents the accepted file inputs
*
* There are three accepted file input types
* 1. Array of Html File Object
* 2. Array of Strings, File Paths (Node only)
* 3. Array of {buffer, name, mimeType}
Here we are supporting buffers directly but require that you provide the name and mimeType
*/
type AcceptedFiles = StoredFiles | string[]

Caveats#

  • All files in the input array must be of same type
  • String paths are only supported in node