Commit bf3e78e2bd5f6c57e132d9668427797944d9a166
1 parent
032ee11c
修改参数名
Showing
1 changed file
with
6 additions
and
42 deletions
01.点播云/1.3 获取flash点播URL接口.md
| 1 | -### 获取RTMP直播播放URL接口 | |
| 1 | +### 获取MP4播放URL接口 | |
| 2 | 2 | ----- |
| 3 | -#### URL: http://api.cnlive.com/open/api2/live_ips/liveplayBySWF | |
| 3 | +#### URL: http://api.cnlive.com/open/api2/vod_ips/vodplayBySWF | |
| 4 | 4 | ----- |
| 5 | -#### 接口说明: 返回RTMP/FLV直播播放地址 (供 swf或 PC页面 调用) | |
| 5 | +#### 接口说明: 返回MP4播放地址 (供 swf或 PC页面 调用) | |
| 6 | 6 | ----- |
| 7 | 7 | #### 请求方式: HTTP GET |
| 8 | 8 | ----- |
| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | | 参数名 | 参数类型 | 必选 | 参数说明 | |
| 13 | 13 | | :----------- | :------: | :------: | :------: | |
| 14 | 14 | | appId | string | true | 应用ID | |
| 15 | -| channelID| string | true | 直播频道或 devID_主播ID | | |
| 15 | +| vId| string | true | 点播节目标识| | |
| 16 | 16 | | uid| string | false | 用户标识(uuid_时间戳)| |
| 17 | 17 | | sid| string | false | 用户ID | |
| 18 | 18 | | retry | int | false | 重试次数,在0~4之间累加 | |
| ... | ... | @@ -23,47 +23,11 @@ |
| 23 | 23 | { |
| 24 | 24 | "errorMessage":"成功", |
| 25 | 25 | "data":{ |
| 26 | - "location":"rtmp://wsrtmp4.live.cnlive.com/cdn/xinyingshi?wsSecret=f10722a1a2ffd198772b2ac8cf1c0afb&wsTime=57a3f066" | |
| 26 | + "location":"http://wideo01.cnlive.com/video/data1/2016/0524/124025/800/b7e34cfee140449f9e04c5e85b66aa56_124025_800.mp4" | |
| 27 | 27 | }, |
| 28 | 28 | "errorCode":"0" |
| 29 | 29 | } |
| 30 | 30 | ``` |
| 31 | - | |
| 32 | -#### java 示例 | |
| 33 | - | |
| 34 | -```java | |
| 35 | - public String getFlashUrl() { | |
| 36 | - String result = ""; | |
| 37 | - String mp4Url = "http://api.cnlive.com/open/api2/live_ips/liveplayBySWF?channelID=xinyingshi&appId=iqj730vn11"; | |
| 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 | -``` | |
| 31 | + | |
| 68 | 32 | |
| 69 | 33 | #### [页面播放DEMO](http://open.cnlive.com/demo/live/flash_live_demo.html) |
| 70 | 34 | \ No newline at end of file | ... | ... |