GetPlayInfo

Updated at:

Retrieves the playback URL of a media file, such as a video or an audio file, by using the media ID. After you integrate the ApsaraVideo Player SDK for URL-based playback or a third-party player, you can use the URL to play the media file.

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

ice:GetPlayInfo

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

MediaId

string

No

The media ID.

Note

At least one of the MediaId and InputURL parameters must be specified.

86434e152b7d4f20be480574439fe***

InputURL

string

No

The input URL specified when the media asset is registered. For more information, see RegisterMediaInfo.

Note

At least one of the MediaId and InputURL parameters must be specified.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4 or vod://****20b48fb04483915d4f2cd8ac****

AuthTimeout

integer

No

The expiration time of the file signature. Unit: seconds.

3600

Response elements

Element

Type

Description

Example

object

The response.

RequestId

string

The request ID.

******11-DB8D-4A9A-875B-275798******

MediaBase

object

The media asset information.

CreationTime

string

The creation time. The time is in the ISO 8601 format and includes the time zone offset.

2021-09-22T10:07:31+08:00

Status

string

The resource status. Valid values:

  • Init: The initial state. The source file is not ready.

  • Preparing: The source file is being prepared, such as being uploaded or edited and produced.

  • PrepareFail: The preparation of the source file failed, such as a failure to obtain the source file information.

  • Normal: The normal state. The source file is ready.

Normal

MediaId

string

The media ID.

2eea77a61c7b4ddd95bec34a6f65b***

CoverURL

string

The URL of the cover image.

https://***.oss-cn-shanghai.aliyuncs.com/cover/281c64d6-b5fb-4c57-97cd-84da56a8b151_large_cover_url.jpg

Title

string

The title.

testTitle

MediaType

string

The media file type. Valid values:

video: Video. audio: Audio only.

video

MediaTags

string

The tags.

  • A maximum of 16 tags are supported.

  • Separate multiple tags with commas.

  • Each tag cannot exceed 32 bytes in size.

  • The tags are encoded in UTF-8.

test,ccc

CateId

integer

The category ID. You can obtain the category ID by using one of the following methods:

  • Log on to the IMS console and choose Media Assets > Categories to view the category ID.

  • Call the API operation for creating a category. The category ID is the value of the CateId response parameter.

  • Call the API operation for querying a category. The category ID is the value of the CateId response parameter.

4220

Description

string

The content description.

desc

PlayInfoList

array<object>

The playback information (stream information) of the audio or video.

object

The details of the audio or video.

CreationTime

string

The creation time. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-05-10T02:28:49Z

Status

string

The status of the media stream. Valid values:

  • Normal: Normal.

  • Invisible: Invisible.

Normal

NarrowBandType

string

The Narrowband HD type. Valid values:

  • 0: Standard.

  • 1.0: Narrowband HD 1.0.

  • 2.0: Narrowband HD 2.0.

This parameter takes effect only when the definition of the built-in transcoding template for Narrowband HD 1.0 is configured. For more information, see Transcoding template configuration - Definition.

0

Height

integer

The height of the media stream. Unit: px.

1080

Bitrate

string

The bitrate of the media stream. Unit: Kbps.

20

ModificationTime

string

The update time. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-05-13T11:39:41.714+08:00

WatermarkId

string

The ID of the watermark associated with the current media stream.

5bed88672b1e2520ead228935ed51***

Encrypt

integer

Specifies whether the media stream is encrypted. Valid values:

  • 0: No.

  • 1: Yes.

0

Definition

string

The definition of the video stream. Valid values:

  • FD: Smooth.

  • LD: Standard definition.

  • SD: High definition.

  • HD: Ultra high definition.

  • OD: Original definition.

  • 2K: 2K.

  • 4K: 4K.

  • SQ: Standard audio quality.

  • HQ: High audio quality.

  • AUTO: Adaptive bitrate.

HD

EncryptType

string

The encryption type of the media stream. Valid values:

  • AliyunVoDEncryption: Alibaba Cloud video encryption.

  • HLSEncryption: HLS standard encryption.

Note

If the encryption type is AliyunVoDEncryption, the media stream can be played only by using the ApsaraVideo Player SDK.

AliyunVoDEncryption

StreamType

string

The type of the media stream. If the media stream is a video, the value is video. If the media stream is an audio file, the value is audio.

video

Size

integer

The size of the media stream. Unit: bytes.

418112

Width

integer

The width of the media stream. Unit: px.

1024

Fps

string

The frame rate of the media stream. Unit: frames per second.

25

Duration

string

The duration of the media stream. Unit: seconds.

9.0464

PlayURL

string

The playback URL of the video stream.

https://***.aliyuncdn.com/sv/756bee1-17f980f0945/756bee1-17f980f0945.mp4

Format

string

The format of the media stream.

  • If the media file is a video, valid values are mp4 and m3u8.

  • If the media file is an audio file, the value is mp3.

mp4

HDRType

string

The HDR type of the media stream. Valid values:

  • HDR

  • HDR10

  • HLG

  • DolbyVision

  • HDRVivid

  • SDR+

HDR

BitDepth

integer

The color bit depth.

8

FileURL

string

The OSS URL of the file.

http://outin-***.oss-cn-shanghai.aliyuncs.com/sv/43a68ee9-181809b6aba/43a68ee9-181809b6aba.mpeg

TransTemplateType

string

The transcoding templatetype. Valid values:

  • Normal: Standard template.

  • AudioTranscode: Audio transcoding.

  • Remux: Re-encapsulation.

  • NarrowBandV1: Narrowband HD 1.0.

  • NarrowBandV2: Narrowband HD 2.0.

  • UHD: Audio and video enhancement (Ultra HD).

Normal

StreamTags

string

The stream tag, which is used to identify the transcoding processing type.

"{\"ims.audioServiceType\": \"AudioEnhancement\"}"

JobId

string

The job ID.

36c9d38e70bf43ed9f7f8f48d6356***

Examples

Success response

JSON format

{
  "RequestId": "******11-DB8D-4A9A-875B-275798******",
  "MediaBase": {
    "CreationTime": "2021-09-22T10:07:31+08:00",
    "Status": "Normal",
    "MediaId": "2eea77a61c7b4ddd95bec34a6f65b***",
    "CoverURL": "https://***.oss-cn-shanghai.aliyuncs.com/cover/281c64d6-b5fb-4c57-97cd-84da56a8b151_large_cover_url.jpg",
    "Title": "testTitle",
    "MediaType": "video",
    "MediaTags": "test,ccc",
    "CateId": 4220,
    "Description": "desc"
  },
  "PlayInfoList": [
    {
      "CreationTime": "2022-05-10T02:28:49Z",
      "Status": "Normal",
      "NarrowBandType": "0",
      "Height": 1080,
      "Bitrate": "20",
      "ModificationTime": "2022-05-13T11:39:41.714+08:00",
      "WatermarkId": "5bed88672b1e2520ead228935ed51***",
      "Encrypt": 0,
      "Definition": "HD",
      "EncryptType": "AliyunVoDEncryption",
      "StreamType": "video",
      "Size": 418112,
      "Width": 1024,
      "Fps": "25",
      "Duration": "9.0464",
      "PlayURL": "https://***.aliyuncdn.com/sv/756bee1-17f980f0945/756bee1-17f980f0945.mp4",
      "Format": "mp4",
      "HDRType": "HDR",
      "BitDepth": 8,
      "FileURL": "http://outin-***.oss-cn-shanghai.aliyuncs.com/sv/43a68ee9-181809b6aba/43a68ee9-181809b6aba.mpeg",
      "TransTemplateType": "Normal",
      "StreamTags": "\"{\\\"ims.audioServiceType\\\": \\\"AudioEnhancement\\\"}\"",
      "JobId": "36c9d38e70bf43ed9f7f8f48d6356***"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.