# webAssemblyDemo **Repository Path**: eric114/web-assembly-demo ## Basic Information - **Project Name**: webAssemblyDemo - **Description**: ffmpeg本地桌面版本webAssembly开发打包demo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-20 - **Last Updated**: 2026-03-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ffmpeg.wasm Electron App This is a minimal Electron app that runs ffmpeg.wasm in the renderer using the browser build. Run locally (development): ```bash npm install npm start ``` How it works: - A small static HTTP server is started inside the main process (`main.js`) and serves `index.html` and the `node_modules` browser builds. This ensures the FFmpeg browser core and worker are loaded same-origin and avoids Node worker / blob URL issues. - For production (packaged) builds this same approach is used (the app starts an internal local server on startup and loads from `http://127.0.0.1:/index.html`). Build (multi-platform): ```bash npm run build # Build for current platform npm run build -- --win # Windows only npm run build -- --mac # macOS only npm run build -- --linux # Linux only ``` Build targets: - `portable` - Single .exe file (Windows), .app (macOS), AppImage (Linux) - `nsis` - Windows installer - `dmg` - macOS disk image - `deb`, `rpm`, `AppImage` - Linux packages To enable single-file portable builds, update `package.json`: ```json "build": { "appId": "com.example.ffmpeg-wasm", "files": ["**/*"], "win": { "target": "portable" }, "portable": { "artifactName": "${productName}.exe" } } ``` Notes: - Cross-platform builds must be run on the target OS (e.g., build Windows .exe on Windows) - Packaging includes all project files by default due to the basic `files` pattern - For higher security consider using a custom protocol (`app://`) and disabling `nodeIntegration` (already disabled). You can also move heavy work into the main process via IPC.