mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 19:57:47 +00:00
fix(face-landmarks) fix createImageBitMap polyfill on Safari 14
The polyfill returns an Image object instead of an ImageBitmap. The latter has a close method, however, which we call. Make sure we provide a dummy close method to avoid errors.
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
dd044ad252
commit
ef748c576d
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Safari polyfill for createImageBitmap
|
||||
* Safari < 15 polyfill for createImageBitmap
|
||||
* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap
|
||||
*
|
||||
* Support source image types: Canvas.
|
||||
@@ -16,6 +16,9 @@ if (!('createImageBitmap' in window)) {
|
||||
}
|
||||
const img = document.createElement('img');
|
||||
|
||||
// eslint-disable-next-line no-empty-function
|
||||
img.close = () => {};
|
||||
|
||||
img.addEventListener('load', () => {
|
||||
resolve(img);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user