Media Pull
构建时从公开 REST 接口定义的 `media-pull` 标签生成:方法、路径、参数、请求体、响应与 curl。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 media-pull,共 6 个操作(全量 189 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
GET | /v1/projects/{appId}/cloud-player/players | List the cloud players of a project |
POST | /{region}/v1/projects/{appId}/cloud-player/players | Create a cloud player |
GET | /{region}/v1/projects/{appId}/cloud-player/players/{id} | Get one cloud player |
PATCH | /{region}/v1/projects/{appId}/cloud-player/players/{id} | Update a cloud player |
DELETE | /{region}/v1/projects/{appId}/cloud-player/players/{id} | Destroy a cloud player |
PATCH | /{region}/v1/projects/{appId}/cloud-player/{playerid} | Update a cloud player (legacy path spelling) |
操作详情
GET /v1/projects/{appId}/cloud-player/players
List the cloud players of a project
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
filter | query | string | ||
pageSize | query | integer | 1..500,默认 200 | |
pageToken | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | cloud players — object{ totalSize, players, fields, nextPageToken } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/projects/appId/cloud-player/players?filter=value&pageSize=0&pageToken=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /{region}/v1/projects/{appId}/cloud-player/players
Create a cloud player
Creates a player that pulls an online media stream into an RTC channel as a user. The player is connecting until the injected participant is observed in the channel, then running.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
streamIp | query | string | format ipv4 |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
player | object | 是 |
{
"player": {
"streamUrl": "string",
"channelName": "weekly-sync",
"uid": 1,
"account": "string"
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | player created — object{ player, fields } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
409 | a cloud player with the same name already exists — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/cloud-player/players?streamIp=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"player":{"streamUrl":"string","channelName":"weekly-sync","uid":1,"account":"string"}}'GET /{region}/v1/projects/{appId}/cloud-player/players/{id}
Get one cloud player
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
id | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the cloud player — object{ player, fields } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/cloud-player/players/weekly-sync_1a2b" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PATCH /{region}/v1/projects/{appId}/cloud-player/players/{id}
Update a cloud player
Changes the source address, the transcoding options, the playback position or the paused state.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
id | path | 是 | string | 长度 0..128 |
sequence | query | integer | >= 0 |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
player | object{ streamUrl, audioOptions, videoOptions, seekPosition, isPause } |
{
"player": {
"streamUrl": "string",
"audioOptions": {},
"videoOptions": {}
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the request succeeded; the response body is empty |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X PATCH "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/cloud-player/players/weekly-sync_1a2b?sequence=0" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"player":{"streamUrl":"string","audioOptions":{},"videoOptions":{}}}'DELETE /{region}/v1/projects/{appId}/cloud-player/players/{id}
Destroy a cloud player
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
id | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the request succeeded; the response body is empty |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/cloud-player/players/weekly-sync_1a2b" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PATCH /{region}/v1/projects/{appId}/cloud-player/{playerid}
Update a cloud player (legacy path spelling)
Documented legacy spelling of the player update; identical behaviour to /cloud-player/players/{id}.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
playerid | path | 是 | string | 长度 0..128 |
sequence | query | integer | >= 0 |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
player | object{ streamUrl, audioOptions, videoOptions, seekPosition, isPause } |
{
"player": {
"streamUrl": "string",
"audioOptions": {},
"videoOptions": {}
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the request succeeded; the response body is empty |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X PATCH "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/cloud-player/playerid?sequence=0" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"player":{"streamUrl":"string","audioOptions":{},"videoOptions":{}}}'本分组用到的 Schema
Error — object{ code, message, reason, sdkCode, details }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | string | 是 | stable machine code, see errors.json |
message | string | 是 | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |