From 5c6080546ecd90bf159f7502c7b302d18afe7edb Mon Sep 17 00:00:00 2001 From: WofWca Date: Sun, 3 Apr 2022 19:30:12 +0300 Subject: [PATCH] fix: `CloningController` crashing when the media is CORS-restricted Introduced in 02b8ff84 This could happen when `dontAttachToCrossOriginMedia` is `false` --- .../CloningController/CloningController.ts | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/content/CloningController/CloningController.ts b/src/content/CloningController/CloningController.ts index 2977b420..42714b40 100644 --- a/src/content/CloningController/CloningController.ts +++ b/src/content/CloningController/CloningController.ts @@ -237,12 +237,6 @@ export default class Controller { // Also keep in mind that `createMediaElementSource` and `captureStream` are not 100% interchangeable. // For example, for `el.volume` doesn't affect the volume for `captureStream()`. // TODO fall-back to `createMediaElementSource` if these are not supported? - // - // TODO if the media is CORS-restricted, this throws an error. You may say that "if it is - // CORS-restricted then we won't be able to use the cloning algorithm anyway". Right now you're right, - // but in the future we may create the clone inside an