mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-01-22 22:50:20 +00:00
Changed screen capture to non effect. Effects are used to alter the stream, this feature does not need to alter the stream, it just needs access to it Changed image diff library. Previous library diff’ed the whole image, the new one has en early return threshold Use ImageCaptureAPI to take the screenshot. Added polyfill for it and polyfill for createImageBitmap Added analytics
26 lines
789 B
JavaScript
26 lines
789 B
JavaScript
/*
|
|
* Safari polyfill for createImageBitmap
|
|
* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap
|
|
*
|
|
* Support source image types: Canvas.
|
|
*/
|
|
if (!('createImageBitmap' in window)) {
|
|
window.createImageBitmap = async function(data) {
|
|
return new Promise((resolve, reject) => {
|
|
let dataURL;
|
|
|
|
if (data instanceof HTMLCanvasElement) {
|
|
dataURL = data.toDataURL();
|
|
} else {
|
|
reject(new Error('createImageBitmap does not handle the provided image source type'));
|
|
}
|
|
const img = document.createElement('img');
|
|
|
|
img.addEventListener('load', () => {
|
|
resolve(img);
|
|
});
|
|
img.src = dataURL;
|
|
});
|
|
};
|
|
}
|