Skip to content

[Feature]: Allow receiving screencast frame timestamps without JPEG data #42361

Description

@skyaara

Feature request

page.screencast.start() can save a WebM recording and provide frame callbacks:

await page.screencast.start({
  path: 'video.webm',
  onFrame: ({ data, timestamp, viewportWidth, viewportHeight }) => {
    // ...
  },
})

Some consumers need only the frame timing metadata, particularly the timestamp of the first presented frame. They do not need the JPEG data.

A general use case is synchronizing a recorded browser video with an external timeline, such as test events, telemetry, captions, narration, annotations, or recordings from several pages.

Currently, using onFrame for synchronization also delivers the JPEG buffer for every frame. Ignoring data prevents application-level storage and decoding, but the buffer still travels through the callback path.

Would you consider supporting a metadata-only callback or an option that omits frame data?

For example:

await page.screencast.start({
  path: 'video.webm',
  includeFrameData: false,
  onFrame: ({ timestamp, viewportWidth, viewportHeight }) => {
    // Align the recorded video with an external timeline.
  },
})

Another possible shape:

await page.screencast.start({
  path: 'video.webm',
  onFrameMetadata: ({ timestamp, viewportWidth, viewportHeight }) => {
    // ...
  },
})

A callback for the first recorded frame timestamp would also cover the simplest synchronization case.

I would be happy to work on an implementation if the maintainers think this API belongs in Playwright.

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions