Repository navigation
fix(browser-actions): stop padding video recorded above the viewport size - #2555
Merged
Merged
Conversation
…f padding a scaled frame (#2552)
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.
Fixes #2552.
Playwright's recorder captures at CSS-viewport pixels and pads any larger
recordVideo.sizewith gray. #2549 defaulted the size to viewport ×device-scale-factor, soviewport=432x768 device-scale-factor=2.5produced a 1080x1920 WebM with the page in the top-left 432x768 corner. The summary also claimed a resolution the content didn't have.This takes the issue's second option:
video-sizeis still honored, capped at 8,294,400 px. The README now says the recorder can only scale down, and that a higher-resolution output should be upscaled by an encoder afterwards.video.width/heightin the summary match the real content.(Capturing true device-pixel frames via CDP
Page.startScreencastis the other option in the issue and would be a separate, larger change.)Tests
npm run buildclean.test:browser-video-capture4/4, including a rewritten high-DPR test that records a full-bleed blue page at430x932 @2.5and asserts:430x932The pixel is read with
ffmpeg(PATH,FFMPEG_PATH, or Playwright's bundled ffmpeg), and the check is skipped with a diagnostic if none is available. The cook's original version decoded the WebM inside headless Chromium from adata:URL, butloadeddatanever fires there, so the test hung indefinitely.Also passing: presentation 2/2 + 1/1, annotations 2/2,
browser-preview-routing16/16.Process note
Drafted by a Homeboy cook (
cook-detached-764926ec). Its candidate didn't compile: three call sites still passed the removed scale argument, and the new test hung. With Chris's authorization it was corrected and re-verified by Extra Chill Bot and published outside Homeboy.AI-assisted: drafted by an OpenCode agent, corrected and finalized by Extra Chill Bot.