Solving nasty javascript bug avoiding download.

This commit is contained in:
sergiotarxz 2021-01-17 09:32:33 +01:00
parent a85b8c8970
commit 7214bdffef
Signed by: sergiotarxz
GPG Key ID: E5903508B6510AC2

View File

@ -11,7 +11,7 @@ let downloadForm;
let video;
let modalLoading;
let filename;
let url;
let url_video;
let popingNotice;
let popingNoticeContent;
let closePopingNotice;
@ -70,7 +70,7 @@ function askForURL(url, format) {
} else {
video.src = response.url;
filename = response.filename;
url = response.url;
url_video = response.url;
video.addEventListener('canplay', (event) => {
modalLoading.classList.remove('active');
modalVideoContainer.style.display = 'block';
@ -103,7 +103,7 @@ function askForURL(url, format) {
function downloadVideoPrepareHandler(event) {
downloadVideoPrepare.classList.remove('active');
downloadVideoLoading.classList.add('active');
generateBlobVideo(url).then( blob => {
generateBlobVideo(url_video).then( blob => {
downloadVideo.href = URL.createObjectURL(blob);
downloadVideo.download = filename;
downloadVideoLoading.classList.remove('active');