Use either the Open API or Local API to upload one MP4 file, start live streaming, inspect its status, and stop it.
| Operation | Open API | Local API |
|---|---|---|
| Query balance and quotas | GET /balance | GET /api/balance |
| Start streaming | POST /cloudphone/live/start | POST /api/cloudphone/live/start |
| Query streaming status | POST /cloudphone/live/status | POST /api/cloudphone/live/status |
| Stop streaming | POST /cloudphone/live/end | POST /api/cloudphone/live/end |
- Use a WUIN or Xiaosuan Cloud Phone model. Other providers currently return
33401. - Power on the Cloud Phone before starting or stopping a stream.
- Obtain an OAuth2 Bearer token and permission to operate the Cloud Phone.
- Live-streaming files must be MP4 files uploaded with
uploadType=2.
- Call
POST /cloudphone/uploadUrl, then upload the MP4 bytes to the returnedpresignedUrlwith HTTPPUT. - Call
POST /cloudphone/uploadFilewith the uploaded object URL, destination directory, anduploadType: 2. - Poll
POST /cloudphone/uploadFileResult. Ifdataisnull, the file is not visible yet; continue polling. Stop whendata.statusis1(success) or2(failed). - Keep the returned string
data.fileIdand send its exact numeric value as anint64toPOST /cloudphone/live/start. Clients such as JavaScript must use an arbitrary-precision serializer instead of converting the value throughNumber.
{
"phoneId": 190000000000000001,
"fileId": 820000000000000001
}Use POST /cloudphone/live/status to check whether the stream is running, and POST /cloudphone/live/end to stop it. Both accept { "phoneId": 190000000000000001 }.
- Call
POST /api/cloudphone/upload/file/signedUrl, then upload the MP4 bytes to the returnedpresignedUrlwith HTTPPUT. - Call
POST /api/cloudphone/upload/filewith the uploaded object URL, destination directory, anduploadType: 2. - Poll
POST /api/cloudphone/upload/file/result. Ifdataisnull, continue polling; stop whendata.statusis1or2. - Send the exact numeric value of the returned
data.fileIdtoPOST /api/cloudphone/live/start. Use/api/cloudphone/live/statusand/api/cloudphone/live/endto inspect or stop the stream.
See the Cloud Phone Open API and Cloud Phone Local API for complete schemas.
If a start request times out, query the status before retrying. Do not assume that a timeout means the stream did not start.
| Code | Meaning |
|---|---|
33300 | Cloud Phone does not exist |
33301 | Cloud Phone is not powered on |
33401 | This Cloud Phone does not support live streaming |
33418 | Live-streaming file does not exist or is no longer valid |
33419 | /cloudphone/uploadFile rejected a live-streaming file that is not MP4 |
99002 | The current member cannot operate this Cloud Phone |