Constructor
new CloudGamingGroupControlWebSDK()
Methods
init(config) → {void}
Parameters:
Returns:
-
Type
-
void
start(serverSession) → {void}
Example
TCGGCSDK.start(serverSession);
Parameters:
Name |
Type |
Description |
serverSession |
string
|
调用对应的云API 获取的 ServerSession |
Returns:
-
Type
-
void
setMaster(params) → {void}
Example
TCGGCSDK.setMaster({instanceId: 'cai-xxx1'});
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
instanceId |
string
|
master的 instanceId |
|
Returns:
-
Type
-
void
startSync(params) → {void}
- Default Value:
开始同步,根据设置的 instanceIds 进行同步
Example
TCGGCSDK.startSync({instanceIds: ['cai-xxx1', 'cai-xxx2']});
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
instanceIds |
Array
|
string[] 需要同步的设备列表 |
|
Returns:
-
Type
-
void
stopSync() → {void}
Returns:
-
Type
-
void
Example
TCGGCSDK.setLocation({'cai-xxx1': {Longitude: 113.32412, Latitude: 23.124124}, 'cai-xxx2': {Longitude: 114.32412, Latitude: 24.124124}})
Parameters:
Name |
Type |
Description |
params |
Object
|
key 为 instanceId
Properties
Name |
Type |
Description |
key |
string
|
设备 instanceId |
value |
Object
|
Properties
Name |
Type |
Description |
Longitude |
number
|
|
Latitude |
number
|
|
|
|
Returns:
-
Type
-
Promise.<BatchTaskResponse>
setResolution(params) → {Promise.<BatchTaskResponse>}
Example
TCGGCSDK.setResolution({'cai-xxx1': {Width: 720, Height: 1080}, {'cai-xxx2': {Width: 720, Height: 1080}})
Parameters:
Name |
Type |
Description |
params |
Object
|
key 为 instanceId
Properties
Name |
Type |
Description |
key |
string
|
设备 instanceId |
value |
Object
|
Properties
Name |
Type |
Description |
Width |
number
|
|
Height |
number
|
|
DPI |
number
|
|
|
|
Returns:
-
Type
-
Promise.<BatchTaskResponse>
Example
TCGGCSDK.paste({'cai-xxx1': {Text: 'abc'}, {'cai-xxx2': {Text: '123'}})
Parameters:
Name |
Type |
Description |
params |
Object
|
key 为 instanceId
Properties
Name |
Type |
Description |
key |
string
|
设备 instanceId |
value |
Object
|
Properties
Name |
Type |
Description |
Text |
string
|
要粘贴的文本 |
|
|
Returns:
-
Type
-
Promise.<BatchTaskResponse>
sendClipboard(params) → {Promise.<BatchTaskResponse>}
Example
TCGGCSDK.sendClipboard({'cai-xxx1': {Text: 'abc'}, {'cai-xxx2': {Text: '123'}})
Parameters:
Name |
Type |
Description |
params |
Object
|
key 为 instanceId
Properties
Name |
Type |
Description |
key |
string
|
设备 instanceId |
value |
Object
|
Properties
Name |
Type |
Description |
Text |
string
|
要发送的内容 |
|
|
Returns:
-
Type
-
Promise.<BatchTaskResponse>
Example
TCGGCSDK.shake({'cai-xxx1': {}, {'cai-xxx2': {}})
Parameters:
Name |
Type |
Description |
params |
Object
|
key 为 instanceId
Properties
Name |
Type |
Description |
key |
string
|
设备 instanceId |
value |
Object
|
value 暂时传空对象 {} |
|
Returns:
-
Type
-
Promise.<BatchTaskResponse>
Example
TCGGCSDK.setSensor({'cai-xxx1': {Type: 'accelerometer', Values: [10, 10, 10]}, {'cai-xxx2': {Type: 'gyroscope', Values: [10, 10, 10]}})
Parameters:
Name |
Type |
Description |
params |
Object
|
key 为 instanceId
Properties
Name |
Type |
Description |
key |
string
|
设备 instanceId |
value |
Object
|
Properties
Name |
Type |
Description |
Type |
'accelerometer'
|
'gyroscope'
|
传感器leasing accelerometer(加速器),gyroscope(陀螺仪) |
Values |
Array.<string>
|
传感器对应的值,数组长度为 3,分辨表示 x/y/z 轴的值 |
|
|
Returns:
-
Type
-
Promise.<BatchTaskResponse>
setImageEvent(params) → {void}
Example
TCGGCSDK.setImageEvent({interval: 10, quality: 50});
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
interval |
number
|
截图事件的间隔,单位毫秒 |
quality |
number
|
截图质量,取值范围 0-100 |
|
Returns:
-
Type
-
void
getInstanceImage(params) → {void}
Example
TCGGCSDK.getInstanceImage({instanceId: 'cai-xxx1'});
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
instanceId |
string
|
|
|
Returns:
-
Type
-
void