Start Cloud Player (Legacy)
Note
- This API is deprecated as of 2022.11.17. Please use the new Cloud Player APIs (Start Playback, Stop Playback) instead.
- If your business requires Cloud Recording, note that RC server does not parse the resolution of media streams input via the legacy Cloud Player API, which may result in recordings not matching the actual stream resolution. For resolution-aware recording, use the new Cloud Player APIs.
This API injects an online media stream into a specified RTC room. It requires virtual user credentials, along with configurations like stream URL, resource type, and room ID. Upon success, other room participants can subscribe to this stream using the same method as subscribing to peer-published resources.
Service Activation
Before using Cloud Player APIs, ensure the service is activated. Navigate to the Cloud Player page in Console to enable it.
Request Method
Note
This API is deprecated as of 2022.11.17.
POST: http://api.rong-api.com/v2/rtc/cloudplayer/rtmp/start
Signature Rule: All requests to RC server APIs require validation. See API Request Signature for details.
Request Body
The HTTP request body contains a JSON object with the following structure:
Parameter | Type | Description | Notes |
---|---|---|---|
user_id | String | User ID for the call. | |
user_name | String | Username. | |
media_type | Number | Media type. 0 for audio-video, 1 for audio-only, 2 for video-only. | |
room_type | Number | Room type. 0 for standard RTC room, 2 for live streaming room. | |
rtmp_url | String | Public URL of the media stream. | |
callback_url | String | Callback URL. RTMP status updates will be sent to this address. |
Request Example
POST http://api.rong-api.com/v2/rtc/cloudplayer/rtmp/start HTTP/1.1
Host: api.rong-api.com
App-Key: XXX
RC-Nonce: 1027489915
RC-Timestamp: 1609754958
RC-Signature: 357cef9b529edd1ed4f34bd8df52de00a909914b
Room-Id: 123
Content-Type: application/json
{
"user_id": "xxx",
"user_name": "xxx",
"rtmp_url": "rtmp://xxx",
"media_type":0,
"room_type":2,
"callback_url":"http://xxx"
}
Response
The HTTP response body contains a JSON object with the following field:
code
: Business status code.10000
indicates success.
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code":10000
}