(
self,
onFrame: ScreencastFrameCallback = None,
path: Union[str, Path] = None,
quality: int = None,
size: ScreencastSize = None,
)
| 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 |
nothing calls this directly
no test coverage detected