Skip to main content

Function: useScreenShare()

useScreenShare(): object

This hook can toggle screen sharing on/off and provides current screen share state.

Returns

object

An object with functions to manage screen share.

handleScreenSharePermission()

handleScreenSharePermission: () => Promise<"granted" | "denied">

Returns

Promise<"granted" | "denied">

isScreenShareOn

isScreenShareOn: boolean

setScreenShareTrackBandwidth()

setScreenShareTrackBandwidth: (bandwidth) => Promise<void>

Parameters

ParameterType
bandwidthnumber

Returns

Promise<void>

Deprecated

setScreenShareTrackEncodingBandwidth()

setScreenShareTrackEncodingBandwidth: (encoding, bandwidth) => Promise<void>

updates maximum bandwidth for the given simulcast encoding of the screen share track

Parameters

ParameterTypeDescription
encodingTrackEncodingencoding to update
bandwidthnumberBandwidthLimit to set

Returns

Promise<void>

Deprecated

simulcastConfig

simulcastConfig: SimulcastConfig

toggleScreenShare()

toggleScreenShare: (screenShareOptions) => Promise<void>

Toggles the screen share on/off Emits warning on ios when user is screensharing app screen.

Parameters

ParameterType
screenShareOptionsPartial<ScreenShareOptions>

Returns

Promise<void>

toggleScreenShareTrackEncoding()

toggleScreenShareTrackEncoding: (encoding) => Promise<void>

Toggles simulcast encoding of a screen share track on/off

Parameters

ParameterTypeDescription
encodingTrackEncodingencoding to toggle

Returns

Promise<void>

Deprecated

Defined in

packages/react-native-client/src/hooks/useScreenShare.ts:52