diff --git a/Frontend/templates/Frontend/video-editing.html b/Frontend/templates/Frontend/video-editing.html index 2fcfcb2..2bbda84 100644 --- a/Frontend/templates/Frontend/video-editing.html +++ b/Frontend/templates/Frontend/video-editing.html @@ -7,6 +7,7 @@ + Transcript-Editing @@ -50,7 +51,7 @@ - +
diff --git a/static/js/transcript-editing.js b/static/js/transcript-editing.js index 97c5e2e..e869d8a 100755 --- a/static/js/transcript-editing.js +++ b/static/js/transcript-editing.js @@ -111,8 +111,26 @@ function deleteTranscript() { }); } -function downloadTranscript(){ - console.log("downloading transcript"); +async function downloadTranscript(){ + console.log("downloading video"); + + var data = new FormData(); + data.append('id', id); + + var videoUrl = await makeRequest("/api/get/", data); + var filename = "video.mp4"; + + console.log("Download URL:") + console.log(videoUrl); + console.log(videoUrl["url"]); + + var xhr = new XMLHttpRequest(); + xhr.responseType = "blob"; + xhr.onload = function() { + saveAs(xhr.response, filename); + }; + xhr.open("GET", videoUrl["url"]); + xhr.send(); }