Interface ScreenShareCaptureOptions

interface ScreenShareCaptureOptions {
    audio?: boolean | AudioCaptureOptions;
    contentHint?: "text" | "detail" | "motion";
    controller?: unknown;
    preferCurrentTab?: boolean;
    resolution?: VideoResolution;
    selfBrowserSurface?: "include" | "exclude";
    suppressLocalAudioPlayback?: boolean;
    surfaceSwitching?: "include" | "exclude";
    systemAudio?: "include" | "exclude";
    video?: true | {
        displaySurface?: "window" | "browser" | "monitor";
    };
}

Properties

audio?: boolean | AudioCaptureOptions

true to capture audio shared. browser support for audio capturing in screenshare is limited: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#browser_compatibility

contentHint?: "text" | "detail" | "motion"
controller?: unknown

a CaptureController object instance containing methods that can be used to further manipulate the capture session if included.

preferCurrentTab?: boolean

Experimental option to instruct the browser to offer the current tab as the most prominent capture source

resolution?: VideoResolution

capture resolution, defaults to 1080 for all browsers other than Safari On Safari 17, default resolution is not capped, due to a bug, specifying any resolution at all would lead to a low-resolution capture. https://bugs.webkit.org/show_bug.cgi?id=263015

selfBrowserSurface?: "include" | "exclude"

specifies whether the browser should allow the user to select the current tab for capture

suppressLocalAudioPlayback?: boolean

Experimental option to control whether the audio playing in a tab will continue to be played out of a user's local speakers when the tab is captured.

surfaceSwitching?: "include" | "exclude"

specifies whether the browser should display a control to allow the user to dynamically switch the shared tab during screen-sharing.

systemAudio?: "include" | "exclude"

specifies whether the browser should include the system audio among the possible audio sources offered to the user

video?: true | {
    displaySurface?: "window" | "browser" | "monitor";
}

only allows for 'true' and chrome allows for additional options to be passed in https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#displaySurface