|
14 | 14 | - [class: ConsoleMessage](#class-consolemessage)
|
15 | 15 | - [class: Dialog](#class-dialog)
|
16 | 16 | - [class: Download](#class-download)
|
| 17 | +- [class: Video](#class-video) |
17 | 18 | - [class: FileChooser](#class-filechooser)
|
18 | 19 | - [class: Keyboard](#class-keyboard)
|
19 | 20 | - [class: Mouse](#class-mouse)
|
@@ -307,6 +308,7 @@ await context.close();
|
307 | 308 | <!-- GEN:toc -->
|
308 | 309 | - [event: 'close'](#event-close)
|
309 | 310 | - [event: 'page'](#event-page)
|
| 311 | +- [event: 'video'](#event-video) |
310 | 312 | - [browserContext.addCookies(cookies)](#browsercontextaddcookiescookies)
|
311 | 313 | - [browserContext.addInitScript(script[, arg])](#browsercontextaddinitscriptscript-arg)
|
312 | 314 | - [browserContext.browser()](#browsercontextbrowser)
|
@@ -354,6 +356,13 @@ console.log(await page.evaluate('location.href'));
|
354 | 356 |
|
355 | 357 | > **NOTE** Use [`page.waitForLoadState([state[, options]])`](#pagewaitforloadstatestate-options) to wait until the page gets to a particular state (you should not need it in most cases).
|
356 | 358 |
|
| 359 | +#### event: 'video' |
| 360 | +- <[Video]> |
| 361 | + |
| 362 | +Emitted when the video recording is started. User can access video file information via the passed [Video] instance. |
| 363 | + |
| 364 | +> **NOTE** Browser context **must** be created with the `videosPath` set to record videos. |
| 365 | +
|
357 | 366 | #### browserContext.addCookies(cookies)
|
358 | 367 | - `cookies` <[Array]<[Object]>>
|
359 | 368 | - `name` <[string]> **required**
|
@@ -3429,6 +3438,36 @@ Returns suggested filename for this download. It is typically computed by the br
|
3429 | 3438 | Returns downloaded url.
|
3430 | 3439 |
|
3431 | 3440 |
|
| 3441 | +### class: Video |
| 3442 | + |
| 3443 | +[Video] objects are dispatched by the browser context via the ['video'](#event-video) event. |
| 3444 | + |
| 3445 | +All the video files generated for the browser context are reported with this event. Video event is emitted once the video starts. Video itself becomes available once browser context closes: |
| 3446 | + |
| 3447 | +```js |
| 3448 | +context.on('video', video => { |
| 3449 | + console.log(video.page().url(), video.path()); |
| 3450 | +}) |
| 3451 | +``` |
| 3452 | + |
| 3453 | +> **NOTE** Browser context **must** be created with the `videosPath` set to record videos. |
| 3454 | +
|
| 3455 | +<!-- GEN:toc --> |
| 3456 | +- [video.page()](#videopage) |
| 3457 | +- [video.path()](#videopath) |
| 3458 | +<!-- GEN:stop --> |
| 3459 | + |
| 3460 | +#### video.page() |
| 3461 | +- returns: <[Page]> |
| 3462 | + |
| 3463 | +Returns the page this video is recorder for. |
| 3464 | + |
| 3465 | +#### video.path() |
| 3466 | +- returns: <[string]> |
| 3467 | + |
| 3468 | +Returns the file system path this video is recorder to. |
| 3469 | + |
| 3470 | + |
3432 | 3471 | ### class: FileChooser
|
3433 | 3472 |
|
3434 | 3473 | [FileChooser] objects are dispatched by the page in the ['filechooser'](#event-filechooser) event.
|
@@ -4436,6 +4475,7 @@ const backgroundPage = await context.waitForEvent('backgroundpage');
|
4436 | 4475 | <!-- GEN:toc-extends-BrowserContext -->
|
4437 | 4476 | - [event: 'close'](#event-close)
|
4438 | 4477 | - [event: 'page'](#event-page)
|
| 4478 | +- [event: 'video'](#event-video) |
4439 | 4479 | - [browserContext.addCookies(cookies)](#browsercontextaddcookiescookies)
|
4440 | 4480 | - [browserContext.addInitScript(script[, arg])](#browsercontextaddinitscriptscript-arg)
|
4441 | 4481 | - [browserContext.browser()](#browsercontextbrowser)
|
|
0 commit comments