Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion playwright/_impl/_screencast.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Union

from playwright._impl._api_structures import ScreencastFrame
from playwright._impl._api_structures import ScreencastFrame, ViewportSize
from playwright._impl._artifact import Artifact
from playwright._impl._connection import from_nullable_channel
from playwright._impl._disposable import DisposableStub
Expand Down Expand Up @@ -70,6 +70,7 @@ async def start(
onFrame: ScreencastFrameCallback = None,
path: Union[str, Path] = None,
quality: int = None,
size: ViewportSize = None,
) -> DisposableStub:
if self._started:
raise Error("Screencast is already started")
Expand All @@ -80,6 +81,7 @@ async def start(
None,
{
"quality": quality,
"size": size,
"sendFrames": bool(onFrame),
"record": bool(path),
},
Expand Down
8 changes: 7 additions & 1 deletion playwright/async_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -7692,6 +7692,7 @@ async def start(
] = None,
path: typing.Optional[typing.Union[pathlib.Path, str]] = None,
quality: typing.Optional[int] = None,
size: typing.Optional[ViewportSize] = None,
) -> "AsyncContextManager":
"""Screencast.start

Expand All @@ -7708,6 +7709,8 @@ async def start(
Path where the video should be saved when the screencast is stopped. When provided, video recording is started.
quality : Union[int, None]
The quality of the image, between 0-100.
size : Union[{width: int, height: int}, None]
Output frame size.

Returns
-------
Expand All @@ -7716,7 +7719,10 @@ async def start(

return mapping.from_impl(
await self._impl_obj.start(
onFrame=self._wrap_handler(on_frame), path=path, quality=quality
onFrame=self._wrap_handler(on_frame),
path=path,
quality=quality,
size=size,
)
)

Expand Down
8 changes: 7 additions & 1 deletion playwright/sync_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -7768,6 +7768,7 @@ def start(
] = None,
path: typing.Optional[typing.Union[pathlib.Path, str]] = None,
quality: typing.Optional[int] = None,
size: typing.Optional[ViewportSize] = None,
) -> "SyncContextManager":
"""Screencast.start

Expand All @@ -7784,6 +7785,8 @@ def start(
Path where the video should be saved when the screencast is stopped. When provided, video recording is started.
quality : Union[int, None]
The quality of the image, between 0-100.
size : Union[{width: int, height: int}, None]
Output frame size.

Returns
-------
Expand All @@ -7793,7 +7796,10 @@ def start(
return mapping.from_impl(
self._sync(
self._impl_obj.start(
onFrame=self._wrap_handler(on_frame), path=path, quality=quality
onFrame=self._wrap_handler(on_frame),
path=path,
quality=quality,
size=size,
)
)
)
Expand Down