All Products
Search
Document Center

Intelligent Media Services:GetPlayInfo

Last Updated:Dec 16, 2024

Queries the playback URL of a video or audio file based on its ID.

Operation description

You use the ID of a video or audio file to query the playback URL of the file. Then, you can use the playback URL to play the audio or video in ApsaraVideo Player SDK (for URL-based playback) or a third-party player.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ice:GetPlayInfoget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MediaIdstringNo

The ID of the media asset.

Note You must specify at least one of the MediaId and InputURL parameters.
86434e152b7d4f20be480574439fe***
InputURLstringNo

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

Note You must specify at least one of the MediaId and InputURL parameters.

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

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

The information about the media asset.

CreationTimestring

The time when the media asset was created.

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

The resource status. Valid values:

Init: the initial state, which indicates that the source file is not ready.

Preparing: The source file is being prepared. For example, the file is being uploaded or edited.

PrepareFail: The source file failed to be prepared. For example, the information of the source file failed to be obtained.

Normal: The source file is ready.

Normal
MediaIdstring

The ID of the media asset.

2eea77a61c7b4ddd95bec34a6f65b***
CoverURLstring

The URL of the thumbnail.

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

The title.

testTitle
MediaTypestring

The type of the media asset. Valid values:

video audio

video
MediaTagsstring

The tags.

  • Up to 16 tags are supported.
  • Multiple tags are separated by commas (,).
  • Each tag can be up to 32 bytes in length.
  • The value is encoded in UTF-8.
test,ccc
CateIdlong

The category ID. You can use one of the following methods to obtain the ID:

  • Log on to the Intelligent Media Services (IMS) console and choose Media Asset Management > Category Management to view the category ID.
  • View the value of the CateId parameter returned by the AddCategory operation that you called to create a category.
  • View the value of the CateId parameter returned by the GetCategories operation that you called to query a category.
4220
Descriptionstring

The content description.

desc
PlayInfoListarray<object>

The information about the audio or video stream.

PlayInfoobject

The audio or video details.

CreationTimestring

The time when the media stream was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-05-10T02:28:49Z
Statusstring

The status of the media stream. Valid values:

  • Normal
  • Invisible
Normal
NarrowBandTypestring

The type of Narrowband HD™ transcoding. Valid values:

  • 0: standard transcoding
  • 1.0: Narrowband HD™ 1.0 transcoding
  • 2.0: Narrowband HD™ 2.0 transcoding

This parameter is returned only when a definition that is available in the built-in Narrowband HD™ 1.0 transcoding template is specified. For more information, see the Definition parameter in TranscodeTemplate table.

0
Heightlong

The height of the media stream. Unit: pixels.

1080
Bitratestring

The bitrate of the media stream. Unit: Kbit/s.

20
ModificationTimestring

The time when the media stream was updated. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

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

The ID of the watermark that is associated with the media stream.

5bed88672b1e2520ead228935ed51***
Encryptlong

Indicates whether the media stream is encrypted. Valid values:

  • 0: The media stream is not encrypted.
  • 1: The media stream is encrypted.
0
Definitionstring

The quality of the media stream. Valid values:

  • FD: low definition
  • LD: standard definition
  • SD: high definition
  • HD: ultra-high definition
  • OD: original definition
  • 2K
  • 4K
  • SQ: standard sound quality
  • HQ: high sound quality
  • AUTO: adaptive bitrate
HD
EncryptTypestring

The encryption type of the media stream. Valid values:

  • AliyunVoDEncryption: Alibaba Cloud proprietary cryptography
  • HLSEncryption: HTTP Live Streaming (HLS) encryption
Note If the encryption type is AliyunVoDEncryption, only ApsaraVideo Player SDK can be used to play videos.
AliyunVoDEncryption
StreamTypestring

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

video
Sizelong

The size of the media stream. Unit: bytes.

418112
Widthlong

The width of the media stream. Unit: pixels.

1024
Fpsstring

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

25
Durationstring

The duration of the media stream. Unit: seconds.

9.0464
PlayURLstring

The playback URL of the media stream.

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

The format of the media stream.

  • If the media asset is a video file, the valid values are mp4 and m3u8.
  • If the media asset is an audio-only file, the value is mp3.
mp4
HDRTypestring

The high dynamic range (HDR) type of the media stream. Valid values:

  • HDR
  • HDR10
  • HLG
  • DolbyVision
  • HDRVivid
  • SDR+
HDR
BitDepthinteger

The color depth.

8
FileURLstring

The OSS URL of the file.

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

The type of the transcoding template. Valid values:

  • Normal: standard transcoding
  • AudioTranscode: audio transcoding
  • Remux: container format conversion
  • NarrowBandV1: Narrowband HD™ 1.0
  • NarrowBandV2: Narrowband HD™ 2.0
  • UHD: audio and video enhancement (ultra-high definition)
Normal
StreamTagsstring

The tags of the media stream, which are used to identify the transcoding type.

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

The task ID.

36c9d38e70bf43ed9f7f8f48d6356***

Examples

Sample success responses

JSONformat

{
  "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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-08-25The response structure of the API has changedView Change Details
2022-11-29The response structure of the API has changedView Change Details