100ms Logo

100ms

Docs

Search docs
/

HMSScreenShareConfig

Config to have control over screenshare being captured. Note that not all fields are supported on all browsers. Even when they're supported the fields acts as hints and the browser can override them.

Properties

audioOnly

Optional audioOnly: boolean

discard the video and only share audio track with others, useful for sharing music.

Default

false


cropElement

Optional cropElement: HTMLDivElement

used for region capture in screenshare, if the current tab is being screenshared the screenshare video track will be cropped to only this element. Will throw error if the element is not present in DOM.


cropTarget

Optional cropTarget: object

used for region capture in screenshare, the screenshare video track will be cropped to only the passed in cropTarget. This cropTarget must come from the tab which is being shared


displaySurface

Optional displaySurface: "browser" | "monitor" | "window"

preselect the relevant tab in screenshare menu browser - for preferring a browser tab window - for application window monitor - for full screen

Default

monitor


forceCurrentTab

Optional forceCurrentTab: boolean

show the current tab first in supported browser, throws error if user doesn't select current tab for sharing.

Default

false


preferCurrentTab

Optional preferCurrentTab: boolean

show the current tab first in supported browser, but don't throw error if user selects something else.

Default

false


selfBrowserSurface

Optional selfBrowserSurface: "include" | "exclude"

whether to show an option for sharing the current tab in the screen share prompt. Screen sharing current tab might lead to hall of mirrors effect. Default is exclude, if either of forceCurrentTab or preferCurrentTab are true, this is set to include.

Default

exclude


surfaceSwitching

Optional surfaceSwitching: "include" | "exclude"

whether to hint browser to show a "share this tab instead" option when tab is shared. Default is include, set to exclude if forceCurrentTab is true

Default

include


systemAudio

Optional systemAudio: "include" | "exclude"

whether to show option for sharing system level audio if full screen is being shared. Not applicable if isVideoOnly is true. Note that sharing system audio will cause echo if mic is on.

Default

exclude


videoOnly

Optional videoOnly: boolean

do not give an option to share audio while screen sharing.

Default

false


Have a suggestion? Recommend changes ->

Was this helpful?

1234