useScreenShare
useScreenShare(params?): Object
Returns a list of running screen shares and their states, along with helper methods that wrap daily-js screen share events.
useScreenShare can also be used to set up optional callbacks for the local-screen-share-started and local-screen-share-stopped events.
Params (optional)
An object with the following properties:
| Parameter | Required | Type | Description | 
|---|---|---|---|
| onError | Function | Callback for the nonfatal-errorevent with type'screen-share-error' | |
| onLocalScreenShareStarted | Function | Callback for the local-screen-share-startedevent | |
| onLocalScreenShareStopped | Function | Callback for the local-screen-share-stoppedevent | 
Return type
An object with the following properties:
| Name | Type | Description | 
|---|---|---|
| isSharingScreen | boolean | Indicates whether the local user is sharing a screen | 
| screens | Array | Array of screens. Seescreensobject properties | 
| startScreenShare | Function | See startScreenShare() | 
| stopScreenShare | Function | See stopScreenShare() | 
screens properties
| Name | Type | Description | 
|---|---|---|
| audio | Object | Track state for associated screenAudio, seetracksproperties for details | 
| local | boolean | Indicates if this is a local screen share | 
| screen_id | string | Unique identifier for the screen | 
| session_id | string | Unique identifier for the participant screen sharing | 
| video | Object | Track state for associated screenVideo, seetracksproperties for details |