mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
feat: save frame as image
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
export function downloadBlob({
|
||||
blob,
|
||||
filename,
|
||||
}: {
|
||||
blob: Blob;
|
||||
filename: string;
|
||||
}): void {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const anchor = document.createElement("a");
|
||||
anchor.href = url;
|
||||
anchor.download = filename;
|
||||
document.body.appendChild(anchor);
|
||||
anchor.click();
|
||||
document.body.removeChild(anchor);
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
export function isTypableDOMElement({
|
||||
element,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user