Listening to interfaces
interface name | interface description |
---|---|
ICloudCoreManagerStatusListener | InitializeListener |
IPlayerListener | PullStreamPlayStateListener |
IStreamListener | VideoStreamStatusListener |
StreamProfileChangeCallBack | ClaritySwitchSuccessListener |
SetAutoRecycleTimeCallback | NoAutoRecycleServiceTimeListener |
ScreenShotCallBack | Screenshot to local listener |
LocationEventListener | LocationEventListener |
IMessageReceiver | Message Passthrough Listener |
IUploadFileCallBack | File upload monitoring |
IClipBoardListener | Cloud Clipboard Listener |
Listening to interfaces
Initialize listener
Interface: ICloudCoreManagerStatusListener
method:
Method Name | Parameters | Description |
---|---|---|
onPrepared() | None | Initialization success callback |
Pull stream playback status listening
Interface: IPlayerListener
method:
Method Name | Parameters | Description |
---|---|---|
onPlaySuccess(videoStreamProfileId: Int) | videoStreamProfileId: the clarity of the current cloud phone screen, the callback is triggered when the first frame is rendered to the screen | Play Success |
onError(code: Int, msg: String) | code: Error code; msg: Error content | Error messages |
onWarning(code: Int, msg: String) | code: warning code; msg: warning content | warning message |
onNetworkChanged(int type) | type: -1: Network connection type is unknown; 0: Network connection has been disconnected; 1: Network type is LAN; 2: Network type is Wi-Fi (including hotspot); 3: Network type is 2G mobile; 4: Network type is 3G mobile; 5: Network type is 4G mobile; 6: Network type is 5G mobile | Network type and status switch callback |
onServiceInit(extras: Map<String, Any>?) | extras: reserved parameters, used to passthrough some extra parameters | pre-join room callback, used to get and initialize each functional service, such as setting up various event listeners |
networkQualityRtt(rtt: Int) | rtt: the time it takes for data to go back and forth between the client and the server | After joining a room and publishing or subscribing to a stream, report upstream and downstream network quality information for local users and subscribed remote users at a frequency of every 2 seconds |
onMultiCloudPhoneJoin(padCode: String) | padCode: CloudPhoneIdentifier | CloudPhoneJoinGroupControlCallback in GroupControl state |
onMultiCloudPhoneLeave(padCode: String) | padCode: CloudPhoneIdentifier | CloudPhoneLeaveGroupControlCallback in GroupControl state |
Video Streaming Status Listening
Interface: IStreamListener
method:
Method Name | Parameters | Description |
---|---|---|
onFirstAudioFrame(uid: String) | uid: remote instance video stream ID | subscribe to video stream to receive audio first frame callback |
onFirstRemoteVideoFrame(uid: String, width: Int, height: Int) | uid: Remote Instance Video Stream ID width: Width of the cloud machine frame height: Height of the cloud machine frame | Subscribing to a video stream to receive the first frame of the video Callbacks |
onVideoSizeChanged(uid: String, width: Int, height: Int) | uid: Remote Instance Video Stream ID width: Width of the cloud machine screen height: Height of the cloud machine screen | Callback when the width or height of the cloud machine screen changes |
onStreamPaused() | None | call pause(), callback after pausing playback |
onStreamConnectionStateChanged(state: Int) | state@ConnectionState: VideoStreamConnectionState | VideoStreamConnectionStateChangedCallback |
onScreenRotation(rotationType: String) | rotationType: TYPE_LANDSCAPE(HORIZONTAL), TYPE_PORTRAIT(VERTICAL) | Callbacks for when a rotation occurs on the screen of the cloud machine |
Sharpness Switching Successful Listening
Interface: StreamProfileChangeCallBack
Methods.
Method Name | Parameters | Description |
---|---|---|
onVideoStreamProfileChange(isSuccess: Boolean, from: String, current: String) | isSuccess: (whether or not the clarity was successfully switched) from: (the clarity before the switch) current: (the current clarity) | Clarity Switching Callbacks |
No Action Recycling Service Duration Listening
Interface: SetAutoRecycleTimeCallback
Methods.
Method Name | Parameters | Description |
---|---|---|
onResult(autoRecycleTime: Int) | autoRecycleTime: no-operation recycling service duration Unit s | Callback this method after the no-operation duration reaches the set duration |
Screenshot to local listener
Interface: ScreenShotCallBack
Methods.
Method Name | Parameters | Description |
---|---|---|
onScreenShot(bitmap: Bitmap) | bitmap: Bitmap of the screen of the intercepted cloud machine | Callback after calling screenshot to local |
Positioning listener
Interface: LocationEventListener
Methods.
Method Name | Parameters | Description |
---|---|---|
onReceivedRemoteLocationRequest(requestOptions: RequestOptions) | options: location request options | Callback for receiving a location request for a cloud instance in manual location mode |
onRemoteLocationRequestEnded() | None | In manual location mode, the cloud instance location request ended |
onSentLocalLocation(locationInfo: LocationInfo) | locationInfo: LocationInfo | Callback after sending local device location information to the cloud instance in auto-location mode |
onRemoteLocationUpdated(locationInfo: LocationInfo) | locationInfo: LocationInfo | Callback after cloud instance location update |
Message passthrough listener
Interface: IMessageReceiver
Methods.
Method Name | Parameters | Description |
---|---|---|
onReceiveMessage(message: String) | message: the body of the passthrough message | passthrough message from the cloud machine |
File Upload Listener
Interface: IUploadFileCallBack
Methods.
Method Name | Parameters | Description |
---|---|---|
onUpdateStart() | none | UploadStart |
onUpdateByteChange(totalByte: Long, updateByte: Long) | totalByte: total file size updateByte: current upload size Unit: bytes | file upload size changed |
onUpdateProgressChange(progress: Int) | progress: upload progress | File current upload progress change 0 ~ 100 |
onUpdateSuccess(mapData: Map<String, String>) | mapData: reserved data | File upload success |
onUpdateFail(e: Throwable?) | e: Error Message | File Upload Fail |
onUpdateEnd() | None | End of file upload |
onError(code: Int, msg: String) | code: Error code msg: Error message | File Upload Failed Error message other than file upload error |
Cloud Clipboard Listening
Interface: ICLipBoardListener
Methods.
Method Name | Parameters | Description |
---|---|---|
onClipBoardMessageReceived(data: String) | data: Clipboard data synchronized by cloud machine | Clipboard data synchronized by cloud machine |