UNPKG

@aurora-agency/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

40 lines (39 loc) 1.33 kB
/// <reference types="node" /> /// <reference types="node" /> /// <reference types="node" /> import { EventEmitter } from 'events'; import { Writable } from 'stream'; import { pageScreenFrame, VideoOptions } from './pageVideoStreamTypes'; export default class PageVideoStreamWriter extends EventEmitter { private readonly screenLimit; private screenCastFrames; duration: string; frameGain: number; frameLoss: number; private status; private options; private videoMediatorStream; private writerPromise; private destinationExt; constructor(destinationSource: string | Writable, options?: VideoOptions); private get videoFrameSize(); private get autopad(); private getFfmpegPath; private getDestinationPathExtension; private configureFFmPegPath; private isWritableStream; private configureRtmpStream; private configureVideoFile; private configureVideoWritableStream; private getOutputOption; private addVideoMetadata; 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>; }