Skip to main content

Interface: MediaProcessorInterface

Interface definition for media processor instances. When using Web workers the application should define and use a bridge class that implements this interface. See an example of using the library this way here.

Implemented by

Methods

transform

transform(readable, writable): Promise<void>

Starts running the tranformation logic performed by the media processor instance. In case of bridging to WebWorker the function should post message to the Worker with the readable and writable.

Parameters

NameTypeDescription
readableReadableStream<any>Readable stream associated to the media source being processed.
writableWritableStream<any>Writable stream associated to the resulting media once processed.

Returns

Promise<void>

  • In case of using a Web worker the promise should be completed only after the worker was completed.

destroy

destroy(): Promise<void>

Stops running the tranformation logic performed by the media processor instance. In case of using a Web worker the method should post a message to the Worker with the destroy message.

Returns

Promise<void>

  • In case of using a Web worker the promise should be completed only after the worker was completed.