send and refresh perspective image

assymetric-collaboration
Fabien Benetou 2 years ago
parent c9f3e9c3ec
commit d5bc01251e
  1. 20
      index.html

@ -2448,6 +2448,26 @@ AFRAME.registerComponent('refresh-text-content-from-wiki-page', {
} }
}); });
function sendPerspectiveToServer(){
let pagename
let = forcedPagename = AFRAME.utils.getUrlParameter('roomname')
forcedPagename?pagename=forcedPagename:pagename="TestingPairCollaboration"
document.querySelector('a-scene').components.screenshot.getCanvas('perspective').toBlob( blob => {
let img = new File([blob], pagename+".jpg", { type: "image/jpeg"});
form = new FormData();
form.append('authpw', 'upload_pass_for_api');
form.append('n', 'PIMVRdata.TestFormUpoad');
form.append('action', 'postupload');
form.append('uploadfile', img);
fetch('https://fabien.benetou.fr/PIMVRdata/TestFormUpoad', {
method: 'POST',
body: form
});
}, "image/jpeg", 0.8);
}
</script> </script>
<div id="observablehq-key"> <div id="observablehq-key">
<div id="observablehq-viewof-offsetExample-ab4c1560"></div> <div id="observablehq-viewof-offsetExample-ab4c1560"></div>

Loading…
Cancel
Save