Function
This API is used to start sharing in a meeting. The UI of the SDK has implemented the sharing function. You can call this API to initiate sharing on a third-party application. 1. If you are not in the meeting or call, calling this API will fail. 2. If you call this API during a call, the call is converted to a meeting.
Function Prototype
startShare(startShareInfo: StartShareInfo, onStartShareResult?: (ret: SDKERR, reason: string) => void): voidstartShare(startShareInfo: StartShareInfo, onStartShareResult?: (ret: SDKERR, reason: string) => void): void
Request Parameters
Table 1 Input parameter description
Parameter |
Mandatory |
Type |
Description |
startShareInfo |
Yes |
StartShareInfo |
Parameters of starting sharing. |
onStartShareResult |
Yes |
(ret: SDKERR, reason: string) => void |
Callback of starting sharing. |
Table 2 StartShareInfo
Parameter |
Mandatory |
Type |
Description |
shareType |
Yes |
ShareType |
Sharing type. |
monitorShareInfo |
No |
MonitorShareInfo |
Desktop sharing details. This parameter is mandatory if the sharing type is desktop sharing. |
appShareInfo |
No |
AppShareInfo |
Program sharing details. This parameter is mandatory if the sharing type is program sharing. |
operatableUiMonitor |
Yes |
MonitorShareInfo |
Monitor where the toolbar is located during sharing. If the value of monitor is 0, no monitor is specified. |
Table 3 Enumerated values of ShareType
Enumeration Name |
Enumerated Value |
Description |
HWM_SHARE_TYPE_MONITOR |
0 |
Screen sharing (valid only for the Windows platform). |
HWM_SHARE_TYPE_APP |
1 |
Program sharing (valid only for the Windows platform). |
HWM_SHARE_TYPE_WHITE_BOARD |
2 |
Whiteboard sharing (valid only for the Windows platform). |
HWM_SHARE_TYPE_ALL |
3 |
All sharing types. |
Table 4 MonitorShareInfo
Parameter |
Mandatory |
Type |
Description |
monitor |
Yes |
Monitor |
Monitor type. 1: primary; 2: secondary. This parameter is valid only when mode is set to the dual-monitor mode. |
monitorMode |
Yes |
MonitorMode |
Monitor mode. 0: dual-monitor; 1: multi-monitor. |
monitorIndex |
Yes |
number |
Monitor index. This parameter is valid only when mode is set to the multi-monitor mode. |
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 MonitorMode
Enumeration Name |
Enumerated Value |
Description |
HWM_MONITOR_MODE_PRIMARY_SECONDARY |
0 |
Dual-monitor. |
HWM_MONITOR_MODE_MULTI_MONITOR |
1 |
Multi-monitor. |
Table 7 AppShareInfo
Parameter |
Mandatory |
Type |
Description |
appHandle |
Yes |
number |
Program handle. |
Callback Method Parameters
(ret: SDKERR, reason: string) => void
Table 8 Input parameter description
Parameter |
Type |
Description |
ret |
For details about SDKERR, see Error Code Reference. |
Error code. |
reason |
string |
Error description. |