Browse Source

cherry-pick(#13689): fix(tracing): do not reset frame counter on every chunk

release-1.21
Pavel Feldman 2 months ago
parent
commit
11f51455f2
  1. 3
      packages/playwright-core/src/server/trace/recorder/tracing.ts

3
packages/playwright-core/src/server/trace/recorder/tracing.ts

@ -391,10 +391,9 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps
private _startScreencastInPage(page: Page) {
page.setScreencastOptions(kScreencastOptions);
const prefix = page.guid;
let frameSeq = 0;
this._screencastListeners.push(
eventsHelper.addEventListener(page, Page.Events.ScreencastFrame, params => {
const suffix = String(++frameSeq).padStart(10, '0');
const suffix = params.timestamp || Date.now();
const sha1 = `${prefix}-${suffix}.jpeg`;
const event: trace.ScreencastFrameTraceEvent = {
type: 'screencast-frame',

Loading…
Cancel
Save