forked from 77media/video-flow
Merge branch '20251014-fix-video-path' into dev
This commit is contained in:
commit
ae630e9757
@ -80,12 +80,13 @@ export function createScreenAdapter(): void {
|
|||||||
|
|
||||||
export const downloadVideo = async (url: string) => {
|
export const downloadVideo = async (url: string) => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(decodeURIComponent(url));
|
const modifyUrl = decodeURIComponent(url);
|
||||||
|
const response = await fetch(modifyUrl);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
const blobUrl = window.URL.createObjectURL(blob);
|
const blobUrl = window.URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = blobUrl;
|
a.href = blobUrl;
|
||||||
a.download = url.split('/').pop() || 'video.mp4';
|
a.download = modifyUrl.split('/').pop() || 'video.mp4';
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user