Skip to main content

Class: VideoProcessor

The Video Processor Class allows you to create to Modify Video Streams from the Video Class using Twilio Programmable Video Processors

Throughout this page, you will see processorClient with a lowercase "p" and VideoProcessor with an uppercase "V".

VideoProcessor refers to the VideoProcessor object provided by the SDK.

processorClient represents an instance of a VideoProcessor, created with the new keyword:

Instantiate a Video Processor Client

A new instance of VideoProcessor should be constructed by using the new keyword and passing the Optional Config payload as the first argument.

Initiate a Basic Video Processor Client

const processorClient = new VideoProcessor();

To see all of the possible properties, see the Config interface section.

Hierarchy

  • EventEmitter

    VideoProcessor

Accessors

client

get client(): __module

Returns the underlaying Twilio SDK VideoProcessors for advanced configuration and usage

    console.info(processorClient.client.version);

Returns

__module


isSupported

get isSupported(): boolean

Returns if Video Processors is Supported in the current Browser / Context

    console.info(processorClient.isSupported)

Returns

boolean


ready

get ready(): boolean

Is the processorClient ready?

    processorClient.ready ? console.info("Ready") ? console.info("Not Ready")

Returns

boolean


virtualBackground

get virtualBackground(): undefined | VirtualBackgroundProcessor

Returns the underlaying Twilio SDK VirtualBackgroundProcessor for advanced configuration and usage

Returns undefined if there is no current virtualBackground

    console.info(processorClient.virtualBackground?.fitType)

Returns

undefined | VirtualBackgroundProcessor

Methods

loadVirtualBackground

loadVirtualBackground(Payload): Promise<VirtualBackgroundProcessor>

Load a new Virtual Background

    await processorClient.loadVirtualBackground({ imgUrl: "https://example.com/myimg.png "});

Parameters

NameType
PayloadLoadVirtualBackgroundPayload

Returns

Promise<VirtualBackgroundProcessor>

Promise containing The virtualBackground Object