{"record":{"id":"3007c1845e23a6d9","repo":"microsoft/playwright","slug":"screencast-is-already-started","errorCode":null,"errorMessage":"Screencast is already started","messagePattern":"Screencast is already started","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/screencast.ts","lineNumber":44,"sourceCode":"  private _started = false;\n  private _savePath: string | undefined;\n  private _onFrame: ((frame: { data: Buffer, timestamp: number, viewportWidth: number, viewportHeight: number }) => Promise<any>) | null = null;\n  private _artifact: Artifact | undefined;\n\n  constructor(page: Page) {\n    this._page = page;\n    this._page._channel.on('screencastFrame', async ({ frameId, data, timestamp, viewportWidth, viewportHeight }) => {\n      try {\n        await this._onFrame?.({ data, timestamp, viewportWidth, viewportHeight });\n      } finally {\n        await this._page._channel.screencastFrameAck({ frameId }, kNoTimeout).catch(() => {});\n      }\n    });\n  }\n\n  async start(options: { onFrame?: (frame: { data: Buffer, timestamp: number, viewportWidth: number, viewportHeight: number }) => Promise<any>|any, path?: string, size?: { width: number, height: number }, quality?: number } = {}): Promise<DisposableStub> {\n    if (this._started)\n      throw new Error('Screencast is already started');\n    this._started = true;\n    if (options.onFrame)\n      this._onFrame = options.onFrame;\n    const result = await this._page._channel.screencastStart({\n      size: options.size,\n      quality: options.quality,\n      sendFrames: !!options.onFrame,\n      record: !!options.path,\n    }, kNoTimeout);\n    if (result.artifact) {\n      this._artifact = Artifact.from(result.artifact);\n      this._savePath = options.path;\n    }\n    return new DisposableStub(() => this.stop());\n  }\n\n  async stop(): Promise<void> {\n    await this._page._wrapApiCall(async () => {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/screencast.ts#L26-L62","documentation":"Error \"Screencast is already started\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/client/screencast.ts:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}