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.
Reminder when a long run finishes in a background tab
Bowen Xue211308debca6
diff --git a/scripts/test_freevideo_entry.mjs b/scripts/test_freevideo_entry.mjsindex 05749a4..53fe143 100644--- a/scripts/test_freevideo_entry.mjs+++ b/scripts/test_freevideo_entry.mjs@@ -26,7 +26,7 @@ class Element {test('main browser entry registers both views and preserves node hooks', async t => {const extensions = [], opened = [], installed = [], events = new EventTarget();- let refreshed = 0, compatibilityChecks = 0, updateChecks = 0, rememberedView = null;+ let refreshed = 0, compatibilityChecks = 0, updateChecks = 0, doneNotifyStarts = 0, rememberedView = null;let progressView, progressOptions, realProgressFactory;const app = {registerExtension(extension) { extensions.push(extension); },@@ -62,6 +62,7 @@ test('main browser entry registers both views and preserves node hooks', async tcreateProgressConnection: () => ({start() {}, refresh() {}, reset() {}}),notifyCompatibility: async () => { compatibilityChecks++; },startUpdateChecks: () => { updateChecks++; },+ startDoneNotify: () => { doneNotifyStarts++; }, askDesktopPermission: () => {},installNavigation: callback => installed.push(callback),refreshNavigation: () => refreshed++, preferredView: () => rememberedView,attachReferencePicker() {}, referenceItems: () => [], syncReferencePrompt() {},@@ -90,6 +91,7 @@ test('main browser entry registers both views and preserves node hooks', async t.replace("import { createProgressConnection } from './progress_connection.js';", 'const {createProgressConnection} = globalThis.__freevideoEntryTest;').replace("import { notifyCompatibility } from './compatibility.js';", 'const {notifyCompatibility} = globalThis.__freevideoEntryTest;').replace("import { startUpdateChecks } from './updates.js';", 'const {startUpdateChecks} = globalThis.__freevideoEntryTest;')+ .replace("import { startDoneNotify, askDesktopPermission, DESKTOP_SETTING } from './done_notify.js';", 'const {startDoneNotify,askDesktopPermission} = globalThis.__freevideoEntryTest; const DESKTOP_SETTING = "FreeVideo.DoneNotify.Desktop";').replace("import { attachReferencePicker, referenceItems, syncReferencePrompt, referenceInputs } from './prompt_references.js';", 'const {attachReferencePicker,referenceItems,syncReferencePrompt,referenceInputs} = globalThis.__freevideoEntryTest;').replace("import { outputDownloadURL } from './output_download.js';", 'const {outputDownloadURL} = globalThis.__freevideoEntryTest;').replace("import { shareButton } from './share.js';", 'const {shareButton} = globalThis.__freevideoEntryTest;')@@ -110,6 +112,7 @@ test('main browser entry registers both views and preserves node hooks', async tassert.equal(installed.length, 1, 'the Create / Nodes navigation must be installed');assert.equal(compatibilityChecks, 1);assert.equal(updateChecks, 1);+ assert.equal(doneNotifyStarts, 1);class GenerateNode {constructor() {diff --git a/web/done_notify.js b/web/done_notify.jsnew file mode 100644index 0000000..c2bcec3--- /dev/null+++ b/web/done_notify.js@@ -0,0 +1,77 @@+// Tells the user a long run has finished while FreeVideo is in a background tab:+// the tab title flashes and one short beep plays until the page is shown again.+// A desktop notification is sent only when the user turned it on in the settings.+export const DESKTOP_SETTING = 'FreeVideo.DoneNotify.Desktop';+const LONG_RUN_MS = 20000, FLASH_MS = 1000;++export function startDoneNotify({api, text, doc = document, win = window, now = () => Date.now(), desktop = () => false,+ beep = playBeep, notify = desktopNotice, minimum = LONG_RUN_MS, setTimer = setInterval, clearTimer = clearInterval} = {}) {+ let busySince = null, failed = false, cancelled = false, flashing = null;+ const away = () => doc.hidden || (typeof doc.hasFocus === 'function' && !doc.hasFocus());++ function stopFlashing() {+ if (!flashing) return;+ clearTimer(flashing.timer); doc.title = flashing.title; flashing = null;+ }+ function remind(ok) {+ const label = ok ? text('✓ Done', '✓ 已完成') : text('✕ Stopped', '✕ 已停止');+ stopFlashing();+ const title = doc.title; let lit = false;+ const tick = () => { lit = !lit; doc.title = lit ? label : title; };+ flashing = {title, timer: setTimer(tick, FLASH_MS)}; tick();+ try { beep(win); } catch { /* A browser may block sound before the first click. */ }+ try { if (desktop()) notify(win, label, () => { win.focus?.(); stopFlashing(); }); } catch { /* Notifications are optional. */ }+ }+ function status(event) {+ const remaining = event?.detail?.exec_info?.queue_remaining;+ if (!Number.isFinite(remaining)) return;+ if (remaining > 0) {+ if (busySince === null) { busySince = now(); failed = false; cancelled = false; }+ return;+ }+ if (busySince === null) return;+ const elapsed = now() - busySince; busySince = null;+ if (cancelled || elapsed < minimum || !away()) return;+ remind(!failed);+ }+ const error = () => { failed = true; };+ const interrupted = () => { cancelled = true; };+ const shown = () => { if (!away()) stopFlashing(); };+ api.addEventListener('status', status);+ api.addEventListener('execution_error', error);+ api.addEventListener('execution_interrupted', interrupted);+ doc.addEventListener('visibilitychange', shown);+ win.addEventListener?.('focus', shown);+ return {stop() {+ api.removeEventListener('status', status); api.removeEventListener('execution_error', error);+ api.removeEventListener('execution_interrupted', interrupted);+ doc.removeEventListener('visibilitychange', shown); win.removeEventListener?.('focus', shown); stopFlashing();+ }};+}++function playBeep(win) {+ const Context = win.AudioContext || win.webkitAudioContext;+ if (!Context) return;+ const context = new Context();+ if (context.state === 'suspended') context.resume?.();+ const tone = context.createOscillator(), gain = context.createGain(), start = context.currentTime;+ tone.type = 'sine'; tone.frequency.value = 880;+ gain.gain.setValueAtTime(0.0001, start);+ gain.gain.exponentialRampToValueAtTime(0.2, start + 0.02);+ gain.gain.exponentialRampToValueAtTime(0.0001, start + 0.35);+ tone.connect(gain); gain.connect(context.destination);+ tone.start(start); tone.stop(start + 0.4);+ tone.onended = () => context.close?.();+}++function desktopNotice(win, label, clicked) {+ const Notice = win.Notification;+ if (!Notice || Notice.permission !== 'granted') return;+ const notice = new Notice(`${label} · FreeVideo`);+ notice.onclick = () => { clicked(); notice.close?.(); };+}++// Asks for notification permission when the user switches the setting on.+export function askDesktopPermission(win = window) {+ try { win.Notification?.requestPermission?.(); } catch { /* Optional. */ }+}diff --git a/web/freevideo.js b/web/freevideo.jsindex 95a02ab..948d427 100644--- a/web/freevideo.js+++ b/web/freevideo.js@@ -7,6 +7,7 @@ import { createGenerationProgress, referenceTrimText, thermalText, sharedGpuTextimport { createProgressConnection } from './progress_connection.js';import { notifyCompatibility } from './compatibility.js';import { startUpdateChecks } from './updates.js';+import { startDoneNotify, askDesktopPermission, DESKTOP_SETTING } from './done_notify.js';import { installNavigation, refreshNavigation, preferredView } from './view_navigation.js';import { agentInterfaceEnabled } from './agent_connect.js';import { attachReferencePicker, referenceItems, syncReferencePrompt, referenceInputs } from './prompt_references.js';@@ -619,13 +620,17 @@ const progressConnection = createProgressConnection(api, message => {window.dispatchEvent(new CustomEvent('freevideo-progress', {detail: message}));});+const desktopNoticeEnabled = () => (app.extensionManager?.setting?.get?.(DESKTOP_SETTING) ?? app.ui?.settings?.getSettingValue?.(DESKTOP_SETTING)) === true;+app.registerExtension({name: "FreeVideo.UnifiedMedia",+ settings: [{id: DESKTOP_SETTING, name: text('Desktop notification when done', '完成时发桌面通知'),+ type: 'boolean', defaultValue: false, onChange: value => { if (value) askDesktopPermission(); }}],beforeConfigureGraph() { configuringGraph = true; configuration++; },async setup() {// One failing part must not take the others down; health.js shows what failed.for (const [where, start] of [['progress', () => progressConnection.start()], ['navigation', () => installNavigation(showStudio, agentInterfaceEnabled(api))],- ['updates', startUpdateChecks]]) {+ ['updates', startUpdateChecks], ['done-notify', () => startDoneNotify({api, text, desktop: desktopNoticeEnabled})]]) {try { start(); } catch (error) { health({type: 'error', where, error}); }}window.addEventListener('pagehide', () => savePromptDraft(api, true));diff --git a/web/health.js b/web/health.jsindex 8e04ae5..f65766c 100644--- a/web/health.js+++ b/web/health.js@@ -15,7 +15,7 @@ const launchVisit = query.get('freevideo') === 'launch';// Every script this folder ships; a test keeps the list in step with web/*.js.export const MODULES = ['agent_activity.js', 'agent_connect.js', 'agent_session.js', 'autopilot.js', 'autopilot_chat.js', 'autopilot_conversations.js', 'browser_extension.js', 'chain_support.js', 'capability_view.js', 'compatibility.js', 'error_panel.js', 'first_run_guide.js', 'fonts.js', 'freevideo.js', 'generation_progress.js','editor.js', 'editor_actions.js', 'editor_adjust.js', 'editor_adjust_picture.js', 'editor_picture_fields.js', 'editor_picture_session.js', 'editor_preview_picture.js', 'editor_entry.js', 'editor_export_dialog.js', 'editor_first_frame.js', 'editor_media_references.js', 'editor_references.js', 'editor_genbar.js', 'editor_geometry.js', 'editor_library.js', 'editor_menu.js', 'editor_model.js', 'editor_frame.js', 'editor_player.js', 'editor_room.js', 'editor_select.js', 'editor_state.js', 'editor_store.js', 'editor_tracks.js', 'editor_generation.js', 'editor_transport.js', 'editor_transport_model.js', 'editor_audio.js', 'editor_audio_model.js', 'editor_audio_notes.js', 'editor_audio_replace.js', 'editor_audio_rules.js', 'editor_speed.js', 'editor_speed_model.js', 'editor_failure.js',- 'editor_loader.js', 'editor_text_coverage.js', 'editor_text.js', 'editor_text_model.js', 'editor_text_layout.js', 'editor_notes.js', 'editor_icons.js', 'dialog_keys.js', 'frame_sizes.js', 'health.js', 'image_commands.js', 'image_editor.js', 'image_editor_engine.js', 'image_generation.js', 'launcher.js', 'length_plan.js', 'lora_triggers.js', 'library.js', 'motion.js', 'output_download.js', 'port_notice.js', 'preview_scene.js',+ 'editor_loader.js', 'editor_text_coverage.js', 'editor_text.js', 'editor_text_model.js', 'editor_text_layout.js', 'editor_notes.js', 'editor_icons.js', 'dialog_keys.js', 'done_notify.js', 'frame_sizes.js', 'health.js', 'image_commands.js', 'image_editor.js', 'image_editor_engine.js', 'image_generation.js', 'launcher.js', 'length_plan.js', 'lora_triggers.js', 'library.js', 'motion.js', 'output_download.js', 'port_notice.js', 'preview_scene.js','progress_connection.js', 'prompt_draft.js', 'prompt_enhance.js', 'prompt_references.js', 'report_issue.js', 'studio_recent.js','result_actions.js', 'sampling_effort.js', 'setup.js', 'share.js', 'share_layout.js', 'studio.js', 'studio_chain.js', 'studio_extend.js', 'studio_length.js', 'first_frame_row.js', 'optional_inputs.js', 'studio_queue.js', 'studio_size.js','toolbar_position.js', 'updates.js', 'view_navigation.js', 'wordmark.js'];