Updates the publishing status of a media file.

Usage notes

The published state indicates that the access control list (ACL) of media playback resources and snapshot files is set to inherit the ACL of the bucket to which they belong. The unpublished state indicates that the ACL of media playback resources and snapshot files is set to private.

QPS limit

You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the 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 UpdateMediaPublishState

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

MediaId String Yes 3e6149d5a8c944c09b1a8d2dc3e4****

The ID of the media file whose publishing status you want update. To obtain the ID of a media file, you can call the AddMedia operation. Alternatively, perform the following operations in the ApsaraVideo Media Processing (MPS) console: In the left-side navigation pane, choose Media Management > Media List. Find the required video and click Manage. The ID of the video is displayed on the Basics tab.

Publish Boolean No true

The publishing status. Default value: Initialed. Valid values:

  • true: published
  • false: unpublished
Default publishing state of a media file and status change rules

Default publishing state:

The default publishing state of a media file is Initialed. The following two types of media files are in the Initialed state:

  • New media file: When a media file is generated for the first time (a media workflow is triggered for the first time), and the media execution of the workflow is in progress, the media file is in the Initialed state. After the execution of the media workflow is complete, the status of the media file changes to the published or unpublished state based on the configuration of the media workflow.
  • Deleted media file: After a media file is deleted, the publishing status is meaningless, and the media file is in the Initialed state. If you restore the deleted media file to the media library, execute a workflow on the file as a new media file.

Status change rules

Note The publishing status changes among the Initialed, published, and unpublished states. The status change rules for the API are different from those for workflow execution.

Caller

Current state

Changed status

Allowed

API

Initialed

Published

No

API

Initialed

Unpublished

No

API

Published

Unpublished

Yes

API

Unpublished

Published

Yes

Workflow execution

Initialed

Published

Yes

Workflow execution

Initialed

Unpublished

Yes

Workflow execution

Published

Unpublished

No

Workflow execution

Unpublished

Published

No

Response parameters

Parameter Type Example Description
RequestId String 91B6CAB9-034C-4E4E-A40B-E7F5C81E688C

The ID of the request.

Examples

Sample requests

http(s)://mts.cn-hangzhou.aliyuncs.com/?Action=UpdateMediaPublishState
&MediaId=3e6149d5a8c944c09b1a8d2dc3e4****
&Publish=true
&<Common request parameters>

Sample success responses

XML format

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

<UpdateMediaPublishStateResponse>
    <RequestId>91B6CAB9-034C-4E4E-A40B-E7F5C81E688C</RequestId>
</UpdateMediaPublishStateResponse>

JSON format

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

{
  "RequestId" : "91B6CAB9-034C-4E4E-A40B-E7F5C81E688C"
}

Error codes

For a list of error codes, visit the API Error Center.