On this page

UpdatePlayer

2026-03-31
POST

https://cloud-player-api.zego.im/

Call this API to update the playback progress, audio transcoding parameters, video transcoding parameters, and other information of the specified cloud player.

Note
Call frequency limit: 20 times/second

Request

Query Parameters

    Action stringrequired

    Possible values: [UpdatePlayer]

    API prototype parameter

    https://cloud-player-api.zego.im?Action=UpdatePlayer

    AppId uint32required

    💡Common parameter. Application Id, a unique user credential assigned by ZEGOCLOUD. Can be obtained from ZEGOCLOUD Console.

    SignatureNonce stringrequired

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

    Timestamp int64required

    💡Common parameter. Current Unix timestamp, unit is seconds. For the generation algorithm, please 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
    PlayerId stringrequired

    Cloud player unique identifier ID, returned by CreatePlayer. When calling this API, please ensure that the PlayerId exists, otherwise an error may occur.

    Sequence numberrequired

    Request sequence number, used to ensure timing. Parameter modifications for the same player task need to ensure the sequence number is incremented. For example, "Sequence": 1. The ZEGOCLOUD server will update the cloud player according to the latest configuration.

    StreamUrl string

    Possible values: <= 1024 characters

    Address of the media resource, must be a valid HTTP/HTTPS address with a length within 1024 bytes.

    Warning

    This needs to be selected based on whether a single player or a list player was created when creating a cloud player.

    • When creating a single player, the StreamUrl parameter is optional, StreamUrlList is not optional;
    • When creating a list player, the StreamUrlList parameter is optional, StreamUrl is not optional.

    If StreamUrl or StreamUrlList is filled in here, other parameters will be ignored.

    StreamUrlList string[]

    Media resource list address. Updating the list will reset the media resource list and immediately start playing from the first resource in the new list.

    Warning

    This needs to be selected based on whether a single player or a list player was created when creating a cloud player.

    • When creating a single player, the StreamUrl parameter is optional, StreamUrlList is not optional;
    • When creating a list player, the StreamUrlList parameter is optional, StreamUrl is not optional.

    If StreamUrl or StreamUrlList is filled in here, other parameters will be ignored.

    BackupStreamUrl string

    Possible values: <= 1024 characters

    Backup address of the media resource, must be a valid HTTP/HTTPS address with a length within 1024 bytes. When the address in the StreamUrl parameter fails to access, the cloud player will attempt to access the backup address.

    VideoOptions object
    Video transcoding parameter configuration.Please note that when this parameter is not filled in, the configuration from the last call to this API or when the cloud player was created will be used by default.
    Width number

    Possible values: >= 1 and <= 3000

    Video width, value range is [1, 3000], unit is px, default value is the width of the original media resource.

    Note

    • When an odd value is passed in the range, it will be automatically rounded up to an even number.
    • When either Width or Height parameter is set to 1, it means audio-only stream publishing.
    Height number

    Possible values: >= 1 and <= 3000

    Video height, value range is [1, 3000], unit is px, default value is the height of the original media resource.

    Note

    • When an odd value is passed in the range, it will be automatically rounded up to an even number.
    • When either Width or Height parameter is set to 1, it means audio-only stream publishing.
    ShortEdge int

    Possible values: >= 0 and <= 2160

    Video short edge length, value range is [0,2160], unit is px. Default value is 0, indicating that the short edge adaptive feature is not enabled.

    Note

    • When an odd value is passed in the range, it will be automatically rounded up to an even number.
    • Once the short edge adaptive feature is enabled, it can only be updated, and cannot be cancelled.
    • When both ShortEdge and Width/Height are set, Width/Height takes precedence.
    • After calculating the short edge, the resolution cannot exceed 4k(3840*2160), otherwise the original media resource width and height will be used.
    VideoBitrate number

    Possible values: >= 1 and <= 50000

    Video bitrate, value range is [1, 50000], unit is kbps. Please note that when this parameter is not filled in, the configuration from the last call to this API or when the cloud player was created will be used by default.

    AudioOptions object
    Audio transcoding parameter configuration.Please note that when this parameter is not filled in, the configuration from the last call to this API or when the cloud player was created will be used by default.
    AudioBitrate number

    Possible values: >= 1 and <= 192

    Audio bitrate, range is [1, 192], unit is kbps. Please note that when this parameter is not filled in, the configuration from the last call to this API or when the cloud player was created will be used by default.

    Volume number

    Possible values: >= 0 and <= 200

    Volume value, range is [0, 200]. Please note that when this parameter is not filled in, the configuration from the last call to this API or when the cloud player was created will be used by default.

    SeekTo number

    Specify playback progress (seconds). Please note that when this parameter is not filled in, the configuration from the last call to this API or when the cloud player was created will be used by default.

    IsPause number

    Possible values: [0, 1]

    Whether to pause playback.

    • 0: Play source file normally.
    • 1: Pause playing source file.

    Warning

    When setting pause playback, the StreamUrl parameter cannot be passed, otherwise other parameter configurations will be ignored, causing pause playback to fail.

    RepeatTimes number

    Number of playbacks.

    • 1: Play media stream 1 time.
    • -1: Automatically loop playback.
    • n: Custom number of media stream playbacks, must be greater than 0.

    Please note that when this parameter is not filled in or the value is 0, the configuration from the last call to this API or when the cloud player was created will be used by default.

Responses​

OK
Schema
    Code number

    Error code.

    The following only lists the return codes related to the API business logic. For the complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionHandling Suggestion
    0Success.-
    100000004Signature expired.Please regenerate the signature.
    100000005Signature error.Please confirm whether the parameters for generating the signature are correct.
    350006001API request frequency exceeds the limit.Please confirm the QPS limit of the corresponding API and reduce the request frequency.
    350006002Gateway verification failed.Please contact ZEGOCLOUD Technical Support for assistance.
    350006003Invalid input parameter.Please adjust the value of the corresponding parameter according to the Message prompt.
    350006006Service not activated.Please contact ZEGOCLOUD Technical Support to activate the service permission.
    350010000System error.Please contact ZEGOCLOUD Technical Support for assistance.
    Message string

    Error description.

    RequestId string

    Request ID.

Previous

Create a cloud player

Next

Destroy a cloud player

On this page

Back to top