Commit de5c57f1208419b606f1c60d2958ae15de6c9365

Authored by 翁力
2 parents b2dc1c2c 9e567a59

Merge remote-tracking branch 'origin/master'

00.公共组件/1.2accessToken.md 0 → 100644
  1 +<table>
  2 + <tbody><tr>
  3 + <td class="apitd1">接口名称</td>
  4 + <td> 获取access_token</td>
  5 + </tr>
  6 + <tr>
  7 + <td class="apitd1">地址</td>
  8 + <td>https://api.cnlive.com/open/api2/token</td>
  9 + </tr>
  10 + <tr>
  11 + <td class="apitd1">method</td>
  12 + <td>post</td>
  13 + </tr>
  14 + <tr>
  15 + <td class="apitd1">返回数据</td>
  16 + <td>
  17 + json
  18 + </td>
  19 + </tr>
  20 + </tbody>
  21 +
  22 + </table>
  23 +
  24 +### 请求参数
  25 +<table>
  26 + <thead>
  27 + <tr>
  28 + <th style="text-align: left">参数名</th>
  29 + <th style="text-align: center">参数类型</th>
  30 + <th style="text-align: center">必选</th>
  31 + <th style="text-align: center">参数说明</th>
  32 + </tr>
  33 + </thead>
  34 + <tbody>
  35 + <tr>
  36 + <td style="text-align: left">appId</td>
  37 + <td style="text-align: center">string</td>
  38 + <td style="text-align: center">true</td>
  39 + <td style="text-align: center">应用ID</td>
  40 + </tr>
  41 + <tr>
  42 + <td style="text-align: left">secret</td>
  43 + <td style="text-align: center">string</td>
  44 + <td style="text-align: center">true</td>
  45 + <td style="text-align: center">获取access_token 凭证</td>
  46 + </tr>
  47 + </tbody>
  48 +</table>
  49 +
  50 +### 返回数据
  51 +```json
  52 +{
  53 + "errorCode": 0,
  54 + "errorMessage": "OK",
  55 + "data": {
  56 + "access_token": "c2a89924-aa4c-4488-8c87-671b6c5e538c5c095ce9-72ef-4878-b3a6-6b4ce3bacba96a500103-c5bc-4565-bb00-c7d3b3c1954b",
  57 + "expires_in": 7200 //单位(秒) 2小时
  58 + }
  59 +}
  60 +
  61 +```
0 \ No newline at end of file 62 \ No newline at end of file
01.点播云/1.0 获取点播信息接口Server.md 0 → 100644
  1 +/*
  2 +Title: 1.1 获取点播信息接口
  3 +*/
  4 +
  5 +### 接口描述 ###
  6 +
  7 +
  8 +### 接口地址 ###
  9 +http://api.cnlive.com/open/api2/vod_epg/getVodInfo4Server
  10 +
  11 +### 接口协议 ###
  12 +HTTP GET
  13 +
  14 +### 接口请求参数 ###
  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) |
  21 +
  22 +### 返回值 ###
  23 +
  24 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  25 +| :-----------| :------: | :------: | :------: |
  26 +| errorCode| int | true | 错误类型号 |
  27 +| errorMessage| string | true | 错误类型 |
  28 +| title| string | true | 节目标题 |
  29 +| subTitle| string | false | 节目副标题 |
  30 +| description| string | false | 节目描述 |
  31 +| createTime| string | true | 创建时间,格式:yyyyMMddHHmmss |
  32 +| publishTime| string | true | 发布时间,格式:yyyyMMddHHmmss |
  33 +| status| string | true | 节目状态,0:待发布,1:已发布,2:下线 |
  34 +| vId| string | true | 节目的唯一标识 |
  35 +| packagePomID| string | false | 节目的产品包ID |
  36 +| onePomID| string | false | 节目的产品ID |
  37 +| freePlayLength| string | false | 免费播放时长,单位 s,默认 60 |
  38 +| mp4_url_rate1 | string | false |流畅版的mp4播放地址 |
  39 +| mp4_url_rate2 | string | true | 标清版的mp4播放地址,必须有|
  40 +| mp4_url_rate3 | string | false | 高清版的mp4播放地址 |
  41 +| mp4_url_rate4 | string | false | 超清版的mp4播放地址 |
  42 +| hls_url_rate1 | string | false |流畅版的m3u8播放地址 |
  43 +| hls_url_rate2 | string | true | 标清版的m3u8播放地址,必须有|
  44 +| hls_url_rate3 | string | false | 高清版的m3u8播放地址 |
  45 +| hls_url_rate4 | string | false | 超清版的m3u8播放地址 |
  46 +
  47 +返回JSON格式的节目元数据信息,json示例如下:
  48 +
  49 +``` json
  50 +{
  51 + "errorMessage":"请求成功",
  52 + "data":{
  53 + "createTime":"20160808125905",
  54 + "publishTime":"20160808131657",
  55 + "status":"1",
  56 + "vId":"174e6c5f3d9e4ddeb739feed1906fa11",
  57 + "hls_url_rate1":"http://api.cnlive.com/open/api2/vod_ips/vodplayByH5?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=1",
  58 + "hls_url_rate3":"http://api.cnlive.com/open/api2/vod_ips/vodplayByH5?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=3",
  59 + "hls_url_rate2":"http://api.cnlive.com/open/api2/vod_ips/vodplayByH5?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=2",
  60 + "vipFlag":"0",
  61 + "packagePomID":"3_ent/xingwenrebao/yuleqianxian/",
  62 + "hls_url_rate4":"http://api.cnlive.com/open/api2/vod_ips/vodplayByH5?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=4",
  63 + "subTitle":"BTOB对粉丝甜喊:我想你们了",
  64 + "mp4_url_rate1":"http://api.cnlive.com/open/api2/vod_ips/vodplayBySWF?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=1",
  65 + "title":"BTOB甜喊:我想你们了",
  66 + "mp4_url_rate3":"http://api.cnlive.com/open/api2/vod_ips/vodplayBySWF?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=3",
  67 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/vod_ips/vodplayBySWF?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=2",
  68 + "description":"@TV娱乐前线:韩国男团BTOB近日在台北国际会议中心举行演唱会。",
  69 + "freePlayLength":"60",
  70 + "mp4_url_rate4":"http://api.cnlive.com/open/api2/vod_ips/vodplayBySWF?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=4",
  71 + "onePomID":"3_174e6c5f3d9e4ddeb739feed1906fa11"
  72 + },
  73 + "errorCode":"0"
  74 +}
  75 +```
  76 +#### java 示例
  77 +
  78 +```java
  79 +public Object getVodUrl() {
  80 + String result = "";
  81 + Map params = new HashMap<>();
  82 + params.put("appId", "iqj730vn11");
  83 + params.put("vId", "174e6c5f3d9e4ddeb739feed1906fa11");
  84 + params.put("timestamp", System.currentTimeMillis()/1000+"");
  85 + String url = OpenUtil.buildURL("http://api.cnlive.com/open/api/dianbo/getVodInfo4Server", params, "appId对应key值");
  86 + HttpURLConnection connection;
  87 + try {
  88 + URL requestUrl = new URL(url);
  89 + connection = (HttpURLConnection)requestUrl.openConnection();
  90 + connection.setRequestMethod("GET");
  91 + connection.setDoInput(true);
  92 + connection.setDoOutput(true);
  93 + connection.connect();//连接
  94 +
  95 + //获得返回值
  96 + if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){
  97 + InputStream in = connection.getInputStream();
  98 + String currentLine = "";
  99 + if(in != null){
  100 + BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));
  101 + while((currentLine = br.readLine()) != null){
  102 + result += currentLine;
  103 + }
  104 + br.close();
  105 + }
  106 + }
  107 + }catch (Exception e) {
  108 + e.printStackTrace();
  109 + }
  110 +
  111 + if(BaseUtil.notBlank(result)) {
  112 + JSONObject resultJson = JSONObject.parseObject(result);
  113 + return resultJson
  114 + }
  115 +
  116 + return "";
  117 + }
  118 +```
0 \ No newline at end of file 119 \ No newline at end of file
01.点播云/1.1 获取点播信息接口App.md 0 → 100644
  1 +/*
  2 +Title: 1.1 获取点播信息接口
  3 +*/
  4 +
  5 +### 接口描述 ###
  6 +
  7 +
  8 +### 接口地址 ###
  9 +http://api.cnlive.com/open/api2/vod_epg/getVodInfo4App
  10 +
  11 +### 接口协议 ###
  12 +HTTP GET
  13 +
  14 +### 接口请求参数 ###
  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) |
  21 +
  22 +### 返回值 ###
  23 +
  24 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  25 +| :-----------| :------: | :------: | :------: |
  26 +| errorCode| int | true | 错误类型号 |
  27 +| errorMessage| string | true | 错误类型 |
  28 +| title| string | true | 节目标题 |
  29 +| subTitle| string | false | 节目副标题 |
  30 +| description| string | false | 节目描述 |
  31 +| createTime| string | true | 创建时间,格式:yyyyMMddHHmmss |
  32 +| publishTime| string | true | 发布时间,格式:yyyyMMddHHmmss |
  33 +| status| string | true | 节目状态,0:待发布,1:已发布,2:下线 |
  34 +| vId| string | true | 节目的唯一标识 |
  35 +| packagePomID| string | false | 节目的产品包ID |
  36 +| onePomID| string | false | 节目的产品ID |
  37 +| freePlayLength| string | false | 免费播放时长,单位 s,默认 60 |
  38 +| mp4_url_rate1 | string | false |流畅版的mp4播放地址 |
  39 +| mp4_url_rate2 | string | true | 标清版的mp4播放地址,必须有|
  40 +| mp4_url_rate3 | string | false | 高清版的mp4播放地址 |
  41 +| mp4_url_rate4 | string | false | 超清版的mp4播放地址 |
  42 +| hls_url_rate1 | string | false |流畅版的m3u8播放地址 |
  43 +| hls_url_rate2 | string | true | 标清版的m3u8播放地址,必须有|
  44 +| hls_url_rate3 | string | false | 高清版的m3u8播放地址 |
  45 +| hls_url_rate4 | string | false | 超清版的m3u8播放地址 |
  46 +
  47 +返回JSON格式的节目元数据信息,json示例如下:
  48 +
  49 +``` json
  50 +{
  51 + "errorMessage":"请求成功",
  52 + "data":{
  53 + "createTime":"20160808125905",
  54 + "publishTime":"20160808131657",
  55 + "status":"1",
  56 + "vId":"174e6c5f3d9e4ddeb739feed1906fa11",
  57 + "hls_url_rate1":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=1&isHLS=1",
  58 + "hls_url_rate3":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=3&isHLS=1",
  59 + "hls_url_rate2":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=2&isHLS=1",
  60 + "vipFlag":"0",
  61 + "packagePomID":"3_ent/xingwenrebao/yuleqianxian/",
  62 + "hls_url_rate4":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=4&isHLS=1",
  63 + "subTitle":"BTOB对粉丝甜喊:我想你们了",
  64 + "mp4_url_rate1":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=1&isHLS=0",
  65 + "title":"BTOB甜喊:我想你们了",
  66 + "mp4_url_rate3":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=3&isHLS=0",
  67 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=2&isHLS=0",
  68 + "description":"@TV娱乐前线:韩国男团BTOB近日在台北国际会议中心举行演唱会。",
  69 + "freePlayLength":"60",
  70 + "mp4_url_rate4":"http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=4&isHLS=0",
  71 + "onePomID":"3_174e6c5f3d9e4ddeb739feed1906fa11"
  72 + },
  73 + "errorCode":"0"
  74 +}
  75 +```
  76 +#### java 示例
  77 +
  78 +```java
  79 +public Object getVodUrl() {
  80 + String result = "";
  81 + Map params = new HashMap<>();
  82 + params.put("appId", "iqj730vn11");
  83 + params.put("vId", "174e6c5f3d9e4ddeb739feed1906fa11");
  84 + params.put("timestamp", System.currentTimeMillis()/1000+"");
  85 + String url = OpenUtil.buildURL("http://api.cnlive.com/open/api/dianbo/getVodInfo4App", params, "appId对应key值");
  86 + HttpURLConnection connection;
  87 + try {
  88 + URL requestUrl = new URL(url);
  89 + connection = (HttpURLConnection)requestUrl.openConnection();
  90 + connection.setRequestMethod("GET");
  91 + connection.setDoInput(true);
  92 + connection.setDoOutput(true);
  93 + connection.connect();//连接
  94 +
  95 + //获得返回值
  96 + if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){
  97 + InputStream in = connection.getInputStream();
  98 + String currentLine = "";
  99 + if(in != null){
  100 + BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));
  101 + while((currentLine = br.readLine()) != null){
  102 + result += currentLine;
  103 + }
  104 + br.close();
  105 + }
  106 + }
  107 + }catch (Exception e) {
  108 + e.printStackTrace();
  109 + }
  110 +
  111 + if(BaseUtil.notBlank(result)) {
  112 + JSONObject resultJson = JSONObject.parseObject(result);
  113 + return resultJson
  114 + }
  115 +
  116 + return "";
  117 + }
  118 +```
0 \ No newline at end of file 119 \ No newline at end of file
01.点播云/1.2 获取h5点播URL接口.md 0 → 100644
  1 +### 获取点播URL接口
  2 +-----
  3 +#### URL: http://api.cnlive.com/open/api2/vod_ips/vodplayByH5
  4 +-----
  5 +#### 接口说明: 返回点播播放地址(HLS)
  6 +-----
  7 +#### 请求方式: HTTP GET
  8 +-----
  9 +#### 返回格式: 302
  10 +-----
  11 +#### 请求参数说明:
  12 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  13 +| :----------- | :------: | :------: | :------: |
  14 +| appId | string | true | 应用ID |
  15 +| vId| string | true | 点播节目标识 |
  16 +| uid| string | false | 用户标识(uuid_时间戳),不传为0 |
  17 +| sid| string | false | 用户ID,不传为0 |
  18 +| retry | int | false | 重试次数,从0开始,不断累加,不传为0 |
  19 +| rate | int | false | 1-流畅,2-标清,3-高清,4-超清,不传为2,EPG接口会返回实际的码流路数--标清为必须项|
  20 +
  21 +#### [页面DEMO](http://open.cnlive.com/demo/vod/h5_vod_demo.html)
0 \ No newline at end of file 22 \ No newline at end of file
01.点播云/1.3 获取flash点播URL接口.md 0 → 100644
  1 +### 获取MP4播放URL接口
  2 +-----
  3 +#### URL: http://api.cnlive.com/open/api2/vod_ips/vodplayBySWF
  4 +-----
  5 +#### 接口说明: 返回MP4播放地址 (供 swf或 PC页面 调用)
  6 +-----
  7 +#### 请求方式: HTTP GET
  8 +-----
  9 +#### 返回格式: 200
  10 +-----
  11 +#### 请求参数说明:
  12 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  13 +| :----------- | :------: | :------: | :------: |
  14 +| appId | string | true | 应用ID |
  15 +| vId| string | true | 点播节目标识|
  16 +| uid| string | false | 用户标识(uuid_时间戳)|
  17 +| sid| string | false | 用户ID |
  18 +| retry | int | false | 重试次数,在0~4之间累加 |
  19 +| rate | int | false | 1-流畅,2-标清,3-高清,4-超清,不传为2,EPG接口会返回实际的码流路数--标清为必须项|
  20 +
  21 +#### 返回结果 json
  22 +```json
  23 + {
  24 + "errorMessage":"成功",
  25 + "data":{
  26 + "location":"http://wideo01.cnlive.com/video/data1/2016/0524/124025/800/b7e34cfee140449f9e04c5e85b66aa56_124025_800.mp4"
  27 + },
  28 + "errorCode":"0"
  29 + }
  30 +```
  31 +
  32 +#### java 示例
  33 +
  34 +```java
  35 + public String getFlashUrl() {
  36 + String result = "";
  37 + String mp4Url = "http://api.cnlive.com/open/api2/vod_ips/vodplayBySWF?appId=iqj730vn11&vId=174e6c5f3d9e4ddeb739feed1906fa11&rate=2";
  38 + try {
  39 + URL requestUrl = new URL(mp4Url);
  40 + connection = (HttpURLConnection)requestUrl.openConnection();
  41 + connection.setRequestMethod("GET");
  42 + connection.setDoInput(true);
  43 + connection.setDoOutput(true);
  44 + connection.connect();//连接
  45 +
  46 + //获得返回值
  47 + if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){
  48 + InputStream in = connection.getInputStream();
  49 + String currentLine = "";
  50 + if(in != null){
  51 + BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));
  52 + while((currentLine = br.readLine()) != null){
  53 + result += currentLine;
  54 + }
  55 + br.close();
  56 + }
  57 + }
  58 + }catch (Exception e) {
  59 + e.printStackTrace();
  60 + }
  61 + if(BaseUtil.notBlank(result)) {
  62 + resultJson = JSONObject.parseObject(result);
  63 + result = resultJson.getJSONObject("data").getString("location");
  64 + }
  65 + return result;
  66 + }
  67 +```
  68 +
  69 +#### [页面播放DEMO](http://open.cnlive.com/demo/vod/flash_vod_demo.html)
0 \ No newline at end of file 70 \ No newline at end of file
01.点播云/1.4 获取APP点播URL接口.md 0 → 100644
  1 +### 获取APP直播URL接口
  2 +-----
  3 +#### URL: http://api.cnlive.com/open/api2/vod_ips/vodplayByAPP
  4 +-----
  5 +#### 接口说明: 返回点播播放地址 (HLS or RTMP)
  6 +-----
  7 +#### 请求方式: HTTP GET
  8 +-----
  9 +#### 返回格式: 302
  10 +-----
  11 +#### 请求参数说明:
  12 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  13 +| :----------- | :------: | :------: | :------: |
  14 +| appId | string | true | 应用ID |
  15 +| vId| string | true | 点播节目标识 |
  16 +| uid| string | false | 用户标识(uuid_时间戳),不传为0 |
  17 +| sid| string | false | 用户ID,不传为0 |
  18 +| isHLS | int | false | 0(FLV/MP4流),1(HLS流),不传则默认为1|
  19 +| retry | int | false | 重试次数,在0--4之间递增累加 |
  20 +| rate | int | false | 1-流畅,2-标清,3-高清,4-超清,不传为2,
  21 +| sign | String | true | 签名规则见<a href="http://help.open.cnlive.com/common.html">签名详情</a> |
0 \ No newline at end of file 22 \ No newline at end of file
01.点播云/内容输出接口.md deleted 100644 → 0
1 -/*  
2 -Title: 1.1 获取点播信息接口  
3 -*/  
4 -  
5 -### 接口描述 ###  
6 -  
7 -  
8 -### 接口地址 ###  
9 -http://api.cnlive.com/open/api/dianbo/getVodInfo  
10 -  
11 -### 接口协议 ###  
12 -HTTP GET  
13 -  
14 -### 接口请求参数 ###  
15 -- vId:节目唯一标识  
16 -- sp_id:应用ID  
17 -- timestamp:时间戳,精确到秒  
18 -  
19 -### 返回值 ###  
20 -返回JSON格式的节目元数据信息,json示例如下:  
21 -  
22 -``` json  
23 -{  
24 - "message":"请求成功",  
25 - "data":{  
26 - "MAM_VideoUrl":"http://wideo03.cnlive.com/video/data1/2016/0725/137519/800/419c46d67fb34b46adbd8b7de450a0f2_137519_800.m3u8",  
27 - "MAM_VideoEditor":"许真真",  
28 - "weight":"80",  
29 - "MAM_VideoUHUrl":"",  
30 - "pageUrl":"http://www.cnlive.com/fengcaidasai/v_gy2tmmrxgy.html",  
31 - "MAM_VideoLUrl":"http://wideo03.cnlive.com/video/data1/2016/0725/137519/400/419c46d67fb34b46adbd8b7de450a0f2_137519_400.m3u8",  
32 - "vipFlag":"0",  
33 - "CMSChannelName":"华语风采大赛",  
34 - "type":"program",  
35 - "packagePomID":"3_fengcaidasai/dianfengduijue/",  
36 - "MAM_BigPostUrl":"http://y3.cnliveimg.com:8080/image/itv/2016/0725/419c46d67fb34b46adbd8b7de450a0f2_137519_101.jpg",  
37 - "cmsChannelID":"fengcaidasai/",  
38 - "MAM_ProducerID":"先锋派",  
39 - "activityId":"",  
40 - "title":"刘子赫孙悟空大闹天宫",  
41 - "docSubTitle":"刘子赫孙悟空大闹天宫",  
42 - "MAM_NodeID":"016-020-003",  
43 - "MAM_TVColumMarkID":"",  
44 - "playAuto":"xiangguanshipin",  
45 - "docID":"656276",  
46 - "onePomID":"3_419c46d67fb34b46adbd8b7de450a0f2",  
47 - "MAM_SmallPosterUrl":"http://y3.cnliveimg.com:8080/image/itv/2016/0725/419c46d67fb34b46adbd8b7de450a0f2_137519_100.jpg",  
48 - "CMCCNodeID":"",  
49 - "MAM_PrgType":"1",  
50 - "publishDate":"2016-07-25 16:47:32",  
51 - "mediaId":"419c46d67fb34b46adbd8b7de450a0f2",  
52 - "MAM_Duration":"293000",  
53 - "MAM_CPNAME":"魅力快线3",  
54 - "MAM_NodeName":"大型专题/华语风采大赛/巅峰对决",  
55 - "vip_product_id":"",  
56 - "status":"1",  
57 - "WEB_Copyright":1,  
58 - "MAM_PosterUrl":"http://y3.cnliveimg.com:8080/image/itv/2016/0725/419c46d67fb34b46adbd8b7de450a0f2_137519_100.jpg",  
59 - "cmsColumnID":"fengcaidasai/dianfengduijue/",  
60 - "MAM_CreatDate":"2016-07-25 16:22:45",  
61 - "APP_Copyright":1,  
62 - "docBodyContent":"",  
63 - "MAM_VideoFlashUHUrl":"",  
64 - "MAM_VideoFlashHUrl":"http://wideo03.cnlive.com/video/data1/2016/0725/137519/1500/419c46d67fb34b46adbd8b7de450a0f2_137519_1500.mp4",  
65 - "MAM_VideoHUrl":"http://wideo03.cnlive.com/video/data1/2016/0725/137519/1500/419c46d67fb34b46adbd8b7de450a0f2_137519_1500.m3u8",  
66 - "CMSColumnName":"巅峰对决",  
67 - "CMCCID":"",  
68 - "freePlayLength":"60",  
69 - "MAM_VideoFlashUrl":"http://wideo03.cnlive.com/video/data1/2016/0725/137519/800/419c46d67fb34b46adbd8b7de450a0f2_137519_800.mp4",  
70 - "docDescription":"刘子赫精彩演绎孙悟空大闹天宫。",  
71 - "MAM_TVDate":"",  
72 - "modules":[  
73 - {  
74 - "id":"xiangguanshipin",  
75 - "title":"相关推荐"  
76 - }  
77 - ],  
78 - "colName":"",  
79 - "MAM_VideoFlashLUrl":"http://wideo03.cnlive.com/video/data1/2016/0725/137519/400/419c46d67fb34b46adbd8b7de450a0f2_137519_400.mp4"  
80 - },  
81 - "errorCode":"0"  
82 -}  
83 -```  
84 -  
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) {  
137 - String result = "";  
138 - Map params = new HashMap<>();  
139 - params.put("sp_id", "iqhpk8pl19");  
140 - params.put("vId", "419c46d67fb34b46adbd8b7de450a0f2");  
141 - params.put("timestamp", System.currentTimeMillis()/1000+"");  
142 - String url = OpenUtil.buildURL("http://api.cnlive.com/open/api/dianbo/getVodInfo", params, "672db30805f848f59ec3728f8347a4a0");  
143 - HttpURLConnection connection;  
144 - try {  
145 - URL requestUrl = new URL(url);  
146 - connection = (HttpURLConnection)requestUrl.openConnection();  
147 - connection.setRequestMethod("GET");  
148 - connection.setDoInput(true);  
149 - connection.setDoOutput(true);  
150 - connection.connect();//连接  
151 -  
152 - //获得返回值  
153 - if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){  
154 - InputStream in = connection.getInputStream();  
155 - String currentLine = "";  
156 - if(in != null){  
157 - BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));  
158 - while((currentLine = br.readLine()) != null){  
159 - result += currentLine;  
160 - }  
161 - br.close();  
162 - }  
163 - }  
164 - }catch (Exception e) {  
165 - e.printStackTrace();  
166 - }  
167 -  
168 - if(BaseUtil.notBlank(result)) {  
169 - JSONObject resultJson = JSONObject.parseObject(result);  
170 - model.put("videoInfo", resultJson);  
171 - }  
172 -  
173 - return "play_demo";  
174 - }  
175 -```  
176 \ No newline at end of file 0 \ No newline at end of file
02.直播云/1.0 获取直播活动信息接口Server.md 0 → 100644
  1 +/*
  2 +Title: 1.1 获取某直播活动信息接口 for WebServer
  3 +*/
  4 +
  5 +### 接口描述 ###
  6 +
  7 +
  8 +### 接口地址 ###
  9 +http://api.cnlive.com/open/api2/live_epg/getLiveActivityPlayInfo4Server
  10 +
  11 +### 接口协议 ###
  12 +HTTP GET
  13 +
  14 +### 接口请求参数 ###
  15 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  16 +| :----------- | :------: | :------: | :------: |
  17 +| appId | string | true | 应用ID |
  18 +| activityId| string | true | 由开发者通过API创建接口或者在直播云管理端创建,保证唯一性 |
  19 +| timestamp | int | true | 精确到秒,当前Unix时间戳,请保证请求服务器时间正确 |
  20 +| sign | String | true | 签名规则见 [签名详情] (http://help.open.cnlive.com/common.html) |
  21 +
  22 +
  23 +### 返回值 ###
  24 +
  25 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  26 +| :----------- | :------: | :------: | :------: |
  27 +| errorCode | int | true | 错误类型号 |
  28 +| errorMessage| string | true | 错误类型 |
  29 +| activityId| string | true | 活动ID,确保SP下的唯一性 |
  30 +| activityName | string | true | 活动名称 |
  31 +| activityStatus | int | true | 活动状态,0:未开始 /1:已开始 /3:已结束 /4 已下线,默认为0 |
  32 +| isHorizontalScreen | int | true | 屏幕方向,0:垂直即竖屏 /1:水平即横屏 ,默认为1 |
  33 +| channelID | string | true | 播放通道;PGC业务:平台分配/ UGC业务:主播ID生成,确保SP下的唯一性 |
  34 +| createTime | string | false | 开始时间,格式yyyyMMddHHmmss |
  35 +| startTime | string | false | 开始时间,格式yyyyMMddHHmmss |
  36 +| endTime | string | false | 开始时间,格式yyyyMMddHHmmss |
  37 +| coverImgUrl | string | false | 活动封面 |
  38 +| activityCategory | string | false | 活动分类ID,001 发布会/002 婚礼/003 年会 /004 体育/005 游戏/006 旅游&户外/007 财经/008 演唱会/009 烹饪/010 宠物&动物/011 访谈/012 教育/013 竞技/014 剧场/015 晚会/016 电视节目/017 秀场 |
  39 +| extensions | string | false | 扩展字段,参数格式为Map对象的Json字符串 (主播昵称、头像等等) |
  40 +| mp4_url_rate1 | string | false |流畅版的rtmp播放地址 |
  41 +| mp4_url_rate2 | string | true | 标清版的rtmp播放地址,必须有|
  42 +| mp4_url_rate3 | string | false | 高清版的rtmp播放地址 |
  43 +| mp4_url_rate4 | string | false | 超清版的rtmp播放地址 |
  44 +| hls_url_rate1 | string | false |流畅版的m3u8播放地址 |
  45 +| hls_url_rate2 | string | true | 标清版的m3u8播放地址,必须有|
  46 +| hls_url_rate3 | string | false | 高清版的m3u8播放地址 |
  47 +| hls_url_rate4 | string | false | 超清版的m3u8播放地址 |
  48 +| extViews | 对象数组 | false | 扩展机位的播放信息(不含主画面PGM的播放信息) |
  49 +
  50 +返回JSON格式的节目元数据信息,json示例如下:
  51 +
  52 +``` json
  53 +{
  54 + "errorCode":"0",
  55 + "messagae":"请求成功",
  56 + "data"{
  57 + "activityId":"xxxxx",
  58 + "activityStatus":"1",
  59 + "activityName":"测试活动",
  60 + "coverImgUrl":"小图图片URL",
  61 + "isHorizontalScreen":"1",
  62 + "channelID":"xinyingshi",
  63 + "startTime":"",
  64 + "endTime":"",
  65 + "createTime":"",
  66 + "extensions":"",
  67 + "activityCategory":"",
  68 + "mp4_url_rate1":"",
  69 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayBySWF?channelID=xinyingshi&appId=iqj730vn11",
  70 + "mp4_url_rate3":"",
  71 + "mp4_url_rate4":"",
  72 + "hls_url_rate1":"",
  73 + "hls_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByH5?channelID=xinyingshi&appId=iqj730vn11",
  74 + "hls_url_rate3":"",
  75 + "hls_url_rate4":"",
  76 + "extViews"[
  77 + {
  78 + "channelID":"xinyingshi",
  79 + "mp4_url_rate1":"",
  80 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayBySWF?channelID=xinyingshi&appId=iqj730vn11",
  81 + "mp4_url_rate3":"",
  82 + "mp4_url_rate4":"",
  83 + "hls_url_rate1":"",
  84 + "hls_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByH5?channelID=xinyingshi&appId=iqj730vn11",
  85 + "hls_url_rate3":"",
  86 + "hls_url_rate4":""
  87 + },
  88 + {
  89 + "channelID":"xinyingshi",
  90 + "mp4_url_rate1":"",
  91 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayBySWF?channelID=xinyingshi&appId=iqj730vn11",
  92 + "mp4_url_rate3":"",
  93 + "mp4_url_rate4":"",
  94 + "hls_url_rate1":"",
  95 + "hls_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByH5?channelID=xinyingshi&appId=iqj730vn11",
  96 + "hls_url_rate3":"",
  97 + "hls_url_rate4":""
  98 + }
  99 + ]
  100 + }
  101 +}
  102 +```
  103 +
  104 +
  105 +
  106 +``` java
  107 +public String getPlayInfo() {
  108 + String result = "";
  109 + Map params = new HashMap<>();
  110 + params.put("appId", "iqj730vn11");
  111 + params.put("activityId", "d849bb4277be42799df3ffc21654d949");
  112 + params.put("timestamp", System.currentTimeMillis()/1000+"");
  113 + String url = OpenUtil.buildURL("http://api.cnlive.com/open/api2/live_epg/getLiveActivityPlayInfo4Server", params, "87ef486a53d637524ba75a4ebcb2d6d8c48d00e56fc2d4");
  114 + HttpURLConnection connection;
  115 + try {
  116 + URL requestUrl = new URL(url);
  117 + connection = (HttpURLConnection)requestUrl.openConnection();
  118 + connection.setRequestMethod("GET");
  119 + connection.setDoInput(true);
  120 + connection.setDoOutput(true);
  121 + connection.connect();//连接
  122 +
  123 + //获得返回值
  124 + if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){
  125 + InputStream in = connection.getInputStream();
  126 + String currentLine = "";
  127 + if(in != null){
  128 + BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));
  129 + while((currentLine = br.readLine()) != null){
  130 + result += currentLine;
  131 + }
  132 + br.close();
  133 + }
  134 + }
  135 + }catch (Exception e) {
  136 + e.printStackTrace();
  137 + }
  138 +
  139 + if(BaseUtil.notBlank(result)) {
  140 + JSONObject resultJson = JSONObject.parseObject(result);
  141 + return resultJson.getJSONObject("data").getString("hls_url_rate2");
  142 + }
  143 +
  144 + return "";
  145 + }
  146 +```
0 \ No newline at end of file 147 \ No newline at end of file
02.直播云/1.1 获取直播活动信息接口.md renamed to 02.直播云/1.1 获取直播活动信息接口APP.md
1 /* 1 /*
2 -Title: 1.1 获取某直播活动信息接口 for APP_SDK or WebServer 2 +Title: 1.1 获取某直播活动信息接口 for APP_SDK
3 */ 3 */
4 4
5 ### 接口描述 ### 5 ### 接口描述 ###
6 6
7 7
8 ### 接口地址 ### 8 ### 接口地址 ###
9 -http://api.cnlive.com/open/api2/live_zbsc/getLiveActivityPlayInfo 9 +http://api.cnlive.com/open/api2/live_epg/getLiveActivityPlayInfo4App
10 10
11 ### 接口协议 ### 11 ### 接口协议 ###
12 HTTP GET 12 HTTP GET
@@ -17,6 +17,7 @@ HTTP GET @@ -17,6 +17,7 @@ HTTP GET
17 | appId | string | true | 应用ID | 17 | appId | string | true | 应用ID |
18 | activityId| string | true | 由开发者通过API创建接口或者在直播云管理端创建,保证唯一性 | 18 | activityId| string | true | 由开发者通过API创建接口或者在直播云管理端创建,保证唯一性 |
19 | timestamp | int | true | 精确到秒,当前Unix时间戳,请保证请求服务器时间正确 | 19 | timestamp | int | true | 精确到秒,当前Unix时间戳,请保证请求服务器时间正确 |
  20 +| platform_id | String | true | 平台ID,鉴权 |
20 | sign | String | true | 签名规则见 [签名详情] (http://help.open.cnlive.com/common.html) | 21 | sign | String | true | 签名规则见 [签名详情] (http://help.open.cnlive.com/common.html) |
21 22
22 23
@@ -25,10 +26,10 @@ HTTP GET @@ -25,10 +26,10 @@ HTTP GET
25 | 参数名 | 参数类型 | 必选 | 参数说明 | 26 | 参数名 | 参数类型 | 必选 | 参数说明 |
26 | :----------- | :------: | :------: | :------: | 27 | :----------- | :------: | :------: | :------: |
27 | errorCode | int | true | 错误类型号 | 28 | errorCode | int | true | 错误类型号 |
28 -| message| string | true | 错误类型 |  
29 -| activityid| string | true | 活动ID,确保SP下的唯一性 |  
30 -| activityname | string | true | 活动名称 |  
31 -| activitystatus | int | true | 活动状态,0:未开始 /1:已开始 /3:已结束 /4 已下线,默认为0 | 29 +| errorMessage| string | true | 错误类型 |
  30 +| activityId| string | true | 活动ID,确保SP下的唯一性 |
  31 +| activityName | string | true | 活动名称 |
  32 +| activityStatus | int | true | 活动状态,0:未开始 /1:已开始 /3:已结束 /4 已下线,默认为0 |
32 | isHorizontalScreen | int | true | 屏幕方向,0:垂直即竖屏 /1:水平即横屏 ,默认为1 | 33 | isHorizontalScreen | int | true | 屏幕方向,0:垂直即竖屏 /1:水平即横屏 ,默认为1 |
33 | channelID | string | true | 播放通道;PGC业务:平台分配/ UGC业务:主播ID生成,确保SP下的唯一性 | 34 | channelID | string | true | 播放通道;PGC业务:平台分配/ UGC业务:主播ID生成,确保SP下的唯一性 |
34 | createTime | string | false | 开始时间,格式yyyyMMddHHmmss | 35 | createTime | string | false | 开始时间,格式yyyyMMddHHmmss |
@@ -52,11 +53,11 @@ HTTP GET @@ -52,11 +53,11 @@ HTTP GET
52 ``` json 53 ``` json
53 { 54 {
54 "errorCode":"0", 55 "errorCode":"0",
55 - "messagae":"请求成功", 56 + "message":"请求成功",
56 "data"{ 57 "data"{
57 - "activityid":"xxxxx",  
58 - "activitystatus":"1",  
59 - "activityname":"测试活动", 58 + "activityId":"xxxxx",
  59 + "activityStatus":1,
  60 + "activityName":"测试活动",
60 "coverImgUrl":"小图图片URL", 61 "coverImgUrl":"小图图片URL",
61 "isHorizontalScreen":"1", 62 "isHorizontalScreen":"1",
62 "channelID":"xinyingshi", 63 "channelID":"xinyingshi",
@@ -66,31 +67,33 @@ HTTP GET @@ -66,31 +67,33 @@ HTTP GET
66 "extensions":"", 67 "extensions":"",
67 "activityCategory":"", 68 "activityCategory":"",
68 "mp4_url_rate1":"", 69 "mp4_url_rate1":"",
69 - "mp4_url_rate2":"http://api.cnlive.com/open/api3/play/IPS/liveplayBySWF?channelID=xinyingshi&rate=2&sp_id=iqhpk8pl19", 70 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByAPP?channelID=xinyingshi&appId=iqj730vn11&isHLS=0",
70 "mp4_url_rate3":"", 71 "mp4_url_rate3":"",
71 "mp4_url_rate4":"", 72 "mp4_url_rate4":"",
72 "hls_url_rate1":"", 73 "hls_url_rate1":"",
73 - "hls_url_rate2":"http://api.cnlive.com/open/api3/play/IPS/liveplay?channelID=xinyingshi&rate=2&sp_id=iqhpk8pl19", 74 + "hls_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByAPP?channelID=xinyingshi&appId=iqj730vn11&isHLS=1",
74 "hls_url_rate3":"", 75 "hls_url_rate3":"",
75 "hls_url_rate4":"", 76 "hls_url_rate4":"",
76 "extViews"[ 77 "extViews"[
77 78
  79 + "channelID":"xinyingshi",
78 "mp4_url_rate1":"", 80 "mp4_url_rate1":"",
79 - "mp4_url_rate2":"http://api.cnlive.com/open/api3/play/IPS/liveplayBySWF?channelID=xinyingshi_m1&rate=2&sp_id=iqhpk8pl19", 81 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByAPP?channelID=xinyingshi&appId=iqj730vn11&isHLS=0",
80 "mp4_url_rate3":"", 82 "mp4_url_rate3":"",
81 "mp4_url_rate4":"", 83 "mp4_url_rate4":"",
82 "hls_url_rate1":"", 84 "hls_url_rate1":"",
83 - "hls_url_rate2":"http://api.cnlive.com/open/api3/play/IPS/liveplay?channelID=xinyingshi_m1&rate=2&sp_id=iqhpk8pl19", 85 + "hls_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByAPP?channelID=xinyingshi&appId=iqj730vn11&isHLS=1",
84 "hls_url_rate3":"", 86 "hls_url_rate3":"",
85 "hls_url_rate4":"" 87 "hls_url_rate4":""
86 }, 88 },
87 89
  90 + "channelID":"xinyingshi",
88 "mp4_url_rate1":"", 91 "mp4_url_rate1":"",
89 - "mp4_url_rate2":"http://api.cnlive.com/open/api3/play/IPS/liveplayBySWF?channelID=xinyingshi_m2&rate=2&sp_id=iqhpk8pl19", 92 + "mp4_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByAPP?channelID=xinyingshi&appId=iqj730vn11&isHLS=0",
90 "mp4_url_rate3":"", 93 "mp4_url_rate3":"",
91 "mp4_url_rate4":"", 94 "mp4_url_rate4":"",
92 "hls_url_rate1":"", 95 "hls_url_rate1":"",
93 - "hls_url_rate2":"http://api.cnlive.com/open/api3/play/IPS/liveplay?channelID=xinyingshi_m2&rate=2&sp_id=iqhpk8pl19", 96 + "hls_url_rate2":"http://api.cnlive.com/open/api2/live_ips/liveplayByAPP?channelID=xinyingshi&appId=iqj730vn11&isHLS=1",
94 "hls_url_rate3":"", 97 "hls_url_rate3":"",
95 "hls_url_rate4":"" 98 "hls_url_rate4":""
96 99
@@ -100,15 +103,17 @@ HTTP GET @@ -100,15 +103,17 @@ HTTP GET
100 ``` 103 ```
101 104
102 105
  106 +#### java示例
103 107
104 ``` java 108 ``` java
105 -public String getPlayInfo() { 109 +public Object getPlayInfo() {
106 String result = ""; 110 String result = "";
107 Map params = new HashMap<>(); 111 Map params = new HashMap<>();
108 - params.put("sp_id", "iqhpk8pl19");  
109 - params.put("customID", "d849bb4277be42799df3ffc21654d949"); 112 + params.put("appId", "iqj730vn11");
  113 + params.put("acitivityId", "d849bb4277be42799df3ffc21654d949");
110 params.put("timestamp", System.currentTimeMillis()/1000+""); 114 params.put("timestamp", System.currentTimeMillis()/1000+"");
111 - String url = OpenUtil.buildURL("http://api.cnlive.com/open/api2/zbsc/getLiveActivityPlayInfo", params, "672db30805f848f59ec3728f8347a4a0"); 115 + params.put("platform_id", "");
  116 + String url = OpenUtil.buildURL("http://api.cnlive.com/open/api2/live_epg/getLiveActivityPlayInfo4App", params, "87ef486a53d637524ba75a4ebcb2d6d8c48d00e56fc2d4");
112 HttpURLConnection connection; 117 HttpURLConnection connection;
113 try { 118 try {
114 URL requestUrl = new URL(url); 119 URL requestUrl = new URL(url);
@@ -136,7 +141,7 @@ public String getPlayInfo() { @@ -136,7 +141,7 @@ public String getPlayInfo() {
136 141
137 if(BaseUtil.notBlank(result)) { 142 if(BaseUtil.notBlank(result)) {
138 JSONObject resultJson = JSONObject.parseObject(result); 143 JSONObject resultJson = JSONObject.parseObject(result);
139 - return resultJson.getJSONObject("data").getString("hls_url_rate2"); 144 + return resultJson;
140 } 145 }
141 146
142 return ""; 147 return "";
02.直播云/1.2 获取flash直播URL接口.md
1 ### 获取RTMP直播播放URL接口 1 ### 获取RTMP直播播放URL接口
2 ----- 2 -----
3 -#### URL: http://api.cnlive.com/open/api2/play/IPS/liveplayBySWF 3 +#### URL: http://api.cnlive.com/open/api2/live_ips/liveplayBySWF
4 ----- 4 -----
5 #### 接口说明: 返回RTMP/FLV直播播放地址 (供 swf或 PC页面 调用) 5 #### 接口说明: 返回RTMP/FLV直播播放地址 (供 swf或 PC页面 调用)
6 ----- 6 -----
@@ -11,12 +11,59 @@ @@ -11,12 +11,59 @@
11 #### 请求参数说明: 11 #### 请求参数说明:
12 | 参数名 | 参数类型 | 必选 | 参数说明 | 12 | 参数名 | 参数类型 | 必选 | 参数说明 |
13 | :----------- | :------: | :------: | :------: | 13 | :----------- | :------: | :------: | :------: |
14 -| sp_id | string | true | 应用ID | 14 +| appId | string | true | 应用ID |
15 | channelID| string | true | 直播频道或 devID_主播ID | 15 | channelID| string | true | 直播频道或 devID_主播ID |
16 | uid| string | false | 用户标识(uuid_时间戳)| 16 | uid| string | false | 用户标识(uuid_时间戳)|
17 | sid| string | false | 用户ID | 17 | sid| string | false | 用户ID |
18 | retry | int | false | 重试次数,在0~4之间累加 | 18 | retry | int | false | 重试次数,在0~4之间累加 |
19 | rate | int | false | 1-流畅,2-标清,3-高清,4-超清,不传为2,EPG接口会返回实际的码流路数--标清为必须项| 19 | rate | int | false | 1-流畅,2-标清,3-高清,4-超清,不传为2,EPG接口会返回实际的码流路数--标清为必须项|
20 20
  21 +#### 返回结果 json
  22 +```json
  23 + {
  24 + "errorMessage":"成功",
  25 + "data":{
  26 + "location":"rtmp://wsrtmp4.live.cnlive.com/cdn/xinyingshi?wsSecret=f10722a1a2ffd198772b2ac8cf1c0afb&wsTime=57a3f066"
  27 + },
  28 + "errorCode":"0"
  29 + }
  30 +```
21 31
22 -#### 页面播放DEMO:  
23 \ No newline at end of file 32 \ No newline at end of file
  33 +#### java 示例
  34 +
  35 +```java
  36 + public String getFlashUrl() {
  37 + String result = "";
  38 + String mp4Url = "http://api.cnlive.com/open/api2/live_ips/liveplayBySWF?channelID=xinyingshi&appId=iqj730vn11";
  39 + try {
  40 + URL requestUrl = new URL(mp4Url);
  41 + connection = (HttpURLConnection)requestUrl.openConnection();
  42 + connection.setRequestMethod("GET");
  43 + connection.setDoInput(true);
  44 + connection.setDoOutput(true);
  45 + connection.connect();//连接
  46 +
  47 + //获得返回值
  48 + if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){
  49 + InputStream in = connection.getInputStream();
  50 + String currentLine = "";
  51 + if(in != null){
  52 + BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));
  53 + while((currentLine = br.readLine()) != null){
  54 + result += currentLine;
  55 + }
  56 + br.close();
  57 + }
  58 + }
  59 + }catch (Exception e) {
  60 + e.printStackTrace();
  61 + }
  62 + if(BaseUtil.notBlank(result)) {
  63 + resultJson = JSONObject.parseObject(result);
  64 + result = resultJson.getJSONObject("data").getString("location");
  65 + }
  66 + return result;
  67 + }
  68 +```
  69 +
  70 +#### [页面播放DEMO](http://open.cnlive.com/demo/live/flash_live_demo.html)
24 \ No newline at end of file 71 \ No newline at end of file
02.直播云/1.3 创建直播活动接口.md
1 ### 创建直播活动接口 1 ### 创建直播活动接口
2 ----- 2 -----
3 -#### URL: http://api.cnlive.com/open/api2/live_zbsc/createActivity 3 +#### URL: http://api.cnlive.com/open/api2/live_epg/createActivity
4 ----- 4 -----
5 #### 接口说明: 返回直播播放地址 5 #### 接口说明: 返回直播播放地址
6 ----- 6 -----
02.直播云/1.7 获取直播回放接口.md
1 -### 创建直播活动接口 1 +### 获取直播的回放接口
2 ----- 2 -----
3 -#### URL: http://api.cnlive.com/open/api3/play/IPS/CreateActivity 3 +#### URL: http://api.cnlive.com/open/api2/live_zbsc/getActivityVodInfo
4 ----- 4 -----
5 -#### 接口说明: 返回直播播放地址 5 +#### 接口说明: 返回直播回放节目的EPG
6 ----- 6 -----
7 #### 请求方式: HTTP GET 7 #### 请求方式: HTTP GET
8 ----- 8 -----
@@ -11,11 +11,8 @@ @@ -11,11 +11,8 @@
11 #### 请求参数说明: 11 #### 请求参数说明:
12 | 参数名 | 参数类型 | 必选 | 参数说明 | 12 | 参数名 | 参数类型 | 必选 | 参数说明 |
13 | :----------- | :------: | :------: | :------: | 13 | :----------- | :------: | :------: | :------: |
14 -| sp_id | string | true | 应用ID | 14 +| appId | string | true | 应用ID |
15 | activityid| string | true | 活动ID,确保SP下的唯一性 | 15 | activityid| string | true | 活动ID,确保SP下的唯一性 |
16 -| activityname | string | false | 活动名称 |  
17 -| channelID | string | true | 播放通道;PGC:平台分配/UGC:主播ID生成,确保SP下的唯一性 |  
18 -| sp_id | string | true | 应用ID |  
19 | sign | String | true | 签名规则见<a href="http://help.open.cnlive.com/common.html">签名详情</a> | 16 | sign | String | true | 签名规则见<a href="http://help.open.cnlive.com/common.html">签名详情</a> |
20 17
21 #### 返回说明: 18 #### 返回说明:
@@ -23,5 +20,7 @@ @@ -23,5 +20,7 @@
23 { 20 {
24 "errorCode":"0", 21 "errorCode":"0",
25 "messagae":"请求成功" 22 "messagae":"请求成功"
  23 + data{
  24 + }
26 } 25 }
27 ``` 26 ```
28 \ No newline at end of file 27 \ No newline at end of file
02.直播云/1.8 获取APP直播URL接口.md
1 ### 获取APP直播URL接口 1 ### 获取APP直播URL接口
2 ----- 2 -----
3 -#### URL: http://api.cnlive.com/open/api3/play/IPS/liveplayByAPP 3 +#### URL: http://api.cnlive.com/open/api2/live_ips/liveplayByAPP
4 ----- 4 -----
5 #### 接口说明: 返回直播播放地址 (HLS or RTMP) 5 #### 接口说明: 返回直播播放地址 (HLS or RTMP)
6 ----- 6 -----
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 #### 请求参数说明: 11 #### 请求参数说明:
12 | 参数名 | 参数类型 | 必选 | 参数说明 | 12 | 参数名 | 参数类型 | 必选 | 参数说明 |
13 | :----------- | :------: | :------: | :------: | 13 | :----------- | :------: | :------: | :------: |
14 -| sp_id | string | true | 应用ID | 14 +| appId | string | true | 应用ID |
15 | channelID| string | true | 直播频道或主播ID | 15 | channelID| string | true | 直播频道或主播ID |
16 | uid| string | false | 用户标识(uuid_时间戳),不传为0 | 16 | uid| string | false | 用户标识(uuid_时间戳),不传为0 |
17 | sid| string | false | 用户ID,不传为0 | 17 | sid| string | false | 用户ID,不传为0 |
02.直播云/1.9 获取H5直播URL接口.md
1 ### 获取直播URL接口 1 ### 获取直播URL接口
2 ----- 2 -----
3 -#### URL: http://api.cnlive.com/open/api3/play/IPS/liveplayByH5 3 +#### URL: http://api.cnlive.com/open/api2/live_ips/liveplayByH5
4 ----- 4 -----
5 #### 接口说明: 返回直播播放地址(HLS) 5 #### 接口说明: 返回直播播放地址(HLS)
6 ----- 6 -----
@@ -11,9 +11,11 @@ @@ -11,9 +11,11 @@
11 #### 请求参数说明: 11 #### 请求参数说明:
12 | 参数名 | 参数类型 | 必选 | 参数说明 | 12 | 参数名 | 参数类型 | 必选 | 参数说明 |
13 | :----------- | :------: | :------: | :------: | 13 | :----------- | :------: | :------: | :------: |
14 -| sp_id | string | true | 应用ID | 14 +| appId | string | true | 应用ID |
15 | channelID| string | true | 直播频道或主播ID | 15 | channelID| string | true | 直播频道或主播ID |
16 -| uuid| string | false | 用户标识(uuid_时间戳),不传为0 | 16 +| uid| string | false | 用户标识(uuid_时间戳),不传为0 |
17 | sid| string | false | 用户ID,不传为0 | 17 | sid| string | false | 用户ID,不传为0 |
18 | retry | int | false | 重试次数,从0开始,不断累加,不传为0 | 18 | retry | int | false | 重试次数,从0开始,不断累加,不传为0 |
19 -| rate | int | false | 1-流畅,2-标清,3-高清,4-超清,不传为2,EPG接口会返回实际的码流路数--标清为必须项|  
20 \ No newline at end of file 19 \ No newline at end of file
  20 +| rate | int | false | 1-流畅,2-标清,3-高清,4-超清,不传为2,EPG接口会返回实际的码流路数--标清为必须项|
  21 +
  22 +#### [页面DEMO](http://open.cnlive.com/demo/live/h5_live_demo.html)
21 \ No newline at end of file 23 \ No newline at end of file
04.用户云/1.6 登录注册-登录.md
@@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
17 <th>说明</th> 17 <th>说明</th>
18 </tr> 18 </tr>
19 <tr> 19 <tr>
20 - <td>spId</td> 20 + <td>appId</td>
21 <td>true</td> 21 <td>true</td>
22 <td>string</td> 22 <td>string</td>
23 - <td>服务提供商ID</td> 23 + <td>应用ID</td>
24 </tr> 24 </tr>
25 <tr> 25 <tr>
26 <td>userName</td> 26 <td>userName</td>
05.互动云/3.1 创建聊天室接口.md
1 -/* Title: 3.1 创建聊天室接口 */  
2 ### 创建聊天室接口 1 ### 创建聊天室接口
3 ----- 2 -----
4 #### URL: http://api.cnlive.com/open/api2/chat/createRoom 3 #### URL: http://api.cnlive.com/open/api2/chat/createRoom
05.互动云/3.2 释放聊天室接口.md
1 -/* Title: 3.2 释放聊天室接口 */  
2 ### 释放聊天室接口 1 ### 释放聊天室接口
3 ----- 2 -----
4 #### URL: http://api.cnlive.com/open/api2/chat/releaseRoom 3 #### URL: http://api.cnlive.com/open/api2/chat/releaseRoom
05.互动云/3.3 发送聊天信息接口.md
1 -/* Title: 3.4 发送聊天信息接口 */  
2 ### 发送聊天信息接口 1 ### 发送聊天信息接口
3 ----- 2 -----
4 #### URL: http://api.cnlive.com/open/api2/chat/sendMessage 3 #### URL: http://api.cnlive.com/open/api2/chat/sendMessage
05.互动云/3.6 客户端SDK连接聊天室鉴权接口.md
  1 +### 客户端SDK连接聊天室鉴权接口
  2 +-----
  3 +#### URL: http://api.cnlive.com/open/api2/interacitve_chat/CnliveM3/chat/roomAuthCheck
  4 +-----
  5 +#### 请求方式: HTTP POST
  6 +-----
  7 +#### 返回格式: JSON
  8 +-----
  9 +#### 请求参数说明:
  10 +| 参数名 | 参数类型 | 必选 | 参数说明 |
  11 +| :-----------: | :------: | :------: | :------: |
  12 +| appId | String | true | 应用ID |
  13 +| id | String | true | 聊天室ID |
  14 +| sign | String | true | 签名|
  15 +-----
  16 +#### 返回格式说明:
  17 +```
  18 +{
  19 + "errorCode":"0",
  20 + "errorMessage":"成功"
  21 +}
  22 +
  23 +{
  24 + "errorCode":"530xx",
  25 + "errorMessage":"无权访问"
  26 +}
  27 +
  28 +```
0 \ No newline at end of file 29 \ No newline at end of file