Antigravity Media Player
by chumdesign
README.md
<p align="center">
<img src="assets/logo.svg" width="76" height="76" alt="Antigravity Media Player Logo" />
</p>
<h1 align="center">Antigravity Media Player</h1>
<p align="center">
<strong>Zero-limit local HTTP 206 streaming media player plugin (MCP App) for Google Antigravity IDE.</strong><br/>
Preview multi-gigabyte 4K MP4 renders, 24-bit WAV masters, and ProRes / QuickTime RLE alpha <code>.mov</code> overlays directly inside Antigravity — without hitting the built-in 20 MB file viewer cap.
</p>
<p align="center">
<a href="README.md"><strong>English</strong></a> · <a href="README.ru.md">Русский</a>
</p>
<p align="center">
<img src="https://img.shields.io/badge/Google_Antigravity-MCP_App_Plugin-f59e0b?style=flat-square" alt="Antigravity MCP App" />
<img src="https://img.shields.io/badge/Streaming-HTTP_206_Byte--Range-10b981?style=flat-square" alt="HTTP 206 Byte-Range" />
<img src="https://img.shields.io/badge/Node.js-20%2B-339933?style=flat-square" alt="Node 20+" />
<img src="https://img.shields.io/badge/License-MIT-64748b?style=flat-square" alt="MIT License" />
</p>
---
<p align="center">
<img src="docs/preview-dark.png" alt="Antigravity Media Player — Dark Studio Theme" width="100%" />
</p>
<details>
<summary>Preview in Light Theme (auto-syncs with Antigravity host theme)</summary>
<br/>
<img src="docs/preview-light.png" alt="Antigravity Media Player — Light Studio Theme" width="100%" />
</details>
---
## Why This Exists
If you use **Google Antigravity** for video editing, FFmpeg pipelines, DaVinci Resolve automation, or audio mastering, you quickly hit the built-in `file:///` viewer's **20 MB file size limit** — plus browsers can't natively decode studio alpha codecs (`qtrle`, `ProRes 4444`, `DNxHD`).
**Antigravity Media Player** registers a native **MCP App** plugin (`open_media_player`) backed by a zero-copy loopback HTTP `206 Partial Content` streaming server (`127.0.0.1:47821`). Even a 10 GB 4K file opens instantaneously and scrubs smoothly with zero memory bloat.
## Features
- **Zero Size Limit (HTTP 206 Byte-Range):** Streams `MP4`, `M4V`, `WebM`, `WAV`, `MP3`, `M4A`, `FLAC`, `OGG`, `AAC`, `OPUS` directly from disk in 4 MB chunks with instant seeking.
- **Studio Codec & Alpha Channel Support:** Automatically detects `qtrle` (QuickTime Animation), `ProRes`, `DNxHD`, `FFV1`, `MKV`, `MXF`, or unsupported 10-bit codecs and serves a fast FFmpeg H.264 preview (cached for ≤ 2 min clips, live fragmented MP4 for longer files) with **4 selectable Alpha backdrops** (`Dark`, `Checker`, `Warm`, `Light`).
- **A/B Sync Comparison:** Toggle **A/B** and press keys `1`–`9` to switch between multiple renders, color grades, or audio masters while **preserving the exact playback timestamp**.
- **Frame-Accurate Review:** Step `±1 frame` (`, ` / `. `) using the clip's exact `ffprobe` frame rate (`23.976`, `24`, `25`, `30`, `60 fps`), seek `±5s`, adjust playback speed (`0.25×`–`2×`), loop, and hover-scrub with floating `MM:SS.ff` timecode preview.
- **Fullscreen + Theater Mode:** Uses native browser Fullscreen API and gracefully falls back to 100% viewport Theater Mode inside restricted IDE webviews (`F` or double-click).
- **Precision Studio UI:** Single-file bundled UI (`OKLCH` palette, pixel-aligned `32px` SVG icons, dark & light Antigravity theme sync, responsive down to narrow IDE side-panes, keyboard accessible, `prefers-reduced-motion` aware).
- **Works Both Inside Antigravity & Standalone Browser:** Open from agent chat / side pane via MCP, or visit `http://127.0.0.1:47821/?open=/path/to/video.mp4` directly in any browser tab.
---
## Quick Install (Google Antigravity)
### Prerequisites
- **Node.js 20+** (recommended: Node 22+)
- **FFmpeg & FFprobe** on `PATH` *(optional — only needed for metadata probe and studio codec / alpha `.mov` transcoding; direct MP4/WAV streaming works even without FFmpeg)*
### 1. Clone into Antigravity's global plugins folder
**Windows (PowerShell):**
```powershell
git clone https://github.com/chumdesign/antigravity-media-player.git "$env:USERPROFILE\.gemini\config\plugins\media-player"
cd "$env:USERPROFILE\.gemini\config\plugins\media-player"
npm install
```
**macOS / Linux:**
```bash
git clone https://github.com/chumdesign/antigravity-media-player.git ~/.gemini/config/plugins/media-player
cd ~/.gemini/config/plugins/media-player
npm install
```
> `npm install` automatically runs `npm run build:ui` via `postinstall` to bundle `dist/app.html`.
### 2. Enable the plugin in Antigravity
1. Open **Antigravity → Plugins Manager** (or restart Antigravity so it discovers the new plugin).
2. Enable **Media Player**.
3. Ask the agent anything like:
- *"Open the rendered 4K video in Media Player"*
- *"Load all videos from `./renders` into Media Player so I can compare them"*
- Or open `http://127.0.0.1:47821/` directly in your browser once the MCP server is running.
---
## Keyboard Shortcuts
| Key | Action |
| --- | --- |
| `Space` | Play / Pause |
| `←` / `→` | Seek `-5s` / `+5s` |
| `,` / `.` | Step `-1 frame` / `+1 frame` (pauses video) |
| `M` | Mute / Unmute |
| `L` | Toggle Loop |
| `F` / Double-click | Fullscreen / Theater Mode |
| `1`–`9` | Switch playlist file (preserves timestamp when **A/B** is active) |
| `?` | Toggle keyboard shortcuts popover |
| `Esc` | Close popover / exit Theater Mode |
---
## Architecture
```mermaid
flowchart LR
IDE["Antigravity IDE / Chat / Side Pane"] <-->|"MCP stdio (open_media_player)"| MCP["server.mjs (Node.js)"]
MCP -->|"Serves single-file dist/app.html"| UI["Studio Monitor UI (ui-src/app.ts)"]
UI <-->|"HTTP 206 Byte-Range (127.0.0.1:47821)"| HTTP["Embedded Loopback Server"]
HTTP -->|"Direct 4MB range chunks"| DISK["Local 4K MP4 / WAV / FLAC"]
HTTP -->|"On-demand H.264 / Alpha composite"| FF["FFmpeg / FFprobe"]
```
- **Local-only security:** Binds strictly to `127.0.0.1` (default port `47821`, configurable via `AGY_MEDIA_PLAYER_PORT`, auto-falls back to an ephemeral port if busy).
- **MCP App CSP-safe:** Single-file `dist/app.html` (`esbuild` bundle) with zero external CDN dependencies and explicit `resourceDomains` / `connectDomains` bound to `sessionState.streamOrigin`.
---
## Development
```bash
# Edit UI logic in ui-src/app.ts or markup/styles in build-ui.mjs
npm run build:ui
```
Because `server.mjs` reads `dist/app.html` dynamically from disk on every request, rebuilding the UI updates `http://127.0.0.1:47821/` immediately on browser refresh (`F5`) — no MCP server restart needed.
## Ideas & Contributions Welcome!
PRs, issues, and ideas are very welcome! Some fun next milestones to build together:
- [ ] **Interactive A/B Wipe Curtain:** Drag a vertical divider right across the video frame to compare two color grades / upscales simultaneously.
- [ ] **Audio Waveform & Loudness Meter:** Real-time Web Audio API waveform + LUFS peak readout for WAV/MP3 review.
- [ ] **In / Out Timeline Markers:** Mark `I` / `O` points and copy an FFmpeg lossless trim command or export a frame PNG (`S`).
- [ ] **Drag & Drop Files:** Drop local folders or clips directly onto the player window.
## License
[MIT](LICENSE) © 2026 ChumDesign
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues