All Products
Search
Document Center

ApsaraVideo Live:ModifyCasterComponent

Last Updated:Jun 06, 2024

Modifies a component of a production studio.

Usage notes

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. For more information, see QPS limits.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

ModifyCasterComponent

The operation that you want to perform. Set the value to ModifyCasterComponent.

CasterId

String

Yes

LIVEPRODUCER_POST-cn-0pp1czt****

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 Name column.

ComponentId

String

Yes

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

The ID of the component.

ComponentName

String

No

text01

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

ComponentType

String

No

text

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.

Effect

String

No

animateV

The display effect for the component. Valid values:

  • none (default)

  • animateH: horizontal scrolling

  • animateV: vertical scrolling

ComponentLayer

String

No

{"HeightNormalized":"1","PositionRefer":"topRight","WidthNormalized":"0","PositionNormalized":["0.1","0.2"]}

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

  • HeightNormalized: the normalized value of heights for the elements in the component layer

  • WidthNormalized: the normalized value of widths for the elements in the component layer

  • PositionNormalized: the normalized value of the coordinates of the component layer

  • PositionRefer: the reference coordinates of the component layer

TextLayerContent

String

No

{"BorderWidthNormalized":"1","SizeNormalized":"0.2","Color":"0x000000","FontName":"KaiTi","BorderColor":"0x000000","Text":"hello world!"}

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

Important

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.

ImageLayerContent

String

No

{"MaterialId":"6cf724c6ebfd4a59b5b3cec6f10d5ecf"}

The information about the image component. The value is a JSON string.

Important

This parameter is required if you set ComponentType to image.

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

CaptionLayerContent

String

No

{"BorderWidthNormalized":0.01,"SizeNormalized":0.05,"Color":"0x000000","LocationId":"RV01","SourceLan":"cn","FontName":"KaiTi","BorderColor":"0xffffff"}

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

Important

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 subtitle.

  • SourceLan: the source language of the subtitle in the video. Valid values: en (English), cn (Chinese), es (Spanish), and ru (Russian). Default value: cn.

  • TargetLan: the target language of the subtitle 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). Default value: cn.

  • 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 subtitle can be truncated. A value of false specifies that the subtitle 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.

Fonts used in a production studio

Font

Value for FontName

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 parameters

Parameter

Type

Example

Description

ComponentId

String

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

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

RequestId

String

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

The request ID.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=ModifyCasterComponent
&CasterId=LIVEPRODUCER_POST-cn-0pp1czt****
&ComponentId=05ab713c-676e-49c0-96ce-cc408da1****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyCasterComponentResponse>
    <ComponentId>05ab713c-676e-49c0-96ce-cc408da1****</ComponentId>
    <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
</ModifyCasterComponentResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For a list of error codes, see Service error codes.