Skip to content

feat(cli): add media commands for audio/video playback control#880

Open
mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
mvanhorn:osc/feat-media-commands
Open

feat(cli): add media commands for audio/video playback control#880
mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
mvanhorn:osc/feat-media-commands

Conversation

@mvanhorn
Copy link
Contributor

@mvanhorn mvanhorn commented Mar 17, 2026

Summary

Add media commands to detect and control audio/video playback state on the page.

  • agent-browser media status - list all media elements with playing/paused state, currentTime, duration
  • agent-browser media pause - pause all playing media
  • agent-browser media play - resume all paused media

Closes #644

Evidence

Signal Source
Issue #644 "Feature request: add audio/sound support for media playback verification" - 11 reactions, maintainer said "we'll definitely consider this"
No prior PR First focused implementation
YouTube "Agent Browser: The CLI That Gives AI Agents Eyes on the Web" - media testing noted as gap
Issue #66 Video recording support request

Implementation

Uses Runtime.evaluate with JavaScript that queries all <audio> and <video> elements. For status, reads paused, currentTime, duration, volume, muted, loop, and src. For play/pause, calls the native .play() / .pause() methods.

Files changed

  • cli/src/commands.rs - media command parser with status/pause/play subcommands
  • cli/src/native/actions.rs - three CDP handlers using Runtime.evaluate
  • cli/src/output.rs - human-readable output for media status and play/pause results

Test plan

  • cargo fmt passes
  • cargo clippy passes
  • cargo test passes (477 tests, 0 failures)
  • Manual: agent-browser media status on page with video
  • Manual: agent-browser media pause pauses playback
  • Manual: agent-browser media play resumes playback

This contribution was developed with AI assistance (Claude Code).

Add `media status`, `media pause`, and `media play` commands to detect
and control audio/video elements on the page. Uses Runtime.evaluate to
query all <audio> and <video> elements for playback state.

Closes vercel-labs#644

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

@mvanhorn is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: add audio/sound support for media playback verification

1 participant