Update share_btn.py
Browse files- share_btn.py +4 -4
share_btn.py
CHANGED
|
@@ -14,7 +14,7 @@ share_js = """async () => {
|
|
| 14 |
const response = await fetch(UPLOAD_URL, {
|
| 15 |
method: 'POST',
|
| 16 |
headers: {
|
| 17 |
-
'Content-Type': 'video/
|
| 18 |
'X-Requested-With': 'XMLHttpRequest',
|
| 19 |
},
|
| 20 |
body: file, /// <- File inherits from Blob
|
|
@@ -23,13 +23,13 @@ share_js = """async () => {
|
|
| 23 |
return url;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
async function getOutputVideoFile(
|
| 27 |
|
| 28 |
-
const res = await fetch(
|
| 29 |
const blob = await res.blob();
|
| 30 |
//const videoId = Date.now() % 200;
|
| 31 |
const fileName = `talking-portrait-${videoName}`;
|
| 32 |
-
const videoBlob = new File([blob], fileName, { type: 'video/
|
| 33 |
|
| 34 |
console.log(videoBlob);
|
| 35 |
|
|
|
|
| 14 |
const response = await fetch(UPLOAD_URL, {
|
| 15 |
method: 'POST',
|
| 16 |
headers: {
|
| 17 |
+
'Content-Type': 'video/mp4',
|
| 18 |
'X-Requested-With': 'XMLHttpRequest',
|
| 19 |
},
|
| 20 |
body: file, /// <- File inherits from Blob
|
|
|
|
| 23 |
return url;
|
| 24 |
}
|
| 25 |
|
| 26 |
+
async function getOutputVideoFile(videoURL, videoName){
|
| 27 |
|
| 28 |
+
const res = await fetch(videoURL, { mode: 'no-cors'});
|
| 29 |
const blob = await res.blob();
|
| 30 |
//const videoId = Date.now() % 200;
|
| 31 |
const fileName = `talking-portrait-${videoName}`;
|
| 32 |
+
const videoBlob = new File([blob], fileName, { type: 'video/mp4' });
|
| 33 |
|
| 34 |
console.log(videoBlob);
|
| 35 |
|