Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Image save and copy path

Bowen Xuec1567429b1ba
diff --git a/web/autopilot_chat.css b/web/autopilot_chat.css
index 91d2792..0cafd6f 100644
--- a/web/autopilot_chat.css
+++ b/web/autopilot_chat.css
@@ -83,6 +83,8 @@
.fv-studio.fv-chat-image-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;padding:12px;border-radius:14px;background:var(--fv-card)}
.fv-chat-image-viewer>.fv-chat-actions{justify-content:flex-end}
.fv-studio.fv-chat-image-viewer .fv-close{min-height:34px;width:34px;padding:0;font-size:20px;line-height:1;background:transparent;border-color:transparent;color:var(--fv-muted)}
+.fv-studio.fv-chat-image-viewer .fv-chat-save{min-height:34px;padding:0 14px;border-radius:7px;font-size:13px;background:transparent;border-color:transparent;color:var(--fv-muted)}
+.fv-studio.fv-chat-image-viewer .fv-chat-save:hover{background:var(--fv-raised);color:var(--fv-ink)}
.fv-studio.fv-chat-image-viewer .fv-close:hover{background:var(--fv-raised);color:var(--fv-ink)}
.fv-chat-preview[data-open=true]{cursor:zoom-in}
.fv-chat-image-stage{position:relative;min-width:0;min-height:0;overflow:hidden;border-radius:9px;background:var(--fv-bg);touch-action:none;cursor:grab;user-select:none}
diff --git a/web/autopilot_chat.js b/web/autopilot_chat.js
index b66970a..d517a11 100644
--- a/web/autopilot_chat.js
+++ b/web/autopilot_chat.js
@@ -159,12 +159,19 @@ export function jobParts(job) {
return Array.from({length: block.total}, (_, i) => i < (block.done || 0) ? 1 : i === block.index - 1 ? inside : 0);
}
+// Saves a picture through the browser's own download, under the file's name.
+function saveImage(src) {
+ const link = el('a'); link.href = src; link.download = new URL(src, location.href).searchParams.get('filename') || '';
+ document.body.append(link); link.click(); link.remove();
+}
+
// A picture is viewed here, independently of the video library. The image stays within reach while zoomed.
function imageViewer(t, src, name, opener, failed) {
const dialog = el('dialog', 'fv-studio fv-chat-image-viewer'), actions = el('div', 'fv-chat-actions');
dialog.setAttribute('aria-label', name);
const close = press('fv-close', '×', () => closeDialog(dialog));
- close.setAttribute('aria-label', t('Close', '关闭')); close.title = t('Close', '关闭'); actions.append(close);
+ close.setAttribute('aria-label', t('Close', '关闭')); close.title = t('Close', '关闭');
+ actions.append(press('fv-chat-save', t('Download', '下载'), () => saveImage(src)), close);
const stage = el('div', 'fv-chat-image-stage'), image = el('img');
image.alt = name; image.draggable = false; stage.append(image); dialog.append(actions, stage);
let scale = 1, fit = 1, x = 0, y = 0, disposed = false;
@@ -797,7 +804,8 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
dismissImage = imageViewer(t, api.apiURL(job.thumbnail), name.textContent, show, () => { show.disabled = true; });
});
const cut = press('fv-chat-edit', t('Edit', '剪辑'), () => edit(job));
- if (picture && job.thumbnail) { show.disabled = true; foot.append(show); }
+ const save = press('fv-chat-save', t('Download', '下载'), () => saveImage(api.apiURL(job.thumbnail)));
+ if (picture && job.thumbnail) { show.disabled = save.disabled = true; foot.append(show, save); }
else if (!picture && job.work) foot.append(show, cut);
info.append(head); if (foot.childElementCount) info.append(foot);
const children = [info];
@@ -805,7 +813,7 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
const {box, shape} = preview(job), length = el('span', 'fv-chat-length', job.seconds > 0 ? clock(job.seconds) : '');
if (job.thumbnail) {
const image = el('img'); image.alt = '';
- const viewable = on => { show.disabled = !on; if (on) box.dataset.open = 'true'; else delete box.dataset.open; };
+ const viewable = on => { show.disabled = save.disabled = !on; if (on) box.dataset.open = 'true'; else delete box.dataset.open; };
image.onload = () => { if (!box.style.aspectRatio) shape(image.naturalWidth, image.naturalHeight); if (picture) viewable(true); };
if (picture) { image.onerror = () => viewable(false); box.onclick = () => { if (!show.disabled) show.click(); }; }
image.src = api.apiURL(job.thumbnail); box.append(image);
@@ -858,7 +866,7 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
item.replaceChildren(...children);
return (next, latest) => {
name.textContent = jobName(next, t); meta.textContent = jobMeta(next, t); meta.hidden = !meta.textContent;
- if (picture) show.setAttribute('aria-label', t('Open ', '打开 ') + jobName(next, t));
+ if (picture) { show.setAttribute('aria-label', t('Open ', '打开 ') + jobName(next, t)); save.setAttribute('aria-label', t('Download ', '下载 ') + jobName(next, t)); }
show.classList.toggle('fv-primary', latest);
};
}
diff --git a/web/result_actions.css b/web/result_actions.css
index 2f0c101..b3b1b2d 100644
--- a/web/result_actions.css
+++ b/web/result_actions.css
@@ -64,3 +64,5 @@
@keyframes fv-menu-enter{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.fv-actions *{transition:none!important;animation:none!important}}
.fv-actions[data-unavailable=true] :is(a.fv-action[download],.fv-action-extend,.fv-share-trigger){opacity:.45;cursor:default;pointer-events:none}
+.fv-action-copy .fv-copy-text{display:inline-grid;justify-items:start}
+.fv-action-copy .fv-copy-text::after{content:attr(data-widest);grid-area:1/1;visibility:hidden;height:0;overflow:hidden}
diff --git a/web/result_actions.js b/web/result_actions.js
index cb15dd7..75befcd 100644
--- a/web/result_actions.js
+++ b/web/result_actions.js
@@ -18,6 +18,7 @@ const ICONS = {
lock: '<rect x="3.5" y="7" width="9" height="6.5" rx="1.5"/><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"/>',
close: '<path d="m4 4 8 8M12 4l-8 8"/>',
expand: '<path d="M9.5 2.5h4v4M13.5 2.5 9 7M6.5 13.5h-4v-4M2.5 13.5 7 9"/>',
+ copy: '<rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5v-1a1 1 0 0 0-1-1h-5a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1"/>',
trash: '<path d="M3 4.5h10M6.5 4.5V3h3v1.5M4.5 4.5l.6 8.1a1 1 0 0 0 1 .9h3.8a1 1 0 0 0 1-.9l.6-8.1M7 7v4M9 7v4"/>',
};
@@ -130,6 +131,15 @@ export function actionsUnavailable(bar) {
}
}
+// Writes text to the clipboard; resolves false when neither the clipboard API nor the old copy command is allowed.
+export async function copyText(text) {
+ try { await navigator.clipboard.writeText(text); return true; } catch { /* fall through to the selection copy */ }
+ const area = document.createElement('textarea'); area.value = text; area.setAttribute('readonly', '');
+ area.style.cssText = 'position:fixed;top:0;left:0;opacity:0';
+ document.body.append(area); area.select();
+ try { return document.execCommand('copy'); } catch { return false; } finally { area.remove(); }
+}
+
// Download the video first; share and the report follow. A first-pass preview
// leads with `secondPass` instead, and saved creations end with `remove`.
// `diagnostic` downloads the redacted report (and may offer to send it); a
@@ -142,6 +152,17 @@ export function resultActions(record, t, {diagnostic = null, secondPass = null,
const download = action('a', t('Download video', '下载视频'), 'download', secondPass ? 'fv-action-secondary' : 'fv-action-primary');
download.href = outputDownloadURL(api, record.video); download.download = '';
bar.append(download);
+ const copy = action('button', t('Copy path', '复制路径'), 'copy', 'fv-action-secondary fv-action-copy');
+ const text = copy.lastElementChild; let timer = 0;
+ // The button keeps the width of its longest label, so the bar does not shift when the label changes.
+ text.className = 'fv-copy-text';
+ text.dataset.widest = [t('Copy path', '复制路径'), t('Copied', '已复制'), t('Could not copy', '复制失败')].sort((a, b) => b.length - a.length)[0];
+ copy.onclick = async () => {
+ clearTimeout(timer);
+ text.textContent = await copyText(record.video) ? t('Copied', '已复制') : t('Could not copy', '复制失败');
+ timer = setTimeout(() => { text.textContent = t('Copy path', '复制路径'); }, 1800);
+ };
+ bar.append(copy);
}
if (extend && canExtend(record)) {
const button = action('button', extendText(t, 'action'), 'extend', 'fv-action-secondary fv-action-extend');