Adom Video Player

Install?

adom-video is the standard way for an AI to show a user a video or audio file in Hydrogen (or pup). It runs one small zero-dependency Node server per container that serves only the files you register, with full HTTP Range support (206 Partial Content, If-Range, HEAD, ETag, no-cache), which is what a browser needs to seek. A quick python -m http.server does not do this, so videos shown that way cannot be scrubbed. The player page is the wiki's ::adom-video widget (YouTube's look and every YouTube shortcut, a scrub timeline with frame preview and chapter segments, captions it draws itself, hold for 2x, frame stepping at the measured rate, speeds to 4x), plus a chapter list, a library of everything shown in the container, per-file resume, and auto-reload with position kept when the file changes on disk. It follows the Adom app conventions: --ai-thread on every verb, one registry entry, reuse instead of respawn, a 24 hour idle reaper.

adom-wiki pkg install adom/adom-video-player

Latest: v0.4.7, published

Contents

README

markdown

Adom Video Player

When an AI shows you a video, you should be able to jump around in it. adom-video is the standard way for any AI in an Adom workspace to show a video or audio file: one command opens it in a Hydrogen webview tab with a real player whose timeline seeks.

adom-video --ai-thread "<conversation name>" play render.mp4 --title "Draft 2"
The Adom video player in a Hydrogen webview tab: a seekable timeline with chapter marks, frame step and speed controls, and a chapter list

Why it exists

AIs used to show videos by starting a quick python -m http.server. That server ignores the HTTP Range header, so the browser can only play the file from the start: the timeline does nothing, and a copy cached from that server stays unseekable even after a fix. adom-video runs one small server per container that answers 206 Partial Content, honors If-Range and HEAD, and sends an ETag with no-cache, so seeking always works and a re-rendered file never plays stale.

The player

The same player as the wiki's ::adom-video widget (adom/widgets): YouTube's look, YouTube's shortcuts, and one code path, so a video behaves the same in Hydrogen as on a wiki page.

Timeline A wide grab zone around a thin bar: click or drag to scrub, hover for a frame preview, the time and the chapter name
Chapters --chapters ch.json ([{"t": 12.5, "title": "Grind"}]) or a WebVTT file: bar segments, the current chapter beside the time (click it for the next), and a chapter list beside the player
Captions --captions subs.vtt (or .srt), drawn by the player: C toggles, + / - resize, O / W text and background opacity
Speed 0.25x to 4x in the settings menu or with < >; press and hold the video for 2x
Frame step , . at the measured frame rate, with a pill showing frame N of total and the exact time
Keyboard YouTube's shortcuts: Space or K, J / L, arrows, ↑ ↓ volume, M, 0 to 9, Home / End, Ctrl+arrows chapters, F or double-click fullscreen, I picture-in-picture, R loop, Shift+N / Shift+P through the library, media keys, ? for the list
Auto-reload Re-render the file at the same path and the player reloads it, keeping your place and speed
Resume Each file reopens where you left it
Library Every file shown in this container, one click away

Hover the keyboard button in the header for the full list, or press ? for it on the video; every button names its key in a tooltip.

Commands

Every reply starts with OK: or ERROR:, and every error carries a Hint: with the exact next command. Add --json for the raw payload.

Command What it does
adom-video --ai-thread X play <file> [--title] [--chapters] [--captions] [--fps] [--name] [--surface wv|hbw|pup|nb] [--no-open] Register a file and show it
adom-video --ai-thread X url <file> Register and print the player URL
adom-video --ai-thread X show Open the library page
adom-video --ai-thread X ui toast|seek|play|pause|speed|captions|click|reveal|cursor|reload ... Drive the open player over its live channel
adom-video ls / health The server, its version, open pages and the library
adom-video settings [key=value] The same settings as the Settings window, validated
adom-video --ai-thread X stop --reason "..." [--confirm] Stop the shared server (reason-gated; asks for confirmation while others use it)
adom-video install Update to the latest version from the wiki

Built to the Adom app standard

  • One header: the 44px Adom header. Hover the name for the version, server and wiki link.
  • Explained controls: every control has a tooltip that names its key. Tooltips stay on screen and never cover what you hover.
  • Settings: a Settings window (the cog) with autoplay, resume, default speed, where videos open, background pup windows, idle shutdown and developer mode. Settings live on the server and the AI changes them with adom-video settings.
  • Server-side state: the library, positions and settings live on the server, never in browser storage.
  • AI-drivable: an SSE live channel keeps the page, the CLI and the AI in step. The AI can raise toasts, seek, and click with a visible cursor. It reads the page's console at GET /console and the full state at GET /state.

How it behaves

  • Tabs: opens in a Hydrogen work pane, never over VS Code. It reuses its tab by name and removes duplicates.
  • Security: binds 127.0.0.1 on an automatic port and serves only files that were registered.
  • Surfaces: a Hydrogen webview tab by default; also a Hydrogen browser window, a pup window (in the background) or your own browser.
  • Lifetime:
    • One server per container, restarted automatically when the package updates.
    • Exits after 24 hours idle.
    • Hydrogen can restart it after a wake.
  • Dependencies: none beyond Node.

Install

adom-wiki pkg install adom/adom-video-player

It ships the adom-video-player skill, so an AI that is about to show a video finds it by itself.