Skip to main content
startScreenShare(options?) Prebuilt Custom Does nothing if there is no active meeting, the browser does not support screen sharing, or enable_screenshare is disabled for the room or meeting token. Listen for local-screen-share-started to confirm sharing is active, local-screen-share-stopped when it ends, and local-screen-share-canceled if the user dismisses the picker.

Parameters

options?: DailyStartScreenShareOptions
displayMediaOptions
DailyDisplayMediaStreamOptions | DailyDisplayMediaStreamOptionsElectron
Constraints passed to getDisplayMedia() when Daily acquires the stream. Provide either this or mediaStream — not both.Web (Chrome/Chromium)
  • audio (boolean | MediaTrackConstraints) — Whether to capture tab audio. Behavior when omitted is browser-dependent.
  • video (boolean | MediaTrackConstraints) — Whether to capture video. getDisplayMedia() requires a video track, so false will cause the call to reject.
  • selfBrowserSurface ('include' | 'exclude') — Whether to allow sharing the current tab. Default: 'exclude' (avoids hall-of-mirrors effect). Chrome/Chromium only.
  • surfaceSwitching ('include' | 'exclude') — Whether to show a tab-switch button during sharing. Default: 'include'. Chrome/Chromium only.
  • systemAudio ('include' | 'exclude') — Whether to offer system audio as a source. Chrome/Chromium only.
Electron
  • audio (boolean) — Whether to include audio in the stream.
  • video.maxWidth (number, optional) — Max width for the screen share track.
  • video.maxHeight (number, optional) — Max height for the screen share track.
  • chromeMediaSourceId (string) — Specific screen source to share.
mediaStream
MediaStream
A MediaStream you obtained yourself (e.g. via your own getDisplayMedia() call). Provide either this or displayMediaOptions — not both.
When you provide mediaStream, you are responsible for stopping the track when the share ends. Daily will handle cleanup if the user stops sharing via the browser UI, but you must stop the track explicitly when calling stopScreenShare().
screenVideoSendSettings
DailyVideoSendSettings | DailyScreenVideoSendSettingsPreset
Send settings for the screen video track. Can be used with either displayMediaOptions or mediaStream. Accepts the same values as updateSendSettings().

Return value

Returns void.

Example

// Default — browser picks the screen
call.startScreenShare();

// Custom constraints and send settings
call.startScreenShare({
  displayMediaOptions: {
    audio: false,
    selfBrowserSurface: 'exclude',
    surfaceSwitching: 'include',
    video: { width: 1920, height: 1080 },
  },
  screenVideoSendSettings: 'motion-and-detail-balanced',
});

See also