Update app.py
Browse files
app.py
CHANGED
|
@@ -458,11 +458,29 @@ load_model="""
|
|
| 458 |
async()=>{
|
| 459 |
var intv = setInterval(function(){
|
| 460 |
if (document.getElementById("output_video").getElementsByTagName("video")) {
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 464 |
|
| 465 |
clearInterval(intv);
|
|
|
|
| 466 |
}
|
| 467 |
}, 40);
|
| 468 |
}
|
|
|
|
| 458 |
async()=>{
|
| 459 |
var intv = setInterval(function(){
|
| 460 |
if (document.getElementById("output_video").getElementsByTagName("video")) {
|
| 461 |
+
try {
|
| 462 |
+
const xhttp = new XMLHttpRequest();
|
| 463 |
+
xhttp.onreadystatechange = function() {
|
| 464 |
+
if (this.readyState == 4 && this.status == 200) {
|
| 465 |
+
var uInt8Array = new Uint8Array(this.response);
|
| 466 |
+
|
| 467 |
+
for (var i = 0, len = uInt8Array.length; i < len; ++i) {
|
| 468 |
+
uInt8Array[i] = this.response[i];
|
| 469 |
+
}
|
| 470 |
+
const blob = new Blob([uInt8Array], {
|
| 471 |
+
type: "video/mp4",
|
| 472 |
+
});
|
| 473 |
+
|
| 474 |
+
document.getElementById("model3d").src = document.getElementById("model3d").src.split("?")[0] + "?url=" + URL.createObjectURL(blob);
|
| 475 |
+
document.getElementById("newtab").href = document.getElementById("model3d").src;
|
| 476 |
+
}
|
| 477 |
+
};
|
| 478 |
+
xhttp.responseType = 'arraybuffer';
|
| 479 |
+
xhttp.open("GET", document.getElementById("output_video").getElementsByTagName("video")[0].src);
|
| 480 |
+
xhttp.send();
|
| 481 |
|
| 482 |
clearInterval(intv);
|
| 483 |
+
} catch(e) {alert(e)}
|
| 484 |
}
|
| 485 |
}, 40);
|
| 486 |
}
|