Telegram Web K with changes to work inside I2P https://web.telegram.i2p/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
770 B

/*
* https://github.com/morethanwords/tweb
* Copyright (C) 2019-2021 Eduard Kuzmenko
* https://github.com/morethanwords/tweb/blob/master/LICENSE
*/
2 years ago
import {animate} from '../../helpers/animation';
export default function callVideoCanvasBlur(video: HTMLVideoElement) {
const canvas = document.createElement('canvas');
canvas.classList.add('call-video-blur');
const size = 16;
canvas.width = size;
canvas.height = size;
2 years ago
const ctx = canvas.getContext('2d', {alpha: false});
ctx.filter = 'blur(2px)';
const renderFrame = () => {
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, canvas.width, canvas.height);
};
animate(() => {
renderFrame();
return canvas.isConnected;
});
renderFrame();
return canvas;
2 years ago
}