如果你已使用 StartPushPublicStream 发布了一路公共流,你可以调用 UpdatePublicStreamParam 来更新任务的部分参数。
你可以调用 UpdatePublicStreamParam 接口,覆盖此前在 StartPushPublicStream 或 UpdatePublicStreamParam 中设定的参数。
如果你在调用 UpdatePublicStreamParam 时,没有传入对应的参数值,那么,这部分参数将被更新为参数的默认值。
例如,调用 UpdatePublicStreamParam 时,没有传入 Layout 参数,则公共流的布局模式将被更新为自动布局,即 Layout 的默认值。
如果你已使用 StartPushPublicStream 发布了一路公共流。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
QPS 不得超过 150。
使用 Post 方式发起请求。
以下是接口特有的请求参数。关于其他公共请求参数,参看请求参数。
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | UpdatePublicStreamParam | |
| Version | String | 是 | 2020-12-01 | OpenAPI 版本 |
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| AppId | String | 是 | 6xxxxxxxxxxxxxxxxxxxxx75 | 你的音视频应用的唯一标志 |
| BusinessId | string | 否 | BusinessId1 | 业务标识 |
| PublicStreamId | String | 是 | PublicStreamId1 | 公共流 ID。 |
| TargetStreams | Stream[] | 是 | 无 | 为公共流指定单路或多路媒体流及对应参数,Stream 数组。最高支持 17 路。 |
| ExcludeStreams | Stream[] | 否 | 无 | 你可以通过本参数排除掉不需要包含在公共流中的音视频流,即黑名单。参数默认为空。黑名单中的流不得超过 17 路。此参数中的 stream 不应和 TargetStreams 中重复。 |
| Layout | Layout | 否 | 房间内多路流合为一路时的布局参数 | |
| Encode | Encode | 否 | 媒体编码参数 | |
| Control | Control | 否 | / | 控制选项。 |
https://rtc.volcengineapi.com?Action=UpdatePublicStreamParam&Version=2020-12-01
postscript{
"AppId": "Your_AppId",
"BusinessId": "Your_BusinessId",
"PublicStreamId": "PublicStreamId",
"TargetStreams": [
{
"Index": 0,
"UserId": "Your_UserId_3",
"RoomId": "Your_RoomId",
"StreamType": 1,
"MediaType": 0
},
{
"Index": 1,
"UserId": "Your_UserId_3",
"RoomId": "Your_RoomId",
"StreamType": 1,
"MediaType": 0
}
],
"Encode": {
"VideoConfig": {
"Width": 640,
"Height": 480,
"FrameRate": 15,
"Bitrate": 256
}
},
"Layout": {
"LayoutMode": 2,
"CustomLayout": {
"Regions": [
{
"StreamIndex": 0,
"LocationX": 0,
"LocationY": 0,
"WidthProportion": 0.5,
"HeightProportion": 1,
"Zorder": 0,
"Alpha": 1,
"RenderMode": 0
},
{
"StreamIndex": 1,
"LocationX": 0.5,
"LocationY": 0,
"WidthProportion": 0.5,
"HeightProportion": 1,
"Zorder": 1,
"Alpha": 1,
"RenderMode": 1,
"AlternateImage": "https://xx.com/img/1.jpg",
"SourceCrop": {
"LocationX": 500,
"LocationY": 0,
"WidthProportion": 0.5,
"HeightProportion": 0.5
}
}
],
"FrameInterpolationMode": 0,
"BackgroundColor": "#000000",
"BackgroundImage": "https://xx.com/img/1.jpg"
}
},
"Control": {
"SEIMsg": "CamInfo"
}
}
json返回值 Result 仅在请求成功时返回"ok",失败时返回错误码和相关信息。
{
"Result": "ok",
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "UpdatePublicStreamParam",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-north-1"
}
}
json