Get Video Playback Code

Last update:2023-03-14 16:36:58

Get playback URL by video ID.

Request method POST/GET
Require Aunthentication Yes

Request parameter

Parameter Type Required Description
videoId string Yes the ID of the Video. You can get the video ID from the console or by calling the API Get Video List.
CodeType int No Playback code type :
- 0 (All)
- 2 (Swf Code)
- 4 (Video URL)
- 5 (Adaptive Code)
- 6 (Full-screen Preview video URL)
- 7 (Full-screen Preview Preview Adaptive Code)
The default is 0.



Parameter Type Description
videoId string Video ID
encrypt int Whether video is encrypted :
- 0 (Unencrypted)
- 1 (Encrypted)
swfCode string Swf playback code.
autoCode string The adaptive playback code in which an H5 player is embedded.
Note: There is no adaptive playback code if the video is encrypted.
tryWatchAutoCode string Preview playback code.
Note: There is no preview playback code if the video is encrypted.
customCode string Customized playback code. If you need this, please contact customer service.
videoUrl array Video url list.
tryWatchVideoUrl array Full-screen Preview video Url List.

videoUrl and tryWatchVideoUrl

Parameter Type description
urlType string PC/Mobile
originUrl string ORIGINAL video URL
fluentUrl string LD video URL
sdUrl string SD video URL
highUrl string HD video URL
hdPullUrl string FHD video URL


Input example

curl -X POST 
  -H 'content-type: application/x-www-form-urlencoded; charset=utf-8' 
  -H "Host:" 
  <Common Headers and Prameters>
  -d 'videoId=9B0F7BA8BCB9D056D4C24ADDBF821D10&codeType=0'

Note: For “Common Headers and Prameters” in the example, see Common Parameters to learn more.

Output Example

    "code": 200,
"data": {
"videoId ": 8731c067016b1000d7d05b5600000000,
        "encrypt": 0,
        "swfCode": "",
        "customCode": "",	
        "videoUrl": [
                "fluentUrl": "",
                "hdPullUrl": "",
                "highUrl": "",
                "originUrl": "",
                "sdUrl": "",
                "urlType": "PC"
                "fluentUrl": "",
                "hdPullUrl": "",
                "highUrl": "",
                "originUrl": "",
                "sdUrl": "",
                "urlType": "Mobile"
    "message": "Success"

Error code

For common errors, please refer to Response.

Error code Description
1503 videoId cannot be empty.
1504 videoId contains unrecognizable characters.
1532 codeType input is invalid.
1502 The video does not exist.
1535 No permission to get playback code.
Is the content of this document helpful to you?
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!