PageSourceSearch

https://playwright.dev/assets/js/26aba930.ade6fcd3.js

js playwright.dev collected 2026-09-24 06:53:34 UTC 25,367 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkplaywright_dev=self.webpackChunkplaywright_dev||[]).push([["1190"],{47238(e,s,n){n.r(s),n.d(s,{metadata:()=>r,default:()=>h,frontMatter:()=>a,contentTitle:()=>c,toc:()=>o,assets:()=>l});var r=JSON.parse('{"id":"api/class-screencast","title":"Screencast","description":"Interface for capturing screencast frames from a page.","source":"@site/versioned_docs/version-stable/api/class-screencast.mdx","sourceDirName":"api","slug":"/api/class-screencast","permalink":"/docs/api/class-screencast","draft":false,"unlisted":false,"tags":[],"version":"stable","frontMatter":{"id":"class-screencast","title":"Screencast"},"sidebar":"api","previous":{"title":"Route","permalink":"/docs/api/class-route"},"next":{"title":"Selectors","permalink":"/docs/api/class-selectors"}}'),t=n(74848),i=n(28453);n(13554),n(41647),n(83137);let a={id:"class-screencast",title:"Screencast"},c,l={},o=[{value:"Methods",id:"methods",level:2},{value:"hideActions",id:"screencast-hide-actions",level:3},{value:"hideOverlays",id:"screencast-hide-overlays",level:3},{value:"showActions",id:"screencast-show-actions",level:3},{value:"showChapter",id:"screencast-show-chapter",level:3},{value:"showOverlay",id:"screencast-show-overlay",level:3},{value:"showOverlays",id:"screencast-show-overlays",level:3},{value:"start",id:"screencast-start",level:3},{value:"stop",id:"screencast-stop",level:3}];function d(e){let s={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"Interface for capturing screencast frames from a page."}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,t.jsx)(s.h3,{id:"screencast-hide-actions",children:"hideActions"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.hideActions"}),"\n",(0,t.jsx)(s.p,{children:"Removes action decorations."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"await screencast.hideActions();\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-hide-actions-return"}),(0,t.jsx)("a",{href:"#screencast-hide-actions-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h3,{id:"screencast-hide-overlays",children:"hideOverlays"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.hideOverlays"}),"\n",(0,t.jsx)(s.p,{children:"Hides overlays without removing them."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"await screencast.hideOverlays();\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-hide-overlays-return"}),(0,t.jsx)("a",{href:"#screencast-hide-overlays-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h3,{id:"screencast-show-actions",children:"showActions"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.showActions"}),"\n",(0,t.jsx)(s.p,{children:"Enables visual annotations on interacted elements. Returns a disposable that stops showing actions when disposed."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"await screencast.showActions();\nawait screencast.showActions(options);\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Arguments"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"options"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"cursor"}),' "none" | "pointer" ',(0,t.jsx)(s.em,{children:"(optional)"})," ",(0,t.jsx)("font",{size:"2",children:"Added in: v1.61"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-actions-option-cursor"}),(0,t.jsx)("a",{href:"#screencast-show-actions-option-cursor",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsxs)(s.p,{children:["Cursor decoration shown for pointer actions. ",(0,t.jsx)(s.code,{children:'"pointer"'})," (the default) renders a mouse pointer that animates from the previous action point to the next one. ",(0,t.jsx)(s.code,{children:'"none"'})," disables the cursor decoration."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"duration"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-actions-option-duration"}),(0,t.jsx)("a",{href:"#screencast-show-actions-option-duration",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsxs)(s.p,{children:["How long each annotation is displayed in milliseconds. Defaults to ",(0,t.jsx)(s.code,{children:"500"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"fontSize"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-actions-option-font-size"}),(0,t.jsx)("a",{href:"#screencast-show-actions-option-font-size",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsxs)(s.p,{children:["Font size of the action title in pixels. Defaults to ",(0,t.jsx)(s.code,{children:"24"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"position"}),' "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" ',(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-actions-option-position"}),(0,t.jsx)("a",{href:"#screencast-show-actions-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsxs)(s.p,{children:["Position of the action title overlay. Defaults to ",(0,t.jsx)(s.code,{children:'"top-right"'}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"/docs/api/class-disposable",title:"Disposable",children:"Disposable"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-actions-return"}),(0,t.jsx)("a",{href:"#screencast-show-actions-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h3,{id:"screencast-show-chapter",children:"showChapter"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.showChapter"}),"\n",(0,t.jsx)(s.p,{children:"Shows a chapter overlay with a title and optional description, centered on the page with a blurred backdrop. Useful for narrating video recordings. The overlay is removed after the specified duration, or 2000ms."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"await screencast.showChapter(title);\nawait screencast.showChapter(title, options);\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Arguments"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"title"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-chapter-option-title"}),(0,t.jsx)("a",{href:"#screencast-show-chapter-option-title",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsx)(s.p,{children:"Title text displayed prominently in the overlay."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"options"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,t.jsx)(s.em,{children:"(optional)"})]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"description"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-chapter-option-description"}),(0,t.jsx)("a",{href:"#screencast-show-chapter-option-description",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsx)(s.p,{children:"Optional description text displayed below the title."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"duration"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-chapter-option-duration"}),(0,t.jsx)("a",{href:"#screencast-show-chapter-option-duration",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsxs)(s.p,{children:["Duration in milliseconds after which the overlay is automatically removed. Defaults to ",(0,t.jsx)(s.code,{children:"2000"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-chapter-return"}),(0,t.jsx)("a",{href:"#screencast-show-chapter-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h3,{id:"screencast-show-overlay",children:"showOverlay"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.showOverlay"}),"\n",(0,t.jsx)(s.p,{children:"Adds an overlay with the given HTML content. The overlay is displayed on top of the page until removed. Returns a disposable that removes the overlay when disposed."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"await screencast.showOverlay(html);\nawait screencast.showOverlay(html, options);\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Arguments"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"html"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-overlay-option-html"}),(0,t.jsx)("a",{href:"#screencast-show-overlay-option-html",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsx)(s.p,{children:"HTML content for the overlay."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"options"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,t.jsx)(s.em,{children:"(optional)"})]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"duration"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-overlay-option-duration"}),(0,t.jsx)("a",{href:"#screencast-show-overlay-option-duration",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsx)(s.p,{children:"Duration in milliseconds after which the overlay is automatically removed. Overlay stays until dismissed if not provided."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"/docs/api/class-disposable",title:"Disposable",children:"Disposable"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-overlay-return"}),(0,t.jsx)("a",{href:"#screencast-show-overlay-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h3,{id:"screencast-show-overlays",children:"showOverlays"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.showOverlays"}),"\n",(0,t.jsx)(s.p,{children:"Shows overlays."}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"await screencast.showOverlays();\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-show-overlays-return"}),(0,t.jsx)("a",{href:"#screencast-show-overlays-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h3,{id:"screencast-start",children:"start"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-
120px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.start"}),"\n",(0,t.jsxs)(s.p,{children:["Starts the screencast. When ",(0,t.jsx)(s.a,{href:"/docs/api/class-screencast#screencast-start-option-path",children:"path"})," is provided, it saves video recording to the specified file. When ",(0,t.jsx)(s.a,{href:"/docs/api/class-screencast#screencast-start-option-on-frame",children:"onFrame"})," is provided, delivers JPEG-encoded frames to the callback. Both can be used together."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"// Record video\nawait page.screencast.start({ path: 'video.webm', size: { width: 1280, height: 800 } });\n// ... perform actions ...\nawait page.screencast.stop();\n"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"// Capture frames\nawait page.screencast.start({\n  onFrame: ({ data, timestamp, viewportWidth, viewportHeight }) => {\n    console.log(`frame size: ${data.length} (${viewportWidth}x${viewportHeight}) at ${timestamp}`);\n  },\n  size: { width: 800, height: 600 },\n});\n// ... perform actions ...\nawait page.screencast.stop();\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Arguments"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"options"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"onFrame"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"}),"(",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"}),"):",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-start-option-on-frame"}),(0,t.jsx)("a",{href:"#screencast-start-option-on-frame",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"data"})," ",(0,t.jsx)(s.a,{href:"https://nodejs.org/api/buffer.html#buffer_class_buffer",title:"Buffer",children:"Buffer"})]}),"\n",(0,t.jsx)(s.p,{children:"JPEG-encoded frame data."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"timestamp"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n",(0,t.jsx)(s.p,{children:"The timestamp of when the frame was presented by the browser, in milliseconds since the Unix epoch."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"viewportWidth"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n",(0,t.jsx)(s.p,{children:"Width of the page viewport at the time the frame was captured."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"viewportHeight"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n",(0,t.jsx)(s.p,{children:"Height of the page viewport at the time the frame was captured."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"Callback that receives JPEG-encoded frame data along with the page viewport size at the time of capture."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"path"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-start-option-path"}),(0,t.jsx)("a",{href:"#screencast-start-option-path",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsx)(s.p,{children:"Path where the video should be saved when the screencast is stopped. When provided, video recording is started."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"quality"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-start-option-quality"}),(0,t.jsx)("a",{href:"#screencast-start-option-quality",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsx)(s.p,{children:"The quality of the image, between 0-100."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"size"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,t.jsx)(s.em,{children:"(optional)"}),(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-start-option-size"}),(0,t.jsx)("a",{href:"#screencast-start-option-size",class:"list-anchor",children:"#"})]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"width"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n",(0,t.jsx)(s.p,{children:"Max frame width in pixels."}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.code,{children:"height"})," ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n",(0,t.jsx)(s.p,{children:"Max frame height in pixels."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"Specifies the dimensions of screencast frames. The actual frame is scaled to preserve the page's aspect ratio and may be smaller than these bounds. If a screencast is already active (e.g. started by tracing or video recording), the existing configuration takes precedence and the frame size may exceed these bounds or this option may be ignored. If not specified the size will be equal to page viewport scaled down to fit into 800\xd7800."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"/docs/api/class-disposable",title:"Disposable",children:"Disposable"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-start-return"}),(0,t.jsx)("a",{href:"#screencast-start-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,t.jsx)(s.hr,{}),"\n",(0,t.jsx)(s.h3,{id:"screencast-stop",children:"stop"}),"\n",(0,t.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.59"}),"\n",(0,t.jsx)("x-search",{children:"screencast.stop"}),"\n",(0,t.jsxs)(s.p,{children:["Stops the screencast and video recording if active. If a video was being recorded, saves it to the path specified in ",(0,t.jsx)(s.a,{href:"/docs/api/class-screencast#screencast-start",children:"screencast.start()"}),"."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Usage"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"await screencast.stop();\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Returns"})}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,t.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"screencast-stop-return"}),(0,t.jsx)("a",{href:"#screencast-stop-return",class:"list-anchor",children:"#"})]}),"\n"]})]})}function h(e={}){let{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.