startScreenShare
Starts sharing the local screen. The browser shows its own surface picker; the promise settles once the share’s leg is connected.
A call carries at most one screen share. Read screenShareStatus before calling and treat 'starting' and 'stopping' as busy — starting a second share throws rather than replacing the live one.
The call itself is unaffected when acquisition fails: a screen-share failure is never fatal.
Parameters
options
Pass { audio: true } to also request the shared surface’s audio. Defaults to video only. See ScreenShareOptions.
Returns
Promise<void>
Throws
ScreenShareAlreadyActiveError— this call is already sharing a screen. CallstopScreenSharebefore starting another.AuxiliaryLegCancelledError—stopScreenShare()removed the share before its leg finished connecting.AuxiliaryLegTimeoutError— the leg did not connect within its budget. The picker is human time and sits outside that budget; only the connect that follows it is bounded.- The raw
getDisplayMediaerror. A dismissed picker or a permission denial rejects with aNotAllowedErrorDOMException— inspecterror.nameto tell benign cancels apart from real failures.
Examples
Sharing a tab together with its audio:
Distinguishing a dismissed picker from a real failure:
See
screenShareStatus$— reactive state.stopScreenShare— end the share.- Gated by
SelfCapabilities.screenshare.