跳到主要内容

获取视频播放代码

服务地址

http://api-az-cn.danghongyun.com/rest

请求方法

GET

请求参数

参数说明类型是否必须
accessKey访问API用的accessKeyString必选
actionAPI名称,此接口为 "getVideoPlaycode"String必选
versionAPI版本,目前必须为2.0 String必选
timestampAPI调用时间戳,1970年1月1日以来的毫秒数,如1466488681033String必选
signature签名,请参考签名规则String必选
videoId视频idString必选

响应示例

{
"code":0,
"message":"success",
"result":
{
"previewUrl":"http://www.stg.danghongyun.com/video/preview/2/262673e5c3f44cf7939523f14b42ed2b",
"flashUrl":"http://www.stg.danghongyun.com/video/preview/2/262673e5c3f44cf7939523f14b42ed2b.swf",
"htmlEmbedCode":"<div id=\"2_262673e5c3f44cf7939523f14b42ed2b\" style=\"text-align:center;\"></div>\r\n<script type=\"text/javascript\" src=\"http://static.danghongyun.com/libs/embed/H_E_v0.1.js\"></script>\r\n<script type=\"text/javascript\">\r\n HONGSHIYUN.embed(\"2_262673e5c3f44cf7939523f14b42ed2b\",{\r\n \t width:\"100%\",\r\n \t height:\"100%\",\r\n \t autoPlay:false\r\n \t });\r\n</script>\r\n\r\n"
},
"success":true
}

响应字段说明

字段说明
previewUrl预览地址
flashUrllash播放地址
htmlEmbedCodehtml嵌入式代码

响应错误码

错误码说明
0success
10000exception
10012video_not_exists
10017video_not_exists
10201api_not_exists