Adds a component to a production studio.
Operation description
Before calling this operation, create a production studio and review its layout list. This operation adds components such as images, text, and captions. For more information about creating a production studio using an API call, see Create a production studio.
QPS limit
The queries per second (QPS) limit for a single user is 10. If you exceed this limit, API calls are throttled. This may affect your business. Plan your calls accordingly.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:AddCasterComponent |
create |
*Caster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The ID of the region. |
cn-shanghai |
| CasterId |
string |
Yes |
The ID of the production studio.
Note
The name of the production studio in the list on the Cloud Production Studio page is the production studio ID. |
LIVEPRODUCER_POST-cn-0pp1czt**** |
| ComponentName |
string |
No |
The name of the component. The default value is the component ID. |
text01 |
| LocationId |
string |
Yes |
Specifies the position of the component. Each position can hold only one component. The format must be RC01 to RC99. Note
If the component type is caption, this parameter specifies the location of the referenced video source. |
RC01 |
| ComponentType |
string |
Yes |
The type of component. Valid values:
|
text |
| Effect |
string |
No |
The display effect of the component. Valid values:
|
animateH |
| ComponentLayer |
string |
Yes |
The size, layout, and other information about the component layer. The elements are described as follows:
The value is a JSON-formatted string. Parameter names must be in upper-camel case. |
{"HeightNormalized":"1","PositionRefer":"topRight","WidthNormalized":"0","PositionNormalized":["0.1","0.2"]} |
| LayerOrder |
string |
No |
The layer order of the component.
|
cover |
| TextLayerContent |
string |
No |
The properties of the layer element. The properties are described as follows: Important This parameter is required only when ComponentType is set to text.
The value must be a JSON-formatted string. Parameter names must be in upper-camel case. |
{"BorderWidthNormalized":"1","SizeNormalized":"0.2","Color":"0x000000","FontName":"KaiTi","BorderColor":"0x000000","Text":"hello world!"} |
| ImageLayerContent |
string |
No |
The properties of the layer element. The properties are described as follows: Important This parameter is required when ComponentType is set to image. MaterialId: The ID of the media asset. The name that you specify when you upload a media asset is used as the ID of the media asset. The value must be a JSON-formatted string. Parameter names must be in upper-camel case. |
{"MaterialId":"6cf724c6ebfd4a59b5b3cec6f10d****"} |
| CaptionLayerContent |
string |
No |
The properties of the layer element. The properties are described as follows: Important This parameter is required when ComponentType is set to caption.
The value must be a JSON-formatted string. Parameter names must be in upper-camel case. |
{"BorderWidthNormalized":0.01,"SizeNormalized":0.05,"Color":"0x000000","LocationId":"RV01","SourceLan":"cn","FontName":"KaiTi","BorderColor":"0xffffff"} |
| HtmlLayerContent |
string |
No |
The configuration of the H5 component. |
{"htmlUrl":http://caster.example.com} |
Production studio fonts
| Font | FontName value |
| KaiTi | KaiTi |
| Alibaba PuHuiTi - Regular | AlibabaPuHuiTi-Regular |
| Alibaba PuHuiTi - Bold | AlibabaPuHuiTi-Bold |
| Alibaba PuHuiTi - Light | AlibabaPuHuiTi-Light |
| Source Han Sans - Regular | NotoSansHans-Regular |
| Source Han Sans - Bold | NotoSansHans-Bold |
| Source Han Sans - Light | NotoSansHans-Light |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ComponentId |
string |
The component ID. Use this ID to query, modify, or delete the component. |
21926b36-7dd2-4fde-ae25-51b5bc8e**** |
| RequestId |
string |
The request ID. |
16A96B9A-F203-4EC5-8E43-CB92E68F4CD8 |
Examples
Success response
JSON format
{
"ComponentId": "21926b36-7dd2-4fde-ae25-51b5bc8e****",
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidUserId.Malformed | %s, please check userId. | The userId passed in is invalid, please check. |
| 400 | InvalidCasterId.Malformed | %s, please check and try again later. | The parameter CasterId is invalid, please check and try again. |
| 400 | MissingParameter | %s. | Missing parameter |
| 400 | InvalidParameter.Malformed | There are invalid parameters: %s. | There are invalid parameters: %s. |
| 400 | InvalidPositionNormalized.Malformed | %s, please check and try again later. | The parameter PositionNormalized is invalid, please check and try again. |
| 400 | DuplicateLocationID | %s, please check and try again later. | The parameter LocationID duplicate. Check and try again. |
| 401 | IllegalOperation | %s, please check and try again later. | Operation not allowed, please check and try again. |
| 500 | InternalError | %s, please try again later. | Internal error, please try again later. |
| 404 | InvalidCaster.NotFound | %s, please check and try again later. | The guide station does not exist, please check and try again. |
| 404 | CanvasNotExist | %s, please check and try again later. | Canvas does not exist, please check and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.