MCPcopy Index your code
hub / github.com/microsoft/playwright-python / start

Method start

playwright/_impl/_screencast.py:73–98  ·  view source on GitHub ↗
(
        self,
        onFrame: ScreencastFrameCallback = None,
        path: Union[str, Path] = None,
        quality: int = None,
        size: ScreencastSize = None,
    )

Source from the content-addressed store, hash-verified

71 self._page._loop.create_task(result)
72
73 async def start(
74 self,
75 onFrame: ScreencastFrameCallback = None,
76 path: Union[str, Path] = None,
77 quality: int = None,
78 size: ScreencastSize = None,
79 ) -> DisposableStub:
80 if self._started:
81 raise Error("Screencast is already started")
82 self._started = True
83 self._on_frame = onFrame
84 result = await self._page._channel.send_return_as_dict(
85 "screencastStart",
86 None,
87 {
88 "size": size,
89 "quality": quality,
90 "sendFrames": bool(onFrame),
91 "record": bool(path),
92 },
93 )
94 artifact_channel = (result or {}).get("artifact")
95 if artifact_channel:
96 self._artifact = from_nullable_channel(artifact_channel)
97 self._save_path = path
98 return DisposableStub(lambda: self.stop(), self._page)
99
100 async def stop(self) -> None:
101 self._started = False

Callers

nothing calls this directly

Calls 6

stopMethod · 0.95
ErrorClass · 0.90
from_nullable_channelFunction · 0.90
DisposableStubClass · 0.90
send_return_as_dictMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected