logo
On this page

UpdateLayout

POST

https://cloudrecord-api.zego.im/

During the recording process, you can call this API at any time to change the stream mixing layout settings.

Note
Call frequency limit: 10 times/second

Request

Query Parameters

    Action stringrequired

    Possible values: [UpdateLayout]

    API prototype parameter

    https://cloudrecord-api.zego.im?Action=UpdateLayout

    AppId uint32required

    💡Common parameter. Application ID, a unique credential assigned by ZEGOCLOUD. You can obtain it from the ZEGOCLOUD Console.

    SignatureNonce stringrequired

    💡Common parameter. A 16-character hexadecimal random string (hex encoding of an 8-byte random number). For the generation algorithm, refer to Signature Example.

    Timestamp int64required

    💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to Signature Example. A maximum error of 10 minutes is allowed.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Common parameter. Signature version number.

    Signature stringrequired

    💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to Signature Mechanism for generation.

Body

required
    TaskId stringrequired

    Recording task ID, a fixed-length string of 16 bytes.

    MixMode integer

    Possible values: [1, 2, 3, 4, 5]

    Default value: 2

    Layout mode.

    • 1: Custom layout, MixInputList must be specified
    • 2: Equal division layout (default)
    • 3: Horizontal layout
    • 4: Vertical layout
    • 5: Floating layout
    MixInputList object[]
    Custom layout parameters.
  • Array[
  • StreamId string

    Specifies the streamID to be displayed in this view. If not specified, streams will be matched in the order they join the room.

    ViewType integer

    Possible values: [1, 2]

    Default value: 1

    The type of content displayed in this view.

    • 1: Audio and video (default)
    • 2: Whiteboard

    Type 2 is only valid when whiteboard recording is enabled. Only one view can be set as whiteboard; setting two or more will return an error.

    Top integerrequired

    Possible values: >= 0 and <= 1920

    The y-axis coordinate of the top-left corner of this view on the canvas. Value range is [0, 1920], cannot exceed the Bottom value and the canvas height.

    Left integerrequired

    Possible values: >= 0 and <= 1920

    The x-axis coordinate of the top-left corner of this view on the canvas. Value range is [0, 1920], cannot exceed the Right value and the canvas width.

    Bottom integerrequired

    Possible values: >= 0 and <= 1920

    The y-axis coordinate of the bottom-right corner of this view on the canvas. Value range is [0, 1920], cannot exceed the canvas height.

    Right integerrequired

    Possible values: >= 0 and <= 1920

    The x-axis coordinate of the bottom-right corner of this view on the canvas. Value range is [0, 1920], cannot exceed the canvas width.

    Layer integerrequired

    The layer priority of this view. When two views overlap, the one with a larger value is displayed on top.

    FillMode integer

    Possible values: [1, 2]

    Default value: 1

    How to handle when the actual video stream aspect ratio is inconsistent with the view.

    • 1: Crop mode. In this mode, priority is given to ensuring the view is filled. After the original video is scaled proportionally to fill the view, content exceeding the view on all sides will be cropped. (Default)
    • 2: Scale mode. In this mode, priority is given to ensuring the integrity of the original video. After the original video is scaled proportionally to fill the view, black borders will be added on all sides.
    BackgroundImage string

    The URL address of the stream view background image, only takes effect when the [StreamId] parameter is specified. This background image will be displayed when the stream specified in the custom layout does not exist or the stream is interrupted.

    • It is recommended that the background image resolution matches the stream view resolution. If the two resolutions are inconsistent, the background image will be stretched or compressed to fill the entire view.
    • Background image format supports JPG and PNG, size cannot exceed 5MB. If the background image download fails, the setting will not take effect.
    • URL supports HTTP and HTTPS protocols.
  • ]
  • MixMaxResolutionStreamId string

    When MixMode is set to 3, 4, or 5, used to specify the stream ID to display in the large view.

Responses​

OK
Schema
    Code int64

    Error code.

    Message string

    Error description.

    RequestId string

    Request ID.

Previous

Stop recording

Next

Update the whiteboard layout

On this page

Back to top