视频列表
服务地址
http://api-az-cn.danghongyun.com/rest
请求方法
GET
请求参数
参数 | 说明 | 类型 | 是否必须 |
---|---|---|---|
accessKey | 访问API用的accessKey | String | 必选 |
action | API名称,此接口为 "queryVideo" | String | 必选 |
version | API版本,目前必须为2.0 | String | 必选 |
timestamp | API调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
signature | 签名,请参考签名规则 | String | 必选 |
start | 开始位置 | String | 必选 |
number | 数量 | String | 必选 |
sort | 结果按该字段排序,只能为title, size, category, uploadTime, status, tag | String | 必选 |
order | asc 顺序,desc 倒序 | String | 必选 |
searchType | searchType 查找视频,查找类型为title,tag,all, 分别为按title查找,按tag查找,按title和tag一起查找,查找时必须同时要输入参数keyword。为空时为获取视频列表,此时不必须输入参数keyword | String | 可选 |
keyword | 查找的关键字 | String | 可选 |
categoryId | 视频类别id,按以上要求查找的同时查属于该分类的结果,若不填,则为所有分类 | Integer | 可选 |
videoType | 0:普通视频,1:VR,不传该值的话默认为0 | Integer | 可选 |
status | 视频状态,不传该值的话为返回所有状态的视频,状态取值:0,1,2,3,4,5,6,7详见下面说明 | Integer | 可选 |
status 取值说明
0:TRANSCODE_STATUS_UPLOAD_FINISHED
1:TRANSCODE_STATUS_START
2:TRANSCODE_STATUS_COMPLETED
3:TRANSCODE_STATUS_FAILED
4:TRANSCODE_STATUS_UPLOAD_FAILED
5:TRANSCODE_STATUS_UNKNOWN_FILE_TYPE
6:TRANSCODE_STATUS_SECOND_TRANSCODE_START
7:TRANSCODE_STATUS_WAITTING
响应示例
{
"code":0,
"message":"success",
"result":
[
{
"id":"b01811bcb49a4bef9847f3555752a3c6",
"parentId":null,
"playrate":"1.0",
"fileName":"290c4314065646f384ac52d21a718c9e.mp4",
"thumbnail":"http://k35rdw4u.images.danghongyun.com/cover/2017/11/27/b01811bcb49a4bef9847f3555752a3c6/193_b01811bcb49a4bef9847f3555752a3c6_0.jpg",
"cover":"http://k35rdw4u.images.danghongyun.com/cover/2017/11/27/b01811bcb49a4bef9847f3555752a3c6/193_b01811bcb49a4bef9847f3555752a3c6_0.jpg",
"title":"1.mp4",
"width":720,
"height":576,
"bitrate":333209,
"audioBitrate":0,
"duration":286000,
"playNum":0,
"size":11361,
"userId":193,
"categoryId":0,
"category":null,
"status":2,
"date":"2017/11/27",
"uploadTime":1511779239632,
"tag":null,
"description":null,
"contentId":null,
"customId":null,
"sourceContentId":null,
"sourceCustomId":null,
"transcodedVideoList":
[
{
"name":"high-definition",
"hlsUrl":"http://k35rdw4u.vod2.danghongyun.com/target/hls/2017/11/27/193_b01811bcb49a4bef9847f3555752a3c6_10_720x576.m3u8",
"hlsSize":23635592,
"mp4Url":"http://k35rdw4u.vod2.danghongyun.com/target/mp4/2017/11/27/193_b01811bcb49a4bef9847f3555752a3c6_10_720x576.mp4",
"mp4Size":19244116,
"flvUrl":"http://k35rdw4u.vod2.danghongyun.com/target/flv/2017/11/27/193_b01811bcb49a4bef9847f3555752a3c6_10_720x576.flv",
"flvSize":19442983,
"tsUrl":"http://k35rdw4u.vod2.danghongyun.com/target/ts/2017/11/27/193_b01811bcb49a4bef9847f3555752a3c6_10_720x576.ts",
"tsSize":23762824,
"videoWidth":720,
"videoHeight":576,
"videoBitrate":500,
"audioBitrate":64000,
"defaultVideo":1,
"taskId":"113444",
"status":2,
"idx":1,
"type":0,
"hlsEncryptType":0,
"mp4EncryptType":0,
"flvEncryptType":0,
"tsEncryptType":0,
"contentId":null,
"customId":null,
"aesKey":null
}
],
"subPlayrateList":
[
{
"videoId":"577e0bcfc4774cc295668d1638e1752b",
"playrate":"0.8",
"subVideoType":0
},
{
"videoId":"dd9220fc79e34651a8140d77ecbe7e95",
"playrate":"30",
"subVideoType":0
}
],
"playCode":
{
"previewUrl":"http://www.danghongyun.com/video/preview/193/b01811bcb49a4bef9847f3555752a3c6",
"flashUrl":"http://www.danghongyun.com/video/preview/193/b01811bcb49a4bef9847f3555752a3c6.swf",
"htmlEmbedCode":"<div id=\"193_b01811bcb49a4bef9847f3555752a3c6\" style=\"text-align:center;\"></div>\r\n<script type=\"text/javascript\" src=\"http://static.danghongyun.com/libs/embed/H_E_v0.2.js\"></script>\r\n<script type=\"text/javascript\">\r\n HONGSHIYUN.embed(\"193_b01811bcb49a4bef9847f3555752a3c6\",{\r\n width:\"100%\",\r\n height:\"100%\",\r\n autoPlay:false\r\n });\r\n</script>"
},
"type":0,
"uri":null,
"fastEditor":0,
"videoType":0,
"audio":null,
"audioStatus":null,
"audioTaskId":null,
"subtitle":null,
"subVideoType":null,
"shareStatus":0,
"shareToUserId":null,
"shareCategoryId":0,
"logoGroupId":null
},
{
"id":"4b4deb6b24b54ec0b816d607a4317712",
"parentId":null,
"playrate":"1.0",
"fileName":"254b95af058441218eddeae1ff7f10df.mp4",
"thumbnail":"http://k35rdw4u.images.danghongyun.com/thumb/2017/11/27/4b4deb6b24b54ec0b816d607a4317712/193_4b4deb6b24b54ec0b816d607a4317712_0.jpg",
"cover":"http://k35rdw4u.images.danghongyun.com/cover/2017/11/27/4b4deb6b24b54ec0b816d607a4317712/193_4b4deb6b24b54ec0b816d607a4317712_0.jpg",
"title":"7.mp4",
"width":1280,
"height":720,
"bitrate":1312051,
"audioBitrate":0,
"duration":35360,
"playNum":0,
"size":5530,
"userId":193,
"categoryId":0,
"category":null,
"status":2,
"date":"2017/11/27",
"uploadTime":1511778702647,
"tag":null,
"description":null,
"contentId":null,
"customId":null,
"sourceContentId":null,
"sourceCustomId":null,
"transcodedVideoList":
[
{
"name":"high-quality",
"hlsUrl":null,
"hlsSize":0,
"mp4Url":"http://k35rdw4u.vod2.danghongyun.com/target/mp4/2017/11/27/193_4b4deb6b24b54ec0b816d607a4317712_10_1280x360.mp4",
"mp4Size":2318404,
"flvUrl":null,
"flvSize":0,
"tsUrl":null,
"tsSize":0,
"videoWidth":1280,
"videoHeight":360,
"videoBitrate":500,
"audioBitrate":64000,
"defaultVideo":1,
"taskId":"113442",
"status":2,
"idx":1,
"type":0,
"hlsEncryptType":0,
"mp4EncryptType":0,
"flvEncryptType":0,
"tsEncryptType":0,
"contentId":null,
"customId":null,
"aesKey":null
}
],
"subPlayrateList":[],
"playCode":
{
"previewUrl":"http://www.danghongyun.com/video/preview/193/4b4deb6b24b54ec0b816d607a4317712?isVR=true",
"flashUrl":"http://www.danghongyun.com/video/preview/193/4b4deb6b24b54ec0b816d607a4317712.swf?isVR=true",
"htmlEmbedCode":"<div id=\"193_4b4deb6b24b54ec0b816d607a4317712\" style=\"text-align:center;\"></div>\r\n<script type=\"text/javascript\" src=\"http://static.danghongyun.com/libs/embed/H_E_v0.2.js\"></script>\r\n<script type=\"text/javascript\">\r\n HONGSHIYUN.embed(\"193_4b4deb6b24b54ec0b816d607a4317712\",{\r\n width:\"100%\",\r\n height:\"100%\",\r\n autoPlay:false\r\n });\r\n</script>"
},
"type":0,
"uri":null,
"fastEditor":0,
"videoType":1,
"audio":"audio/2017/11/27/193_4b4deb6b24b54ec0b816d607a4317712.mp3",
"audioStatus":3,
"audioTaskId":"113443",
"subtitle":null,
"subVideoType":null,
"shareStatus":0,
"shareToUserId":null,
"shareCategoryId":0,
"logoGroupId":null
}
],
"success":true
}
响应字段说明
视频信息
字段 | 说明 |
---|---|
audio | VR转出的音频地址 |
audioStatus | VR转出的音频转码状态 |
audioTaskId | VR转出的音频转码任务id |
audioBitrate | 源文件音频码率 |
bitrate | 源文件比特率 |
category | 类别 |
categoryId | 类别id |
contentId | content id,用于视频加解密 |
cover | 默认封面图 |
customId | custom id,用于视频加解密 |
date | 视频上传日期 |
description | 描述 |
duration | 视频时长,毫秒 |
fastEditor | 是否快编 |
fileName | 文件名 |
height | 源视频文件高度 |
id | 视频id |
logoGroupId | 转码时所用的台标组id |
parentId | 父视频id |
playCode | 请参考播放码 |
playNum | 播放次数 |
playrate | 播放速率,目前为倍数:0.8,1.2,1.4,1.6;缩时:10,30,60,180,单位为秒 |
shareCategoryId | 分享的视频类别 ,目前无效 |
shareStatus | 分享状态,目前无效 |
shareToUserId | 分享给的用户id,目前无效 |
size | 视频大小,KB |
sourceContentId | 视频源本身为加密时所使用的key之一 |
sourceCustomId | 视频源本身为加密时所使用的key之一 |
status | 视频转码状态,1 转码中,2 转码完成,3 转码出错,4 上传失败,5 未知文件类型,6 二次转码中,7 排队中 |
subtitle | 字幕 |
subPlayrateList | 子视频列表, 请参考子视频 |
subVideoType | 如果该视频为子视频,则表示子视频类型,0 倍数转码,1 缩时转码 |
tag | 视频标签 |
taskId | 视频转码任务id, |
thumbnail | 默认缩略图 |
title | 标题 |
transcodedVideoList | 转码后的视频地址列表,请参考视频输出 |
type | 源文件类型,0 普通文件,1 hls文件,3 直播录制,4 快编,5 直播录制二次转码,6 快编二次转码,7 视频叠加,8 视频叠加二次转码 |
uploadTime | 上传时间 |
userId | 用户id |
uri | 源文件uri |
videoType | 视频类型 0 普通,1 VR |
width | 源视频文件宽度 |
播放码
字段 | 说明 |
---|---|
flashUrl | flash播放地址 |
htmlEmbedCode | html嵌入式代码 |
previewUrl | 预览地址 |
子视频
字段 | 说明 |
---|---|
videoId | 子视频id |
playrate | 子视频播放速率,含义同上 |
subVideoType | 子视频类型,0 倍数转码,1 缩时转码 |
视频输出
字段 | 说明 |
---|---|
aesKey | AES加密所用的key |
audioBitrate | 转码后音频码率 |
contentId | 当虹加密所用的key之一 |
customId | 当虹加密所用的key之一 |
defaultVideo | 是否为默认播放,1 是, 0 否 |
flvEncryptType | 转码后flv加密类型,0 不加密,7 当虹加密 |
flvUrl | 转码后flv地址 |
flvSize | 转码后flv文件大小,Byte |
hlsEncryptType | 转码后hls加密类型,0 不加密,6 AES加密,7 当虹加密,目前AES加密只对hls起作用 |
hlsUrl | 转码后hls地址 |
hlsSize | 转码后hls文件大小,Byte |
idx | 同一个文件的不同输出地址索引 |
mp4EncryptType | 转码后mp4加密类型,0 不加密,7当虹加密 |
mp4Url | 转码后mp4地址 |
mp4Size | 转码后mp4文件大小,Byte |
name | 名称 |
status | 转码任务状态 |
taskId | 转码任务id |
tsEncryptType | 转码后ts加密类型,0 不加密,7 当虹加密 |
tsUrl | 转码后ts地址 |
tsSize | 转码后ts文件大小,Byte |
type | 转码后的文件类型,0 普通,1 试看片段 |
videoBitrate | 视频码率 |
videoHeight | 转码后视频高度 |
videoWidth | 转码后视频宽度 |
响应错误码
错误码 | 说明 |
---|---|
0 | success |
10000 | exception |
10013 | sort_type_is_incorrect |
10018 | search_type_is_incorrect |
10201 | api_not_exists |