ModifyCasterLayout

Updated at:
Copy as MD

Modifies a layout configuration. Only the items to be modified need to be passed. Items that do not require modification do not need to be included.

Operation description

Create a production studio by calling the CreateCaster operation first, and then call this operation to modify the layout configuration. Only the items to be modified need to be passed. Items that do not require modification do not need to be included. This operation currently supports the following element fill modes: default and adaptive.

QPS limit

The single-user QPS limit for this operation is 10 calls per second. If the limit is exceeded, the API call is throttled, which may affect your business. Call this operation appropriately.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

live:ModifyCasterLayout

update

*Caster

acs:live:*:{#accountId}:caster/{#CasterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

cn-shanghai

VideoLayer

array<object>

Yes

The video information.

object

No

The video information.

FillMode

string

No

The element fill mode.

  • none (default): no fill. The Layer settings are configured with the image as the target.

  • fit: adaptive. The Layer settings are configured with the fill area (box) as the target. The image is scaled based on the original aspect ratio and centered within the fill area (box) using a long-edge alignment method. If the aspect ratio of the fill area does not match the image, the short edges are not filled (the lower Layer image is displayed. If no lower Layer is configured, the default black background is displayed).

fit

FixedDelayDuration

integer

No

The fixed delay for the video. This can be used for subtitle synchronization. Unit: milliseconds. Default value: 0. Valid values: 0 to 5000.

5000

HeightNormalized

number

No

The normalized height ratio of the Layer element.

  • If the no-fill mode is used, the width of the element is proportionally scaled based on this height. Default value: 0, which indicates that the image is displayed at its original size.

  • If the adaptive mode is used, this field is required and must be greater than 0. It specifies the normalized height ratio of the fill area (box).

1

PositionNormalized

array

No

The normalized position values [x,y] of the Layer element. Default value: [0,0].

Note

Note: The x and y values must be normalized.

0.3

number

No

The normalized position values [x,y] of the Layer element. Default value: [0,0].

Note

Note: The x and y values must be normalized.

0.5

PositionRefer

string

No

The reference coordinate for the position of the element. Valid values:

  • topLeft (default): top-left.

  • topRight: top-right.

  • bottomLeft: bottom-left.

  • bottomRight: bottom-right.

  • center: center.

  • topCenter: top-center.

  • bottomCenter: bottom-center.

  • leftCenter: left-center.

  • rightCenter: right-center.

topLeft

WidthNormalized

number

No

The normalized width ratio of the Layer element.

  • If the no-fill mode is used, the height of the element is proportionally scaled based on this width. Default value: 0, which indicates that the image is displayed at its original size.

  • If the adaptive mode is used, this field is required and must be greater than 0. It specifies the normalized width ratio of the fill area (box).

1

AudioLayer

array<object>

Yes

The audio information.

object

No

The audio information.

FixedDelayDuration

integer

No

The fixed delay for the audio. This can be used for subtitle synchronization. Unit: milliseconds. Default value: 0. Valid values: 0 to 5000.

5000

ValidChannel

string

No

The audio channels that can be used as volume input. Valid values:

  • leftChannel: left channel.

  • rightChannel: right channel.

  • all (default): both channels.

all

VolumeRate

number

No

The normalized height ratio of the Layer element. The width of the element is proportionally scaled based on this height.

Default value: 0, which indicates that the element is displayed at its original size.

1

BlendList

array

Yes

The location ID (LocationId) of the video resource element.

For the LocationId, see Add a video source. The elements correspond to the VideoLayers elements in order.

RV02

string

No

The location ID (LocationId) of the video resource element.

For the LocationId, see Add a video source. The elements correspond to the VideoLayers elements in order.

RV02

MixList

array

Yes

The location ID (LocationId) of the audio resource element.

For the LocationId, see Add a video source. The elements correspond to the AudioLayers elements in order.

RV02

string

No

The location ID (LocationId) of the audio resource element.

For the LocationId, see Add a video source. The elements correspond to the AudioLayers elements in order.

RV02

CasterId

string

Yes

The production studio ID.

  • If you created the production studio by calling the CreateCaster operation, check the CasterId parameter returned by the CreateCaster operation.

  • If you created the production studio in the ApsaraVideo Live console, go to ApsaraVideo Live console > Production Studio > Cloud Production Studio to view the ID.

Note

The production studio name in the production studio list on the Cloud Production Studio page of the ApsaraVideo Live console is the production studio ID.

LIVEPRODUCER_POST-cn-0pp1czt****

LayoutId

string

Yes

The layout ID. If you added the production studio layout by calling the AddCasterLayout operation, check the LayoutId parameter returned by the AddCasterLayout operation.

21926b36-7dd2-4fde-ae25-51b5bc8e****

Note

N in the request parameters indicates the sequence number of the element. For example, VideoLayer.N.FillMode specifies the fill mode of the Nth element. VideoLayer.1.FillMode specifies the fill mode of the first element, and VideoLayer.2.FillMode specifies the fill mode of the second element.

Response elements

Element

Type

Description

Example

object

LayoutId

string

The layout ID. This can be used as a request parameter to query the list of production studio layouts.

21926b36-7dd2-4fde-ae25-51b5bc8e****

RequestId

string

The request ID.

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

Examples

Success response

JSON format

{
  "LayoutId": "21926b36-7dd2-4fde-ae25-51b5bc8e****",
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidCasterId.Malformed %s, please check and try again later. The parameter CasterId is invalid, please check and try again.
400 InvalidUserId.Malformed %s, please check userId. The userId passed in is invalid, please check.
400 InvalidLayoutId.Malformed %s, please check and try again later. The LayoutId is invalid, please check and try again.
400 InvalidParameter.Malformed There are invalid parameters: %s. There are invalid parameters: %s.
400 InvalidVideoLayersAndBlendListSize.Mismatch %s, please check and try again later. The size of the VideoLayers does not match the size of the BlendList, please check and try again.
400 InvalidAudioLayersAndMixListSize.Mismatch %s, please check and try again later. The size of the AudioLayers does not match the size of the MixList, please check and try again.
400 InvalidPositionNormalized.Malformed %s, please check and try again later. The parameter PositionNormalized is invalid, please check and try again.
400 InvalidBlendList.ExceedNorm %s, please check and try again later. BlendList size exceeds specification, please check and try again.
400 InvalidMixList.ExceedNorm %s, please check and try again later. MixList size exceeds specification, please check and try again.
400 InvalidHeightOrWidthNormalized %s, please check and try again later. HeightNormalized or WidthNormalized parameters are invalid, please check and try again.
400 InvalidVideoLayersConfig %s, please check and try again later. The size of the VideoLayers does not match the size of the BlendList, please check and try again.
400 InvalidAudioLayersConfig %s, please check and try again later. The size of the AudioLayers does not match the size of the MixList, please 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 InvalidLayout.NotFound %s, please check and try again later. LayoutId does not exist, please check and try again.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.