Help Center/ Meeting/ Client SDK Reference/ Electron SDK/ APIs/ Meeting Control Objects/ Subscribing to Sharing Status Notifications
Updated on 2024-07-30 GMT+08:00

Subscribing to Sharing Status Notifications

Function

A notification is sent when the sharing status is changed.

Function Prototype

setOnShareStateChangedCB(onShareStateChanged: (shareStateInfo: ShareStateInfo) => void): voidsetOnShareStateChangedCB(onShareStateChanged: (shareStateInfo: ShareStateInfo) => void): void

Request Parameters

Table 1 Input parameter description
Parameter Mandatory Type Description
onShareStateChanged Y (shareStateInfo: ShareStateInfo) => void Notification sent when the sharing status is changed.

Return Values

void

Notification Method Parameters

(shareStateInfo: ShareStateInfo) => void

Table 2 Input parameter description
Parameter Type Description
shareStateInfo ShareStateInfo Sharing status information.
Table 3 ShareStateInfo
Parameter Type Description
state State Sharing status.
nickName string Sharer name. This parameter is valid only when state is set to HWM_STATE_ON.
number string Number of the sharer. This parameter is valid only when state is set to HWM_STATE_ON.
monitor Monitor Type of the shared monitor (primary or secondary monitor).
shareType ShareType Sharing type.
appHandle number Program handle.
Table 4 Enumerated values of State
Enumeration Name Enumerated Value Description
HWM_STATE_OFF 0 Disabled.
HWM_STATE_ON 1 Enabled.
Table 5 Enumerated values of Monitor
Enumeration Name Enumerated Value Description
HWM_MONITOR_MAIN 1 Primary.
HWM_MONITOR_SECONDARY 2 Secondary.
Table 6 Enumerated values of ShareType
Enumeration Name Enumerated Value Description
HWM_SHARE_TYPE_MONITOR 0 Screen sharing.
HWM_SHARE_TYPE_APP 1 Program sharing.
HWM_SHARE_TYPE_WHITE_BOARD 2 Whiteboard sharing.