Call the AddCasterComponent operation to add a component to a production studio.
Operation description
Before you call this operation, create a production studio and review its layout list. This operation adds image, text, and caption components. For more information about how to create a production studio by calling an API, 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, which 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 |
| CasterId |
string |
Yes |
The ID of the region. |
LIVEPRODUCER_POST-cn-0pp1czt**** |
| ComponentName |
string |
No |
The production studio ID.
Note
The name of the production studio in the list on the Cloud Production Studio page is the production studio ID. |
text01 |
| LocationId |
string |
Yes |
The name of the component. The default value is the component ID. |
RC01 |
| ComponentType |
string |
Yes |
Specifies the component's position. The format is RC01 to RC99. Each position can hold only one component. Note If the component type is caption, this parameter specifies the Location of the referenced video source. |
text |
| Effect |
string |
No |
The type of component. Valid values:
|
animateH |
| ComponentLayer |
string |
Yes |
The effect of the component. Valid values:
|
{"HeightNormalized":"1","PositionRefer":"topRight","WidthNormalized":"0","PositionNormalized":["0.1","0.2"]} |
| LayerOrder |
string |
No |
The size and layout of the component layer. The layout is defined by the following elements:
The value is a JSON string. Use upper camel case for field names. |
cover |
| TextLayerContent |
string |
No |
The layer order of the component.
|
{"BorderWidthNormalized":"1","SizeNormalized":"0.2","Color":"0x000000","FontName":"KaiTi","BorderColor":"0x000000","Text":"hello world!"} |
| ImageLayerContent |
string |
No |
The properties of the layer element are 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 UpperCamelCase. |
{"MaterialId":"6cf724c6ebfd4a59b5b3cec6f10d****"} |
| CaptionLayerContent |
string |
No |
The properties of the layer component. Important This parameter is required when ComponentType is set to image. MaterialId: The ID of the media asset. This is the name assigned to the asset during upload. The value is a JSON string. The parameter names must be in UpperCamelCase. |
{"BorderWidthNormalized":0.01,"SizeNormalized":0.05,"Color":"0x000000","LocationId":"RV01","SourceLan":"cn","FontName":"KaiTi","BorderColor":"0xffffff"} |
| HtmlLayerContent |
string |
No |
The properties of the layer element are as follows: Important This parameter is required when ComponentType is set to caption.
The value must be a JSON-formatted string. The property names must be in UpperCamelCase. |
{"htmlUrl":http://caster.example.com} |
Cloud Director 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.