feat(cli): add media commands for audio/video playback control#880
Open
mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
Open
feat(cli): add media commands for audio/video playback control#880mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
mvanhorn wants to merge 1 commit intovercel-labs:mainfrom
Conversation
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>
Contributor
|
@mvanhorn is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
mediacommands to detect and control audio/video playback state on the page.agent-browser media status- list all media elements with playing/paused state, currentTime, durationagent-browser media pause- pause all playing mediaagent-browser media play- resume all paused mediaCloses #644
Evidence
Implementation
Uses
Runtime.evaluatewith JavaScript that queries all<audio>and<video>elements. For status, readspaused,currentTime,duration,volume,muted,loop, andsrc. For play/pause, calls the native.play()/.pause()methods.Files changed
cli/src/commands.rs-mediacommand parser withstatus/pause/playsubcommandscli/src/native/actions.rs- three CDP handlers using Runtime.evaluatecli/src/output.rs- human-readable output for media status and play/pause resultsTest plan
cargo fmtpassescargo clippypassescargo testpasses (477 tests, 0 failures)agent-browser media statuson page with videoagent-browser media pausepauses playbackagent-browser media playresumes playbackThis contribution was developed with AI assistance (Claude Code).