SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
333 stars 105 forks source link

When I use --use-fake-ui-for-media-stream the stream function gets some error #98

Closed Harsh4999 closed 1 year ago

Harsh4999 commented 1 year ago
const browser = await launch({
    defaultViewport: null,
    executablePath: puppeteer.executablePath(),
    args: [ '--disable-setuid-sandbox', '--no-sandbox', '--window-size=1920,1080','--use-fake-ui-for-media-stream'],
    ignoreDefaultArgs: ['--mute-audio'],
});

 const stream = await getStream(page, { audio: true, video: false }).catch(err => console.log(err));

 Error:

       throw new Error('Evaluation failed: ' + (0, util_js_1.getExceptionMessage)(exceptionDetails));
          ^

Error: Evaluation failed: undefined at ExecutionContext._ExecutionContext_evaluate (/Users/harsh/POCAudioBot/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:252:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExecutionContext.evaluate (/Users/harsh/POCAudioBot/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:140:16)

Harsh4999 commented 1 year ago

found solution using browser.defaultContext