add ability to download recordings

This commit is contained in:
MarconLP 2023-04-14 19:53:21 +02:00
parent b6e91d7348
commit b2270dc6c4
No known key found for this signature in database
GPG key ID: A08A9C8B623F5EA5

View file

@ -21,6 +21,20 @@ export default function VideoMoreMenu({ video }: Props) {
{
name: "Download",
icon: <DownloadIcon />,
props: {
onClick: () => {
void fetch(video.video_url).then((response) => {
void response.blob().then((blob) => {
const url = window.URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = video.title;
a.click();
});
//window.location.href = response.url;
});
},
},
},
{
name: "Delete",