-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
I would like to record the current page using getDisplayMedia().
It works now in headful, not headless.
I launch the browser using these args:
browser = await playwright.launch({
headless:**false**,
ignoreHTTPSErrors:true,
args: [
'--enable-experimental-web-platform-features',
'--disable-infobars',
'--enable-usermedia-screen-capturing',
'--allow-http-screen-capture',
'--auto-select-desktop-capture-source=**MYPAGETITLE**',
'--ignore-certificate-errors',
'--no-sandbox',
'--autoplay-policy=no-user-gesture-required',
'--disable-gpu',
'--hide-scrollbars'
],
});
and inside my web page loaded by the browser, I can now use
canvasStream = await navigator.mediaDevices.getDisplayMedia();
and I indeed get the stream of the tab.
However, it fails when headless = true;
Do you think others might benefit from this as well?
I believe that running headless is much easier since it doesn't require us running a virtual display (e.g. xvfb).
Metadata
Metadata
Assignees
Labels
No labels