fixed video and worker-js-path for toCubemap

pull/27/head v0.4_forSD-Webui_Gradio_3.13(old)
GeorgLegato 2023-04-02 00:20:15 +02:00
parent c087c85e75
commit ab4231406c
1 changed files with 22 additions and 7 deletions

View File

@ -101,6 +101,19 @@ function panorama_here(phtml, mode, buttonId) {
}
}
function panorama_send_video(dataURL, name = "Embed Resource") {
gradioApp().getElementById("panoviewer-iframe").contentWindow.postMessage({
type: "panoramaviewer/set-video",
image: {
dataURL: dataURL,
resourceName: name,
},
});
}
function panorama_send_image(dataURL, name = "Embed Resource") {
openpanorama.frame.contentWindow.postMessage({
type: "panoramaviewer/set-panorama",
@ -424,13 +437,15 @@ function convertto_cubemap() {
throw new Error();
} catch (error) {
const stack = error.stack;
const matches = stack.match(/(file:\/\/.*\/)panoramaviewer-ext\.js/);
//if (matches && matches.length > 1 ) {
//const scriptPath = matches[1];
const scriptPath = "http://localhost:7860/file=S:/KI/stable-diffusion-webui1111/extensions/stable-diffusion-webui-panorama-3dviewer/javascript/"
const workerPath = new URL('e2c.js', scriptPath).href;
worker = new Worker(workerPath);
//}
const match = stack.match(/file=.*javascript\//)
if (match) {
const scriptPath = window.location.href+match;
const workerPath = new URL('e2c.js', scriptPath).href;
worker = new Worker(workerPath);
}
else {
throw "no clue where the javascript worker file is hosted."
}
}
const placeTile = (data) => {