puppeteer-stream icon indicating copy to clipboard operation
puppeteer-stream copied to clipboard

Update: Video recording not honoring emulated device viewport (iPhone 14 Pro Max)

Open nishitarora2200 opened this issue 1 year ago • 5 comments

Update:

I have also tried explicitly setting the browser window size to match the device's resolution using the --window-size argument. Here's the updated code:

const browser = await launch({
    args: [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-dev-shm-usage',
        '--window-size=430,739' // iPhone 14 Pro Max dimensions
    ],
    // headless: false,
    userDataDir: userDataDir,
    executablePath: getExecutablePath()
});

Despite this, the recorded video still has a width significantly larger than expected. It seems like the recording is ignoring the set window size and/or the emulated device viewport.

Originally posted by @nishitarora2200 in https://github.com/SamuelScheit/puppeteer-stream/issues/179#issuecomment-2485884690

nishitarora2200 avatar Nov 20 '24 05:11 nishitarora2200

@SamuelScheit Please update on this

nishitarora2200 avatar Nov 20 '24 14:11 nishitarora2200

Maybe the banner "This browser is being remote controlled" hides the page content and causes a slightly different video resolution:

to remove this banner add those launch options:

args: [
	"--disable-blink-features=AutomationControlled",
],
ignoreDefaultArgs: ["--enable-automation"],

samuelscheit avatar Nov 20 '24 14:11 samuelscheit

@SamuelScheit Still same output after applying these launch options.

        const browser = await launch({
            args: [
                '--no-sandbox',
                '--disable-setuid-sandbox',
                '--disable-dev-shm-usage',
                '--disable-blink-features=AutomationControlled',
                '--window-size=430,739' // iPhone 14 Pro Max dimensions
            ],
            ignoreDefaultArgs: ["--enable-automation"],
            // headless: false,
            userDataDir: userDataDir,
            executablePath: getExecutablePath()
        });

nishitarora2200 avatar Nov 20 '24 14:11 nishitarora2200

@SamuelScheit Any update on this ?

nishitarora2200 avatar Nov 21 '24 07:11 nishitarora2200

any updates guys?

HoussemRabah avatar May 26 '25 20:05 HoussemRabah