Better error message if the webcam node doesn't work.

This commit is contained in:
comfyanonymous 2024-05-17 14:02:09 -04:00
parent 91590adf04
commit 1c4af5918a
1 changed files with 7 additions and 1 deletions

View File

@ -33,7 +33,13 @@ app.registerExtension({
label.style.overflow = "auto";
label.style.maxHeight = "100%";
label.style.whiteSpace = "pre-wrap";
if (window.isSecureContext) {
label.textContent = "Unable to load webcam, please ensure access is granted:\n" + error.message;
} else {
label.textContent = "Unable to load webcam. A secure context is required, if you are not accessing ComfyUI on localhost (127.0.0.1) you will have to enable TLS (https)\n\n" + error.message;
}
container.replaceChildren(label);
}
};