2.15.0 (June 16, 2021)
Breaking Change on Video Processor API (Beta)
VideoProcessor.processFrame method signature has been changed in order to improve the performance of the Video Processor API. With this update, the output frame buffer is now provided to the processFrame
method which should be used to draw the processed frame.
Old signature:
processFrame(inputFrame: OffscreenCanvas)
: Promise<OffscreenCanvas | null>
| OffscreenCanvas | null;
New signature:
processFrame(inputFrameBuffer: OffscreenCanvas, outputFrameBuffer: HTMLCanvasElement)
: Promise<void> | void;
Example:
class GrayScaleProcessor {
constructor(percentage) {
this.percentage = percentage;
}
processFrame(inputFrameBuffer, outputFrameBuffer) {
const context = outputFrameBuffer.getContext('2d');
context.filter = `grayscale(${this.percentage}%)`;
context.drawImage(inputFrameBuffer, 0, 0, inputFrameBuffer.width, inputFrameBuffer.height);
}
}
Video.createLocalVideoTrack().then(function(videoTrack) {
videoTrack.addProcessor(new GrayScaleProcessor(100));
});
Bug Fixes
-
Fixed a bug where
isSupported
was returningtrue
on certain unsupported mobile browsers. With this release,isSupported
should now return true only for the browsers supported by twilio-video.js. -
Updated NetworkQualityBandwidthStats documentation to reflect the correct bandwidth units, in bits per second, instead of bytes.