-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
564 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
sidebar_label: Page.screencast | ||
--- | ||
|
||
# Page.screencast() method | ||
|
||
Captures a screencast of this [page](./puppeteer.page.md). | ||
|
||
#### Signature: | ||
|
||
```typescript | ||
class Page { | ||
screencast(options?: Readonly<ScreencastOptions>): Promise<ScreenRecorder>; | ||
} | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --------- | --------------------------------------------------------------------- | -------------------------------------------- | | ||
| options | Readonly<[ScreencastOptions](./puppeteer.screencastoptions.md)> | _(Optional)_ Configures screencast behavior. | | ||
|
||
**Returns:** | ||
|
||
Promise<ScreenRecorder> | ||
|
||
## Remarks | ||
|
||
All recordings will be \[WebM\](https://www.webmproject.org/) format using the \[VP9\](https://www.webmproject.org/vp9/) video codec. The FPS is 30. | ||
|
||
You must have \[ffmpeg\](https://ffmpeg.org/) installed on your system. | ||
|
||
## Example | ||
|
||
Recording a [page](./puppeteer.page.md): | ||
|
||
``` | ||
import puppeteer from 'puppeteer'; | ||
// Launch a browser | ||
const browser = await puppeteer.launch(); | ||
// Create a new page | ||
const page = await browser.newPage(); | ||
// Go to your site. | ||
await page.goto("https://www.example.com"); | ||
// Start recording. | ||
const recorder = await page.screencast({path: 'recording.webm'}); | ||
// Do something. | ||
// Stop recording. | ||
await recorder.stop(); | ||
browser.close(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
sidebar_label: Rectangle | ||
--- | ||
|
||
# Rectangle interface | ||
|
||
#### Signature: | ||
|
||
```typescript | ||
export interface Rectangle extends Point | ||
``` | ||
**Extends:** [Point](./puppeteer.point.md) | ||
## Properties | ||
| Property | Modifiers | Type | Description | Default | | ||
| -------- | --------- | ------ | ----------- | ------- | | ||
| height | | number | | | | ||
| width | | number | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
sidebar_label: ScreencastOptions | ||
--- | ||
|
||
# ScreencastOptions interface | ||
|
||
#### Signature: | ||
|
||
```typescript | ||
export interface ScreencastOptions | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | Default | | ||
| ---------- | --------------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | | ||
| crop | <code>optional</code> | [Rectangle](./puppeteer.rectangle.md) | Specifies the region of the viewport to crop. | | | ||
| ffmpegPath | <code>optional</code> | string | <p>Path to the \[ffmpeg\](https://ffmpeg.org/).</p><p>Required if <code>ffmpeg</code> is not in your PATH.</p> | | | ||
| path | <code>optional</code> | \`${string}.webm\` | File path to save the screencast to. | | | ||
| speed | <code>optional</code> | number | <p>Specifies the speed to record at.</p><p>For example, <code>0.5</code> will slowdown the video by 50%. <code>2</code> will double the speed of the output video.</p> | <code>1</code> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.