Closed mmohammadi9812 closed 2 years ago
Hi there I'm trying to use this library to record a page, but it gets closed after stream starts piping to file
this is the code:
const puppeteer = require('puppeteer'); const puppeteerStream = require("puppeteer-stream"); const fs = require("fs"); const executablePath = 'somepath'; const file = fs.createWriteStream(__dirname + "/demo-2.webm"); (async () => { const browser = await puppeteerStream.launch({ executablePath, args: [ '--autoplay-policy=no-user-gesture-required', '--no-sandbox', ], }); const [ page ] = await browser.pages(); await page.goto("http://localhost:3000"); const stream = await puppeteerStream.getStream(page, { audio: true, video: true }); console.log("recording"); stream.pipe(file); setTimeout(async () => { await stream.destroy(); file.close(); console.log("finished"); }, 5_000); await browser.close(); })()
I tried the ffmpeg example too, but in both cases, as soon as I see recording on console, the browser closes without any error or warning on console
ffmpeg
recording
thanks for this library, and I'd appreciate if anyone can help
Ok, I came to this from an stack overflow question, but I think I'm in the wrong place and didn't read description properly Sorry, closing
Hi there I'm trying to use this library to record a page, but it gets closed after stream starts piping to file
this is the code:
I tried the
ffmpeg
example too, but in both cases, as soon as I seerecording
on console, the browser closes without any error or warning on consolethanks for this library, and I'd appreciate if anyone can help