@vonage/media-processor
    Preparing search index...

    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.

    interface MediaProcessorInterface {
        destroy(): Promise<void>;
        transform(
            readable: ReadableStream,
            writable: WritableStream,
        ): Promise<void>;
        transform(track: MediaStreamTrack): Promise<MediaStreamTrack>;
    }

    Implemented by

    Index

    Methods

    • 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.
    • 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

      • readable: ReadableStream

        Readable stream associated to the media source being processed.

      • writable: WritableStream

        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.
    • 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 track.

      Parameters

      • track: MediaStreamTrack

        MeadiaStreamTrack (audio or video) to be processed.

      Returns Promise<MediaStreamTrack>

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