Commit 1a70d5663d0a9cf5223d1450941b11420f69e3f5
1 parent
f2f74a63
1
Showing
1 changed file
with
19 additions
and
60 deletions
01.点播云/内容输出接口.md
| ... | ... | @@ -6,17 +6,26 @@ Title: 1.1 获取点播信息接口 |
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | ### 接口地址 ### |
| 9 | -http://api.cnlive.com/open/api/dianbo/getVodInfo | |
| 9 | +http://api.cnlive.com/open/api2/vod_epg/getVodInfo | |
| 10 | 10 | |
| 11 | 11 | ### 接口协议 ### |
| 12 | 12 | HTTP GET |
| 13 | 13 | |
| 14 | 14 | ### 接口请求参数 ### |
| 15 | -- vId:节目唯一标识 | |
| 16 | -- sp_id:应用ID | |
| 17 | -- timestamp:时间戳,精确到秒 | |
| 15 | +| 参数名 | 参数类型 | 必选 | 参数说明 | | |
| 16 | +| :----------- | :------: | :------: | :------: | | |
| 17 | +| appId | string | true | 应用ID | | |
| 18 | +| vId| string | true | 点播节目标识 | | |
| 19 | +| timestamp | int | true | 精确到秒,当前Unix时间戳,请保证请求服务器时间正确 | | |
| 20 | +| sign | String | true | 签名规则见 [签名详情] (http://help.open.cnlive.com/common.html) | | |
| 18 | 21 | |
| 19 | 22 | ### 返回值 ### |
| 23 | + | |
| 24 | +| 参数名 | 参数类型 | 必选 | 参数说明 | | |
| 25 | +| :----------- | :------: | :------: | :------: | | |
| 26 | +| errorCode | int | true | 错误类型号 | | |
| 27 | +| errorMessage| string | true | 错误类型 | | |
| 28 | + | |
| 20 | 29 | 返回JSON格式的节目元数据信息,json示例如下: |
| 21 | 30 | |
| 22 | 31 | ``` json |
| ... | ... | @@ -82,64 +91,14 @@ HTTP GET |
| 82 | 91 | } |
| 83 | 92 | ``` |
| 84 | 93 | |
| 85 | -JSON属性说明: 四路播放地址至少一个有效 | |
| 86 | - | |
| 87 | -<table style="font-size:14px" > | |
| 88 | - <tr> | |
| 89 | - <td>字段名称</td> | |
| 90 | - <td>描述</td> | |
| 91 | - <td>备注</td> | |
| 92 | - </tr> | |
| 93 | - <tr> | |
| 94 | - <td>errorCode</td> | |
| 95 | - <td>返回码</td> | |
| 96 | - <td>0:成功</td> | |
| 97 | - </tr> | |
| 98 | - <tr> | |
| 99 | - <td>message</td> | |
| 100 | - <td>返回信息</td> | |
| 101 | - <td></td> | |
| 102 | - </tr> | |
| 103 | - <tr> | |
| 104 | - <td>MAM_VideoUrl</td> | |
| 105 | - <td>播放地址</td> | |
| 106 | - <td></td> | |
| 107 | - </tr> | |
| 108 | - <tr> | |
| 109 | - <td>MAM_PosterUrl</td> | |
| 110 | - <td>图片地址</td> | |
| 111 | - <td></td> | |
| 112 | - </tr> | |
| 113 | - <tr> | |
| 114 | - <td>status</td> | |
| 115 | - <td>状态</td> | |
| 116 | - <td>1:已发布;2:下线</td> | |
| 117 | - </tr> | |
| 118 | - <tr> | |
| 119 | - <td>cmsColumnID</td> | |
| 120 | - <td>栏目ID</td> | |
| 121 | - <td></td> | |
| 122 | - </tr> | |
| 123 | - <tr> | |
| 124 | - <td>freePlayLength</td> | |
| 125 | - <td>免费播放时长</td> | |
| 126 | - <td></td> | |
| 127 | - </tr> | |
| 128 | -</table> | |
| 129 | - | |
| 130 | - | |
| 131 | -参数需进行加密,示例: | |
| 132 | - | |
| 133 | -详细签名 http://bj.gitlab.cnlive.com/boss-team/OPEN_API/blob/master/0.%20%E5%85%AC%E5%85%B1%E7%BB%84%E4%BB%B6/1.1%20SHA1%E7%AD%BE%E5%90%8D.md | |
| 134 | - | |
| 135 | -``` java | |
| 136 | -public String getPlayVideo(ModelMap model,HttpServletRequest request) { | |
| 94 | +``` java 示例 | |
| 95 | +public Object getVodUrl() { | |
| 137 | 96 | String result = ""; |
| 138 | 97 | Map params = new HashMap<>(); |
| 139 | - params.put("sp_id", "iqhpk8pl19"); | |
| 98 | + params.put("appId", "iqj730vn11"); | |
| 140 | 99 | params.put("vId", "419c46d67fb34b46adbd8b7de450a0f2"); |
| 141 | 100 | params.put("timestamp", System.currentTimeMillis()/1000+""); |
| 142 | - String url = OpenUtil.buildURL("http://api.cnlive.com/open/api/dianbo/getVodInfo", params, "672db30805f848f59ec3728f8347a4a0"); | |
| 101 | + String url = OpenUtil.buildURL("http://api.cnlive.com/open/api/dianbo/getVodInfo", params, "appId对应key值"); | |
| 143 | 102 | HttpURLConnection connection; |
| 144 | 103 | try { |
| 145 | 104 | URL requestUrl = new URL(url); |
| ... | ... | @@ -167,9 +126,9 @@ public String getPlayVideo(ModelMap model,HttpServletRequest request) { |
| 167 | 126 | |
| 168 | 127 | if(BaseUtil.notBlank(result)) { |
| 169 | 128 | JSONObject resultJson = JSONObject.parseObject(result); |
| 170 | - model.put("videoInfo", resultJson); | |
| 129 | + return resultJson | |
| 171 | 130 | } |
| 172 | 131 | |
| 173 | - return "play_demo"; | |
| 132 | + return ""; | |
| 174 | 133 | } |
| 175 | 134 | ``` |
| 176 | 135 | \ No newline at end of file | ... | ... |