Solving nasty javascript bug avoiding download.
This commit is contained in:
parent
a85b8c8970
commit
7214bdffef
|
@ -11,7 +11,7 @@ let downloadForm;
|
||||||
let video;
|
let video;
|
||||||
let modalLoading;
|
let modalLoading;
|
||||||
let filename;
|
let filename;
|
||||||
let url;
|
let url_video;
|
||||||
let popingNotice;
|
let popingNotice;
|
||||||
let popingNoticeContent;
|
let popingNoticeContent;
|
||||||
let closePopingNotice;
|
let closePopingNotice;
|
||||||
|
@ -70,7 +70,7 @@ function askForURL(url, format) {
|
||||||
} else {
|
} else {
|
||||||
video.src = response.url;
|
video.src = response.url;
|
||||||
filename = response.filename;
|
filename = response.filename;
|
||||||
url = response.url;
|
url_video = response.url;
|
||||||
video.addEventListener('canplay', (event) => {
|
video.addEventListener('canplay', (event) => {
|
||||||
modalLoading.classList.remove('active');
|
modalLoading.classList.remove('active');
|
||||||
modalVideoContainer.style.display = 'block';
|
modalVideoContainer.style.display = 'block';
|
||||||
|
@ -103,7 +103,7 @@ function askForURL(url, format) {
|
||||||
function downloadVideoPrepareHandler(event) {
|
function downloadVideoPrepareHandler(event) {
|
||||||
downloadVideoPrepare.classList.remove('active');
|
downloadVideoPrepare.classList.remove('active');
|
||||||
downloadVideoLoading.classList.add('active');
|
downloadVideoLoading.classList.add('active');
|
||||||
generateBlobVideo(url).then( blob => {
|
generateBlobVideo(url_video).then( blob => {
|
||||||
downloadVideo.href = URL.createObjectURL(blob);
|
downloadVideo.href = URL.createObjectURL(blob);
|
||||||
downloadVideo.download = filename;
|
downloadVideo.download = filename;
|
||||||
downloadVideoLoading.classList.remove('active');
|
downloadVideoLoading.classList.remove('active');
|
||||||
|
|
Loading…
Reference in New Issue