Skip to content

Commit facd842

Browse files
authored
chore: retarget video and overlay to screencast api (microsoft#39915)
1 parent df5119e commit facd842

23 files changed

Lines changed: 412 additions & 575 deletions

File tree

docs/src/api/class-overlay.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/src/api/class-page.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,10 +2759,6 @@ The page's main frame. Page is guaranteed to have a main frame which persists du
27592759
* since: v1.8
27602760
- type: <[Mouse]>
27612761

2762-
## property: Page.overlay
2763-
* since: v1.59
2764-
- type: <[Overlay]>
2765-
27662762
## method: Page.onceDialog
27672763
* since: v1.10
27682764
* langs: java
@@ -4461,8 +4457,7 @@ Optional handler function to route the request.
44614457
* since: v1.8
44624458
- returns: <[Video]>
44634459

4464-
Video object associated with this page. Can be used to control video recording with [`method: Video.start`]
4465-
and [`method: Video.stop`], or to access the video file when using the `recordVideo` context option.
4460+
Video object associated with this page. Can be used to access the video file when using the `recordVideo` context option.
44664461

44674462
## method: Page.viewportSize
44684463
* since: v1.8

docs/src/api/class-screencast.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,88 @@ Defaults to 800×800.
4747
* langs: js
4848

4949
Stops the screencast started with [`method: Screencast.start`].
50+
51+
## async method: Screencast.startRecording
52+
* since: v1.59
53+
- returns: <[Disposable]>
54+
55+
Starts video recording. This method is mutually exclusive with the `recordVideo` context option.
56+
57+
### param: Screencast.startRecording.path
58+
* since: v1.59
59+
- `path` <[path]>
60+
61+
Path where the video should be saved when the recording is stopped.
62+
63+
### option: Screencast.startRecording.size
64+
* since: v1.59
65+
- `size` ?<[Object]>
66+
- `width` <[int]> Video frame width.
67+
- `height` <[int]> Video frame height.
68+
69+
Optional dimensions of the recorded video. If not specified the size will be equal to page viewport scaled down to fit into 800x800. Actual picture of the page will be scaled down if necessary to fit the specified size.
70+
71+
### option: Screencast.startRecording.annotate
72+
* since: v1.59
73+
- `annotate` ?<[Object]>
74+
- `duration` ?<[float]> How long each annotation is displayed in milliseconds. Defaults to `500`.
75+
- `position` ?<[AnnotatePosition]<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right">> Position of the action title overlay. Defaults to `"top-right"`.
76+
- `fontSize` ?<[int]> Font size of the action title in pixels. Defaults to `24`.
77+
78+
If specified, enables visual annotations on interacted elements during video recording. Interacted elements are highlighted with a semi-transparent blue box and click points are shown as red circles.
79+
80+
## async method: Screencast.stopRecording
81+
* since: v1.59
82+
83+
Stops video recording started with [`method: Screencast.startRecording`].
84+
85+
## async method: Screencast.showOverlay
86+
* since: v1.59
87+
- returns: <[Disposable]>
88+
89+
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.
90+
91+
### param: Screencast.showOverlay.html
92+
* since: v1.59
93+
- `html` <[string]>
94+
95+
HTML content for the overlay.
96+
97+
### option: Screencast.showOverlay.duration
98+
* since: v1.59
99+
- `duration` <[float]>
100+
101+
Duration in milliseconds after which the overlay is automatically removed. Overlay stays until dismissed if not provided.
102+
103+
## async method: Screencast.showChapter
104+
* since: v1.59
105+
106+
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.
107+
108+
### param: Screencast.showChapter.title
109+
* since: v1.59
110+
- `title` <[string]>
111+
112+
Title text displayed prominently in the overlay.
113+
114+
### option: Screencast.showChapter.description
115+
* since: v1.59
116+
- `description` <[string]>
117+
118+
Optional description text displayed below the title.
119+
120+
### option: Screencast.showChapter.duration
121+
* since: v1.59
122+
- `duration` <[float]>
123+
124+
Duration in milliseconds after which the overlay is automatically removed. Defaults to `2000`.
125+
126+
## async method: Screencast.showOverlays
127+
* since: v1.59
128+
129+
Shows overlays.
130+
131+
## async method: Screencast.hideOverlays
132+
* since: v1.59
133+
134+
Hides overlays without removing them.

docs/src/api/class-video.md

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,6 @@ print(page.video.path())
2323
Console.WriteLine(await page.Video.GetPathAsync());
2424
```
2525

26-
Alternatively, you can use [`method: Video.start`] and [`method: Video.stop`] to record video manually. This approach is mutually exclusive with the `recordVideo` option.
27-
28-
```js
29-
await page.video().start({ path: 'video.webm' });
30-
// ... perform actions ...
31-
await page.video().stop();
32-
```
33-
34-
```java
35-
page.video().start(new Video.StartOptions().setPath(Paths.get("video.webm")));
36-
// ... perform actions ...
37-
page.video().stop();
38-
```
39-
40-
```python async
41-
await page.video.start(path="video.webm")
42-
# ... perform actions ...
43-
await page.video.stop()
44-
```
45-
46-
```python sync
47-
page.video.start(path="video.webm")
48-
# ... perform actions ...
49-
page.video.stop()
50-
```
51-
52-
```csharp
53-
await page.Video.StartAsync(new() { Path = "video.webm" });
54-
// ... perform actions ...
55-
await page.Video.StopAsync();
56-
```
57-
5826
## async method: Video.delete
5927
* since: v1.11
6028

@@ -90,70 +58,3 @@ Saves the video to a user-specified path. If using the sync API, this must be ca
9058
- `path` <[path]>
9159

9260
Path where the video should be saved.
93-
94-
95-
## async method: Video.start
96-
* since: v1.59
97-
- returns: <[Disposable]>
98-
99-
Starts video recording. This method is mutually exclusive with the `recordVideo` context option.
100-
101-
**Usage**
102-
103-
```js
104-
await page.video().start({ path: 'video.webm' });
105-
// ... perform actions ...
106-
await page.video().stop();
107-
```
108-
109-
```java
110-
page.video().start(new Video.StartOptions().setPath(Paths.get("video.webm")));
111-
// ... perform actions ...
112-
page.video().stop();
113-
```
114-
115-
```python async
116-
await page.video.start(path="video.webm")
117-
# ... perform actions ...
118-
await page.video.stop()
119-
```
120-
121-
```python sync
122-
page.video.start(path="video.webm")
123-
# ... perform actions ...
124-
page.video.stop()
125-
```
126-
127-
```csharp
128-
await page.Video.StartAsync(new() { Path = "video.webm" });
129-
// ... perform actions ...
130-
await page.Video.StopAsync();
131-
```
132-
133-
### option: Video.start.path
134-
* since: v1.59
135-
- `path` <[path]>
136-
137-
Path where the video should be saved when the recording is stopped.
138-
139-
### option: Video.start.size
140-
* since: v1.59
141-
- `size` ?<[Object]>
142-
- `width` <[int]> Video frame width.
143-
- `height` <[int]> Video frame height.
144-
145-
Optional dimensions of the recorded video. If not specified the size will be equal to page viewport scaled down to fit into 800x800. Actual picture of the page will be scaled down if necessary to fit the specified size.
146-
147-
### option: Video.start.annotate
148-
* since: v1.59
149-
- `annotate` ?<[Object]>
150-
- `duration` ?<[float]> How long each annotation is displayed in milliseconds. Defaults to `500`.
151-
- `position` ?<[AnnotatePosition]<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right">> Position of the action title overlay. Defaults to `"top-right"`.
152-
- `fontSize` ?<[int]> Font size of the action title in pixels. Defaults to `24`.
153-
154-
If specified, enables visual annotations on interacted elements during video recording. Interacted elements are highlighted with a semi-transparent blue box and click points are shown as red circles.
155-
156-
## async method: Video.stop
157-
* since: v1.59
158-
159-
Stops video recording started with [`method: Video.start`].

0 commit comments

Comments
 (0)