All Products
Search
Document Center

ApsaraVideo Live:ModifyCasterComponent

Last Updated:Dec 09, 2024

Modifies a component of a production studio.

Operation description

You can call this operation to modify a text, image, or subtitle component.

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
live:ModifyCasterComponentupdate
*Caster
acs:live:*:{#accountId}:caster/{#CasterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CasterIdstringYes

The ID of the production studio.

  • If the production studio was created by calling the CreateCaster operation, check the value of the response parameter CasterId to obtain the ID.
  • If the production studio was created by using the ApsaraVideo Live console, obtain the ID on the Production Studio Management page. To go to the page, log on to the ApsaraVideo Live console and click Production Studios in the left-side navigation pane.
Note You can find the ID of the production studio in the Instance ID/Name column.
LIVEPRODUCER_POST-cn-0pp1czt****
ComponentIdstringYes

The ID of the component. If the component was added by calling the AddCasterComponent operation, check the value of the response parameter ComponentId to obtain the ID.

05ab713c-676e-49c0-96ce-cc408da1****
ComponentNamestringNo

The name of the component. By default, the name is the ID of the component.

text01
ComponentTypestringNo

The type of the component. Valid values:

  • text: text component. The TextLayerContent parameter is required if you set ComponentType to text.
  • image: image component. The ImageLayerContent parameter is required if you set ComponentType to image.
  • caption: subtitle component. The CaptionLayerContent parameter is required if you set ComponentType to caption.
text
EffectstringNo

The display effect for the component. Valid values:

  • none (default)
  • animateH: horizontal scrolling
  • animateV: vertical scrolling
animateV
ComponentLayerstringNo

The information about the component layer, such as the size and layout, The value must be a JSON string. This parameter contains the following fields:

  • HeightNormalized: the normalized value of the height of the component layer.
  • WidthNormalized: the normalized value of the width of the component layer.
  • PositionNormalized: the normalized value of the position of the component layer.
  • PositionRefer: the reference coordinates of the component layer.
{"HeightNormalized":"1","PositionRefer":"topRight","WidthNormalized":"0","PositionNormalized":["0.1","0.2"]}
TextLayerContentstringNo

The information about the text component. The value must be a JSON string. This parameter contains the following fields:

Note This parameter is required if you set ComponentType to text.
  • SizeNormalized: the normalized value of the font size. The value of this field equals the font size divided by the output height. Valid values: 0 to 1. The maximum font size is 1,024, even if the font size calculated based on this field is greater than 1,024.
  • BorderWidthNormalized: the normalized value of the border width. The value of this field equals the border width divided by the font size. Valid values: 0 to 1. Default value: 0. The maximum border width is 16, even if the border width calculated based on this field is greater than 16.
  • FontName: the font name. Default value: KaiTi. For more information about the valid values, see Fonts used in a production studio.
  • BorderColor: the color of the text border. Valid values: 0x000000 to 0xffffff. By default, this parameter is left empty. In this case, the color of the text border is transparent.
  • Text: the content of the text. By default, this parameter is left empty. In this case, the text contains no content.
  • Color: the color of the text. The default value is 0xff0000, which indicates that the text is in red.
{"BorderWidthNormalized":"1","SizeNormalized":"0.2","Color":"0x000000","FontName":"KaiTi","BorderColor":"0x000000","Text":"hello world!"}
ImageLayerContentstringNo

The information about the image component. The value must be a JSON string.

Note This parameter is required if you set ComponentType to image.

The MaterialId field specifies the ID of the material from the media asset library.

{"MaterialId":"6cf724c6ebfd4a59b5b3cec6f10d5ecf"}
CaptionLayerContentstringNo

The information about the subtitle component. The value must be a JSON string. This parameter contains the following fields:

Note This parameter is required if you set ComponentType to caption.
  • SizeNormalized: the normalized value of the font size. The value of this field equals the font size divided by the output height. Valid values: 0 to 1. The maximum font size is 1,024, even if the font size calculated based on this field is greater than 1,024.
  • BorderWidthNormalized: the normalized value of the border width. The value of this field equals the border width divided by the font size. Valid values: 0 to 1. Default value: 0. The maximum border width is 16, even if the border width calculated based on this field is greater than 16.
  • FontName: the font name. Default value: KaiTi. For more information about the valid values, see Fonts used in a production studio.
  • BorderColor: the color of the text border. Valid values: 0x000000 to 0xffffff. By default, this parameter is left empty. In this case, the color of the text border is transparent.
  • LocationId: the channel ID of the source subtitles.
  • SourceLan: the source language of the subtitles in the video. Valid values: en (English), cn (Chinese), es (Spanish), and ru (Russian). Default value: cn.
  • TargetLan: the target language of the subtitles in the video. If you do not specify this field, speech recognition is used. If you specify this field, translation is used. Valid values: en (English), cn (Chinese), es (Spanish), and ru (Russian).
  • ShowSourceLan: specifies whether to display the source language. A value of true specifies that the source language is displayed. A value of false specifies that the source language is not displayed. Default value: false.
  • Truncation: specifies whether to allow subtitle truncation. A value of true specifies that the subtitles can be truncated. A value of false specifies that the subtitles cannot be truncated. Default value: false.
  • SourceLanPerLineWordCount: the number of words displayed in each line of the source language. This field takes effect only if you set Truncation to true. Default value: 20.
  • TargetLanPerLineWordCount: the number of words displayed in each line of the target language. This field takes effect only if you set Truncation to true. Default value: 20.
{"BorderWidthNormalized":0.01,"SizeNormalized":0.05,"Color":"0x000000","LocationId":"RV01","SourceLan":"cn","FontName":"KaiTi","BorderColor":"0xffffff"}

Fonts used in a production studio

FontValues of FontName
KaiTiKaiTi
Alibaba PuHuiTi-RegularAlibabaPuHuiTi-Regular
Alibaba PuHuiTi-BoldAlibabaPuHuiTi-Bold
Alibaba PuHuiTi-LightAlibabaPuHuiTi-Light
Source Han Sans-RegularNotoSansHans-Regular
Source Han Sans-BoldNotoSansHans-Bold
Source Han Sans-LightNotoSansHans-Light

Response parameters

ParameterTypeDescriptionExample
object
ComponentIdstring

The ID of the component. You can use the ID as a request parameter in the API operation that is called to query components in a production studio.

05ab713c-676e-49c0-96ce-cc408da1****
RequestIdstring

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

Examples

Sample success responses

JSONformat

{
  "ComponentId": "05ab713c-676e-49c0-96ce-cc408da1****",
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HTTP status codeError codeError message
400InvalidUserId.Malformed%s
400InvalidCasterId.Malformed%s
400MissingParameter%s
400InvalidParameter.Malformed%s
400InvalidPositionNormalized.Malformed%s
401IllegalOperation%s
404InvalidCaster.NotFound%s
404InvalidComponent.NotFound%s
404CanvasNotExist%s
500InternalError%s

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history