Commit 99a61d1de645cf5620fd27cf413c75a332f1a09b
1 parent
e07ad0a2
1
Showing
1 changed file
with
16 additions
and
62 deletions
01.点播云/1.01 播放器获取EPG信息接口.md
| 1 | 1 | /* |
| 2 | -Title: 1.1 获取点播信息接口 | |
| 2 | +Title: 1.01 播放器获取点播信息接口 | |
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | 5 | ### 接口描述 ### |
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | ### 接口地址 ### |
| 9 | -http://api.cnlive.com/open/api2/vod_epg/getVodInfo4Server | |
| 9 | +http://api.cnlive.com/open/api2/vod_epg/getVodInfo4Player | |
| 10 | 10 | |
| 11 | 11 | ### 接口协议 ### |
| 12 | 12 | HTTP GET |
| ... | ... | @@ -16,26 +16,26 @@ HTTP GET |
| 16 | 16 | |:----- | :------: | :------: | :------: | |
| 17 | 17 | |appId| string | true | 应用ID | |
| 18 | 18 | |vId| string | true | 点播节目标识(直播回放的vId就是创建直播活动时的activityId) | |
| 19 | -|timestamp| int | true | 精确到秒,当前Unix时间戳,请保证请求服务器时间正确 | | |
| 20 | -|sign| String | true | 签名规则见 [签名详情] (http://help.open.cnlive.com/common.html) | | |
| 19 | +|uid| string | false | 用户标识(uuid_时间戳) | | |
| 20 | +|sid| String | false | 用户ID | | |
| 21 | +|retry| int | false | 重试次数,在0~4之间累加 | | |
| 22 | +|isHLS| int | false | 0:mp4流,1:hls流 | | |
| 21 | 23 | |
| 22 | 24 | ### 返回值 ### |
| 23 | 25 | |
| 24 | 26 | | 参数名 | 参数类型 | 必选 | 参数说明 | |
| 25 | 27 | | :-----------| :------: | :------: | :------: | |
| 26 | 28 | | errorCode| int | true | 错误类型号 | |
| 27 | -| errorMessage| string | true | 错误类型 | | |
| 29 | +| errorMessage| string | true | 错误信息 | | |
| 28 | 30 | | title| string | true | 节目标题 | |
| 29 | 31 | | subTitle| string | false | 节目副标题 | |
| 30 | 32 | | description| string | false | 节目描述 | |
| 31 | -| createTime| string | true | 创建时间,格式:yyyyMMddHHmmss | | |
| 32 | -| publishTime| string | true | 发布时间,格式:yyyyMMddHHmmss | | |
| 33 | -| status| string | true | 节目状态,0:待发布,1:已发布,2:下线 | | |
| 33 | +| status| string | true | 节目状态,1:上线,2:下线 | | |
| 34 | 34 | | vId| string | true | 节目的唯一标识 | |
| 35 | -| packagePomID| string | false | 节目的产品包ID | | |
| 36 | -| onePomID| string | false | 节目的产品ID | | |
| 37 | -| freePlayLength| string | false | 免费播放时长,单位 s,默认 60 | | |
| 38 | -| rates | string | ture |清晰度标识,多个用逗号隔开: 流畅版=1,清晰版=2,高清版=3,超高清=4 | | |
| 35 | +| videoUrl_1 | string | false |播放地址 流畅版 清晰版=2,高清版=3,超高清=4 | | |
| 36 | +| videoUrl_2 | string | true |播放地址 清晰版,高清版=3,超高清=4 | | |
| 37 | +| videoUrl_3 | string | false |播放地址 高清版 | | |
| 38 | +| videoUrl_4 | string | false |播放地址 超高清 | | |
| 39 | 39 | |
| 40 | 40 | 返回JSON格式的节目元数据信息,json示例如下: |
| 41 | 41 | |
| ... | ... | @@ -43,62 +43,16 @@ HTTP GET |
| 43 | 43 | { |
| 44 | 44 | "errorMessage":"请求成功", |
| 45 | 45 | "data":{ |
| 46 | - "createTime":"20160808125905", | |
| 47 | - "publishTime":"20160808131657", | |
| 48 | 46 | "status":"1", |
| 49 | 47 | "vId":"174e6c5f3d9e4ddeb739feed1906fa11", |
| 50 | - "vipFlag":"0", | |
| 51 | - "packagePomID":"3_ent/xingwenrebao/yuleqianxian/", | |
| 52 | 48 | "subTitle":"BTOB对粉丝甜喊:我想你们了", |
| 53 | 49 | "title":"BTOB甜喊:我想你们了", |
| 54 | 50 | "description":"@TV娱乐前线:韩国男团BTOB近日在台北国际会议中心举行演唱会。", |
| 55 | - "freePlayLength":"60", | |
| 56 | - "rates":"1,2,3", | |
| 57 | - "onePomID":"3_174e6c5f3d9e4ddeb739feed1906fa11" | |
| 51 | + "videoUrl_1":"*****", | |
| 52 | + "videoUrl_2":"*****", | |
| 53 | + "videoUrl_3":"*****", | |
| 54 | + "videoUrl_4":"*****" | |
| 58 | 55 | }, |
| 59 | 56 | "errorCode":"0" |
| 60 | 57 | } |
| 61 | -``` | |
| 62 | -#### java 示例 | |
| 63 | - | |
| 64 | -```java | |
| 65 | -public Object getVodUrl() { | |
| 66 | - String result = ""; | |
| 67 | - Map params = new HashMap<>(); | |
| 68 | - params.put("appId", "60_iqj730vn11"); | |
| 69 | - params.put("vId", "174e6c5f3d9e4ddeb739feed1906fa11"); | |
| 70 | - params.put("timestamp", System.currentTimeMillis()/1000+""); | |
| 71 | - String url = OpenUtil.buildURL("http://api.cnlive.com/open/api/dianbo/getVodInfo4Server", params, "appId对应key值"); | |
| 72 | - HttpURLConnection connection; | |
| 73 | - try { | |
| 74 | - URL requestUrl = new URL(url); | |
| 75 | - connection = (HttpURLConnection)requestUrl.openConnection(); | |
| 76 | - connection.setRequestMethod("GET"); | |
| 77 | - connection.setDoInput(true); | |
| 78 | - connection.setDoOutput(true); | |
| 79 | - connection.connect();//连接 | |
| 80 | - | |
| 81 | - //获得返回值 | |
| 82 | - if(connection.getResponseCode() == HttpURLConnection.HTTP_OK){ | |
| 83 | - InputStream in = connection.getInputStream(); | |
| 84 | - String currentLine = ""; | |
| 85 | - if(in != null){ | |
| 86 | - BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8")); | |
| 87 | - while((currentLine = br.readLine()) != null){ | |
| 88 | - result += currentLine; | |
| 89 | - } | |
| 90 | - br.close(); | |
| 91 | - } | |
| 92 | - } | |
| 93 | - }catch (Exception e) { | |
| 94 | - e.printStackTrace(); | |
| 95 | - } | |
| 96 | - | |
| 97 | - if(BaseUtil.notBlank(result)) { | |
| 98 | - JSONObject resultJson = JSONObject.parseObject(result); | |
| 99 | - return resultJson | |
| 100 | - } | |
| 101 | - | |
| 102 | - return ""; | |
| 103 | - } | |
| 104 | 58 | ``` |
| 105 | 59 | \ No newline at end of file | ... | ... |