API Overview
Create a cloud phone session
Method name | Description |
---|---|
init | Initialize the ArmcloudEngine engine |
destory | Destory the ArmcloudEngine engine |
createPhoneClient | Create a cloud phone session |
reqBatchStart | Request batch streaming |
Cloud phone feature interface
Method name | Description |
---|---|
start | Start the cloud phone |
stop | Stop the cloud phone |
setSessionObserver | Set session callback |
sendKeyCode | Send a keyboard key event (send a complete DOWN + UP event) |
sendKeyCode | Send keyboard key events (optionally send single state events) |
volumeUp | Increase the volume of the cloud device |
volumeDown | Decrease the volume of the cloud device |
sendTouchEvent | Send mouse button event |
setVideoLevel | Set the cloud phone display resolution |
screenshot | Screenshot |
sendInputText | Send text to the input box |
enableAudio | Enable audio |
enableVideo | Enable video |
enableBlow | Enable blowing |
shake | Shake |
setVideoSink | Set the video renderer |
Interface detailed description
init
Description:Initialize the ArmcloudEngine engine
Syntax:
void init();
destory
Description:Destroy the ArmcloudEngine engine
Syntax:
void destory();
createPhoneClient
Description:Create a cloud machine session
Syntax:
PhoneClient* createPhoneClient();
reqBatchStart
Description:Request batch streaming
Syntax:
void reqBatchStart(const BatchPhoneConfig& config);
Parameter | Description |
---|---|
config | Set up batch request streaming configuration |
start
Description:Call start() to launch the cloud phone
Syntax:
void start(const PhoneConfig& config);
stop
Description:Call stop() to stop the cloud phone
Syntax:
void stop();
setSessionObserver
Description:Call setSessionObserver() to set the cloud phone event callback
Syntax:
void setSessionObserver(SessionObserver* observer)
Parameter | Description |
---|---|
observer | Cloud phone event callback |
sendKeyCode
Description:Send keyboard key event commands to the cloud device instance. This interface sends a complete DOWN+UP event. It is recommended for simulating system function keys such as the Home key, Back key, and Menu key
Syntax:
void sendKeyCode(int code)
Parameter | Description |
---|---|
code | Key value 3:HOME 4:BACK 82:MENU 187:TASK |
sendKeyCode
Description:Send keyboard key event commands to the cloud device instance. This interface allows you to choose to send single state events (either DOWN or UP). It is recommended to use this for simulating key events with higher state requirements, such as DELETE
Syntax:
void sendKeyCode(int action, int code)
Parameter | Description |
---|---|
action | Status 0:DOWN 1:UP |
code | Key value 3:HOME 4:BACK 82:MENU 187:TASK |
volumeUp
Description:Increase the volume of the cloud device
Syntax:
void volumeUp()
volumeDown
Description:Reduce the volume of the cloud device
Syntax:
void volumeDown()
sendTouchEvent
Description:Send mouse button event
Syntax:
void sendTouchEvent(int action, int x, int y, int width, int height)
Parameter | Description |
---|---|
action | Status 0、DOWN 1、UP 2、MOVE |
x | Click coordinates in the X-axis direction |
y | Click coordinates in the Y-axis direction |
width | Local screen width of the cloud phone |
height | Local screen height of the cloud phone |
setVideoLevel
Description:Set the clarity of the cloud phone display
Syntax:
void setVideoLevel(int resolution, int fps, int bitrate)
Parameter | Description | Reference value |
---|---|---|
resolution | Resolution | 07:144x256 08:216x384 08:216x384 09:288x512 10:360x640 11:480x848 12:540x960 13:600x1024 14:480x1280 15:720x1280 16:720x1920 17:1080x1920 18:1440x1920 19:1600x2560 20:2880x1080 |
fps | Frame rate | 1:20fps 2:25fps 3:30fps 4:60fps 5:1fps 6:5fps 7:10fps 8:15fps 9:2fps |
bitrate | Bitrate | 01:1Mbps 02:1.5Mbps 03:2Mbps 04:2.5Mbps 05:3Mbps 06:3.5Mbps 07:4Mbps 08:5Mbps 09:6Mbps 10:8Mbps 11:10Mbps 12:12Mbps 13:200kbps 14:400kbps 15:600kbps |
screenshot
Description:Take a screenshot of the current cloud phone screen.
Syntax:
void screenshot(bool local)
Parameter | Description |
---|---|
local | Screenshot save location true:Local false:Remote |
sendInputText
Description:Send text to replace the content of the cloud device's input box (it will take effect only when the input box is in focus)
Syntax:
void sendInputText(const std::string& text)
Parameter | Description |
---|---|
text | The sent text content must be UTF-8 encoded |
enableAudio
Description:Audio toggle switch
Syntax:
void enableAudio(bool enable)
Parameter | Description |
---|---|
enable | Status true:Enable false:Stop |
enableVideo
Description:Video toggle switch
Syntax:
void enableVideo(bool enable)
Parameter | Description |
---|---|
enable | Status true:Enable false:Stop |
enableBlow
Description:enable Blow
Syntax:
void enableBlow(bool enable)
Parameter | Description |
---|---|
enable | Status true:Enable false:Stop |
shake
Description:Shake
Syntax:
void shake()
setVideoSink
Description:Set the video renderer
Syntax:
void setVideoSink(VideoRenderSink* sink)
Parameter | Description |
---|---|
sink | Video renderer, referenceVideoRenderSink |