UNPKG

@axelboberg/puppeteer-screen-recorder

Version:

A puppeteer Plugin that uses the native chrome devtool protocol for capturing video frame by frame. Also supports an option to follow pages that are opened by the current page object

36 lines (35 loc) 1.15 kB
/// <reference types="node" /> import { EventEmitter } from 'events'; import { Writable } from 'stream'; import { pageScreenFrame, VideoOptions } from './pageVideoStreamTypes'; /** * @ignore */ export default class PageVideoStreamWriter extends EventEmitter { private readonly screenLimit; private screenCastFrames; private lastProcessedFrame; duration: string; private status; private options; private videoMediatorStream; private writerPromise; constructor(destinationSource: string | Writable, options?: VideoOptions); private get videoFrameSize(); private get autopad(); private getFfmpegPath; private getDestinationPathExtension; private configureFFmPegPath; private isWritableStream; private configureVideoFile; private configureVideoWritableStream; private getDestinationStream; private handleWriteStreamError; private findSlot; insert(frame: pageScreenFrame): void; private trimFrame; private processFrameBeforeWrite; write(data: Buffer, durationSeconds?: number): void; private drainFrames; stop(stoppedTime?: number): Promise<boolean>; }