UNPKG

wibbitz-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

30 lines (29 loc) 895 B
/// <reference types="node" /> import { EventEmitter } from 'events'; import { pageScreenFrame, VideoOptions } from './StreamTypes'; /** * @ignore */ export default class FFMPEGStreamWriter extends EventEmitter { private readonly streamBatchSize; private screencastFrames; private lastProcessedFrame; duration: string; private status; private options; private videoMediatorStream; private writerPromise; constructor(savePath: string, options?: VideoOptions); private get videoFrameSize(); private getFFMPEGPath; private configureFFMPEGPath; private configureVideoFile; private handleWriteStreamError; private findVacantIndexInScreencastFrames; insert(frame: pageScreenFrame): void; private trimFrames; private processFramesAndWrite; write(data: Buffer): void; private drainFrames; stop(): Promise<boolean>; }