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
processorClientwith a lowercase "p" andVideoProcessorwith an uppercase "V".
VideoProcessorrefers to theVideoProcessorobject provided by the SDK.
processorClientrepresents an instance of aVideoProcessor, created with thenewkeyword:
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
undefinedif 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
| Name | Type |
|---|---|
Payload | LoadVirtualBackgroundPayload |
Returns
Promise<VirtualBackgroundProcessor>
Promise containing The virtualBackground Object