view source

Record a Product Demo Video of a Web App

skill

Record a product demo video of a live web app from a script: visible cursor, chapter cards, zooms, MP4 plus a timeline. Also VHS terminal demos.

Apache-2.0 Requires: Node.js 18+ (the Playwright MCP server runs through npx), a Chrome or Chromium it can start, ffmpeg. Optional: vhs and ttyd for terminal demos. macOS/Linux.

agents that use this skill

instructions

Overview

This skill records a product demo of a live web app without a person at the screen. The agent walks the app in the browser, writes the flow as a short scenario file, and runs that file in the same browser with one tool call. The browser records itself: a visible cursor, optional chapter cards, zooms onto a detail, callouts, blurred personal data. The call returns the start time of every step, so voiceover and captions can be aligned to the video.

It replaces a hand recording of the screen, which cannot be repeated when the interface changes. It covers a live web interface and, with vhs, a terminal. It does not make motion graphics or fake interfaces (video-motion-graphics), and the video has no audio.

Mental model

The recorder is the browser the agent already drives. Its browser tools include one that runs a file of Playwright code against the open page, and Playwright's screencast API (page.screencast) writes the video. No second browser and no extra recorder program is involved.

Why the whole flow goes into one file and one call: between two tool calls the agent thinks for seconds, and a recording made call by call would show those seconds as a frozen screen. A scenario file runs at the app's own pace, and it runs again unchanged after the UI changes.

text
confirm app, demo account, seed data
  -> walk the flow with the browser tools, learn each locator
  -> scenario.js: one step per beat
  -> run it: WebM + step times
  -> look at frames -> convert to MP4 -> hand off

Rules

Method

  1. Confirm with the user: the app URL, a demo account (never a real customer's), seed data that looks believable, and what each beat must show. No real customer data on screen. Blur what cannot be removed.
  2. Walk the flow once with the browser tools: open the page, take a snapshot, then click and type. Note a role-and-name locator for each control (getByRole('button', { name: 'Add order' }), getByLabel, getByTestId); avoid long CSS chains.
  3. Write scenario.js (below): one step() per beat, a pause after each result so the viewer can read it, a zoom or a callout where the beat is about one detail.
  4. Run it: pass the scenario file path to the browser tool that runs Playwright code. The call returns { video, duration_s, steps }. Save that JSON as raw/demo.steps.json. On an error the call names the failing line: fix the scenario and run it again, and do not patch a bad take.
  5. Look. Extract frames at the step times (ffmpeg -ss 5.0 -i raw/demo.webm -frames:v 1 check-5.0.png) and open them: right page, right state, text readable, cursor visible, nothing private, no banner in the way. Re-record until they are right; a take costs seconds.
  6. Convert: ffmpeg -i raw/demo.webm -c:v libx264 -crf 18 -pix_fmt yuv420p -movflags +faststart raw/demo.mp4. ffprobe -v error -show_entries stream=codec_name,pix_fmt,width,height,r_frame_rate:format=duration raw/demo.mp4 should show h264, yuv420p, the size asked for, and a duration close to duration_s.
  7. Hand off the MP4 and demo.steps.json: video-explainers for cutaways inside an explainer, video-editing for trims and the mix, video-captions once the voiceover is final.

Stop and report, never bypass: a login the person has not done, a CAPTCHA, a payment, or a page that asks for a real person's data.

Scenario file

js
async (page) => {
  const out = 'video-out/<slug>/screen-cap/raw/demo.webm';
  const size = { width: 1920, height: 1080 };
  await page.setViewportSize(size);
  await page.goto('http://localhost:3000');
  await page.addStyleTag({ content: '#cookie-banner { display: none } .customer-email { filter: blur(8px) }' });
  await page.screencast.start({ path: out, size, fps: 30 });
  await page.screencast.showActions({ cursor: 'pointer', style: { title: 'display: none' } });
  const started = Date.now();
  const steps = [];
  const step = (name) => steps.push({ name, start_s: (Date.now() - started) / 1000 });

  try {
    step('Add an order');
    await page.getByLabel('Customer name').pressSequentially('Anna Smith', { delay: 80 });
    await page.getByRole('button', { name: 'Add order' }).click();
    await page.waitForTimeout(800);

    step('Read the chart');
    await page.locator('#chart').scrollIntoViewIfNeeded();
    await page.waitForTimeout(1500);
  } finally {
    await page.screencast.stop();
  }
  return { video: out, duration_s: (Date.now() - started) / 1000, steps };
}
  • The file is one async function that receives page. Paths are relative to the project folder. require and import are not available inside it.
  • Open the page and add the style tag before screencast.start, so the video starts on a loaded page with banners hidden and personal data blurred. A style tag lasts until the next page load: add it again after each navigation.
  • showActions with cursor: 'pointer' draws the moving cursor. The title style hides Playwright's action label, which would print the locator code on screen.
  • Type with pressSequentially(text, { delay: 80 }), never fill: a field that fills in one frame looks fake. The 80 ms is this skill's choice, not a measured standard.
  • A chapter card for a take that is delivered as it is: await page.screencast.showChapter('Add an order', { description: 'Fill the form and submit', duration: 2000 }). Leave cards out when the edit adds its own titles or captions, or they have to be cut out again.
  • screencast.stop() sits in finally, so a step that fails still closes the video and the next run starts clean.
  • To make the whole interface look larger, record at a smaller size such as 1280x720.
  • Keep one take under 100 seconds: the tool call that runs the file times out at 120. Record a longer demo as several takes.

Zoom and callouts

A flat full-page take makes the viewer search for the detail. Zoom onto it with a CSS transition on the page, which the recording captures as a smooth move. Add this helper after step:

js
  const zoom = async (target, scale = 1.8) => {
    const box = target ? await target.boundingBox() : null;
    await page.evaluate(({ box, scale }) => {
      const root = document.documentElement;
      const origin = (centre, visible) => Math.min(visible, Math.max(0, (scale * centre - visible / 2) / (scale - 1)));
      if (box) root.style.transformOrigin = `${origin(box.x + box.width / 2, innerWidth) + scrollX}px ${origin(box.y + box.height / 2, innerHeight) + scrollY}px`;
      root.style.transition = 'transform 600ms ease-in-out';
      root.style.transform = box ? `scale(${scale})` : 'none';
    }, { box, scale });
    await page.waitForTimeout(700);
  };
  • await zoom(page.locator('#chart')) zooms in, await zoom() zooms back out. The element is centred as far as the page edge allows, so the frame never shows empty space.
  • While zoomed, act only on the element that was zoomed onto. Zoom out before the next click elsewhere: Playwright cannot reach an element that is outside the zoomed frame.
  • On a page that is scrolled down, a fixed header or sidebar leaves the frame while the zoom is on and returns after zoom(). Zoom at the top of the page, or crop in the edit instead, when that would show.
  • A callout labels a result: const note = await page.screencast.showOverlay('<div style="position:absolute;top:16px;right:16px;padding:8px 14px;background:#111;color:#fff;border-radius:8px;font:600 20px system-ui">Up 42% this quarter</div>'); and later await note.dispose();. The overlay does not block clicks, and it is not scaled by the zoom.
  • One zoom or callout per beat at most. Every extra move makes the take slower to follow.

Sign-in

An app behind a login needs a session file, and only the person makes it. The agent never types credentials.

  1. Ask the person to run npx playwright open --save-storage=video-out/<slug>/screen-cap/session.json <url>, sign in in the window that opens, and close it. This is Playwright's own command; it saves the cookies and local storage to that file. If it reports a missing browser, add --channel chrome to use the installed Chrome.
  2. Start the scenario with await page.context().setStorageState('video-out/<slug>/screen-cap/session.json'); before page.goto. Run the same line once in the browser before walking the flow, so the browser tools see the signed-in app too.
  3. Keep the session file out of version control.

Pace

  • Earn the first seconds: Wistia advises a strong opening because a steep drop in the first 10 to 15 seconds is the warning sign. Start on the result or the problem, not a logo or a loading page.
  • Few steps. Vendors of click-through demos report where completion is best: Arcade 9 to 12 steps, Storylane 8 to 12, Guideflow 1 to 6. These are click-through demos, not video, so use them only as a guide to the number of beats.

Measured

With Playwright MCP 0.0.83 and headless Chromium, on a local page: the video is VP8 WebM at the size and frame rate asked for (1280x720 and 1920x1080 at 30 fps), and its length matches the script's own clock to within 0.2 seconds. Capture runs in real time, so a loaded machine gives choppy motion: close heavy apps and re-record instead of repairing a take.

Terminal demos

Check command -v vhs. If it is installed, write a .tape file and render it:

text
Output demo.mp4
Set FontSize 28
Set Width 1600
Set Height 900
Set Padding 24
Set WindowBar Colorful
Set Framerate 30
Type "npm test"
Sleep 500ms
Enter
Sleep 4s
Screenshot final.png

Run vhs demo.tape, then check the MP4 and the PNG as for a web demo. Hide and Show keep setup commands off screen. If vhs is not installed, say so and give the user the command to run: on macOS brew install vhs; elsewhere the VHS README lists the install steps (it needs ttyd and ffmpeg).

Output location

text
./video-out/<slug>/screen-cap/
  scenario.js
  session.json    only for an app behind a login; never committed
  raw/            demo.webm, demo.mp4, demo.steps.json

Examples

Bad: the user is asked to record the screen, and the take cannot be repeated.

text
Please record the dashboard for 30 seconds, hover over the chart, then click Export.

Good: the scenario file above, run with one call. It returns:

json
{ "video": "video-out/orders/screen-cap/raw/demo.webm", "duration_s": 4.39,
  "steps": [{ "name": "Add an order", "start_s": 0 }, { "name": "Read the chart", "start_s": 2.71 }] }

Checklist

  • App URL, demo account and seed data confirmed; no real customer data on screen.
  • The person made the session file; the agent typed no credentials.
  • Every locator found by walking the flow with the browser tools, not guessed.
  • The whole flow runs from one scenario file in one call.
  • Banners hidden and personal data blurred before recording starts, and again after each navigation.
  • Each zoom is onto the element being shown, and zoomed out before the next action elsewhere.
  • Frames at the step times opened and looked at: text readable, cursor visible, nothing private.
  • ffprobe shows h264, yuv420p, the right size and a duration matching duration_s.
  • MP4 and demo.steps.json saved under ./video-out/<slug>/screen-cap/raw/.
  • Blocked flow (login, CAPTCHA, payment) reported, not bypassed.

Composition / References