Configures a layout for a virtual studio.
Operation description
You can call this operation to configure a common layout or a studio layout for a virtual studio.
QPS limit
You can call this operation up to 10 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
live:AddStudioLayout | create | *Caster acs:live:*:{#accountId}:caster/{#CasterId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
CasterId | string | Yes | The ID of the production studio. Note
The production studio must be a virtual studio that you create in advance. You can use the ApsaraVideo Live console or call the CreateCaster operation to create a virtual studio.
Note
You can find the ID of the production studio in the Instance ID/Name column.
| a2b8e671-2fe5-4642-a2ec-bf93880e**** |
LayoutName | string | Yes | The name of the layout. | Test layout |
LayoutType | string | Yes | The type of the layout. Valid values:
| studio |
CommonConfig | string | No | The common layout configurations. The value is a JSON string. For more information, see CommonConfig. Note
This parameter is required only if you set LayoutType to common.
| {"ChannelId":"RV01" } |
BgImageConfig | string | No | The background material configurations. The value is a JSON string. For more information, see BgImageConfig. Note
This parameter is required only if you set LayoutType to studio.
| { "Id":"k12kj31****", "MaterialId":"f080575eb5f4427684fc0715159a****" } |
ScreenInputConfigList | string | No | The input configurations for chroma key. The value is a JSON string. For more information, see ScreenInputConfig. Note
This parameter is required only if you set LayoutType to studio.
| [ { "Index":"1", "ChannelId":"RV01", "Color":"green", "PositionX":"0.1", "PositionY":"0.2", "HeightNormalized":"0.4" } ] |
MediaInputConfigList | string | No | The multimedia input configurations. The value is a JSON string. For more information, see MediaInputConfig. Note
This parameter is optional and is valid only if you set LayoutType to studio.
| [ { "Id":"k12kj31****", "Index":"1", "ChannelId":"RV01", "FillMode":"none", "PositionRefer":"topLeft", "WidthNormalized":"0.4", "HeightNormalized":"0.4", "PositionNormalized":"[0.1, 0.2]" }, { "Id":"k12kj31****", "Index":"2", "ImageMaterialId":"lkajsdfsa8fd89asd8****", "FillMode":"none", "PositionRefer":"topLeft", "WidthNormalized":"0.6", "HeightNormalized":"0.4", "PositionNormalized":"[0.1, 0.2]" } ] |
LayerOrderConfigList | string | No | The layer sorting configurations. The value is a JSON string. For more information, see layerOrderConfig. You can sort layers of background and multimedia materials. The chroma key layer cannot be sorted. A layer that is in the front of the code is placed behind other layers in the layout. | [ { "Type":"media", "Id":"k12kj31****" }, { "Type":"media", "Id":"k12kj31****" } ] |
CommonConfig
Field | Type | Example | Description |
---|---|---|---|
ChannelId | String | RV01 | The ID of the channel that you want to bind to the video resource. |
BgImageConfig
Note You can specify either ImageUrl or MaterialId.
Field | Type | Example | Description |
---|---|---|---|
Id | String | k12kj31**** | The unique ID of the material. |
ImageUrl | String | http://aliyundoc.com | The URL of the material. |
MaterialId | String | f080575eb5f4427684fc0715159a**** | The ID of the material in ApsaraVideo VOD. |
ScreenInputConfig
Field | Type | Example | Description |
---|---|---|---|
Index | Integer | 1 | The sequence number of the chroma key source. This parameter is displayed on the frontend but not used in the operation logic. The value must be a positive integer. |
ChannelId | String | RV01 | The ID of the channel that you want to bind to the video resource. |
Color | String | green | The color gamut for chroma key. Valid values:blue green auto: automatic recognition complex: background replacement |
PositionX | Float | 0.1 | The x-coordinate of the material. Valid values: 0 to 1.The upper-left corner is used as the coordinate origin for the material. |
PositionY | Float | 0.2 | The y-coordinate of the material. Valid values: 0 to 1.The upper-left corner is used as the coordinate origin for the material. |
HeightNormalized | Float | 0.4 | The normalized value of the height. The value indicates the ratio of the height of the keyed portrait to the height of the background. Valid values: 0 to 1. |
MediaInputConfig
- If the multimedia material is a video, specify ChannelId.
- If the multimedia material is an image, specify ImageMeterialId.
- ChannelId and ImageMeterialId are mutually exclusive. You can specify only one of them.
Field | Type | Example | Description |
---|---|---|---|
Id | String | k12kj31**** | The unique ID of the multimedia material. |
Index | Integer | 1 | The sequence number of the multimedia material. This parameter is displayed on the frontend but not used in the operation logic. The value must be a positive integer. |
ChannelId | String | RV01 | The ID of the channel that you want to bind to the video resource. |
ImageMaterialId | String | lkajsdfsa8fd89asd8**** | The ID of the image in ApsaraVideo VOD. |
FillMode | String | none | The fill type. Set this parameter to none. |
PositionRefer | String | topLeft | The coordinate origin for the material. Set this parameter to topLeft to specify the upper-left corner as the coordinate origin. |
WidthNormalized | Float | 0.4 | The normalized value of the material width. The value indicates the ratio of the material width to the width of the background. Valid values: 0 to 1. |
HeightNormalized | Float | 0.4 | The normalized value of the material height. The value indicates the ratio of the material height to the height of the background. Valid values: 0 to 1. |
PositionNormalized | Float | [0.1, 0.2] | The normalized value of the position of the material, in the format of [x,y]. Valid values of x and y: 0 to 1.For example, [0.1,0.2] indicates that the material is horizontally offset by 10% and vertically offset by 20% towards the upper-left corner. |
LayerOrderConfig
Field | Type | Example | Description |
---|---|---|---|
Type | String | media | The type of the resource. Valid values:background: the background materialmedia: the multimedia material |
Id | String | k12kj31**** | The unique ID of the resource. |
Response parameters
Examples
Sample success responses
JSON
format
{
"LayoutId": "445409ec-7eaa-461d-8f29-4bec2eb9****",
"RequestId": "5c6a2a0d-f228-4a64-af62-20e91b96****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | MissingParameter | %s |
400 | InvalidParameter.Malformed | %s |
400 | InvalidCasterId.Malformed | %s |
400 | InvalidUserId.Malformed | %s |
400 | InvalidPositionNormalized.Malformed | %s |
400 | InvalidHeightOrWidthNormalized | %s |
401 | IllegalOperation | %s |
404 | InvalidCaster.NotFound | %s |
500 | InternalError | %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|