获取课程的回放视频列表
接口URL
http://api.polyv.net/live/v2/channels/playback-list
接口说明
查询直播频道
支持格式
JSON
请求方式
GET POST
请求数限制
TRUE
请求参数
参数名
必选
类型
说明
appId
是
string
在直播系统登记的appId
timestamp
是
string
当前时间的秒级时间戳(13位)
sign
是
string
签名,为32位大写的MD5值
courseId
是
string
课程号
page
否
int
页数
pageSize
否
int
每页的数量
响应成功JSON示例:
{
"code": 200,
"status": "success",
"message": "",
"data":{
"pageNumber": 1,
"totalItems": 1,
"contents":[
{
"videoId": "3676ba2be7",
"videoPoolId": "8l8v64820d9ba661b12356d3d2ce90e7_8",
"userId": "8l8v64820d",
"channelId": 134136,
"title": "test-hl11111",
"firstImage": "http://img.videocc.net//uimage/8/8l8v64820d/7/8l8v64820d9ba661b12356d3d2ce90e7_0.jpg",
"duration": "00:01:41",
"myBr": "1",
"qid": null,
"seed": 0,
"ordertime": 0,
"createdTime": 1507794147000,
"lastModified": 1507794300000,
"asDefault": "N",
"url": "http://mpv.videocc.net/8l8v64820d/7/8l8v64820d9ba661b12356d3d2ce90e7_1.m3u8",
"channelSessionId": null,
"mergeInfo": null,
"status": "Y",
"fileUrl": "http://videolib.videocc.net/hrlemvlu0020171012150939842/recordfe-hrlemvlu0020171012150939842--20171012153617.m3u8",
"fileId": "258f5ff7ef329856332a49c50fc0db5a",
"startTime": "20171012153617"
}
],
"endRow": 1,
"startRow": 1,
"nextPageNumber": 1,
"firstPage": true,
"lastPage": true,
"prePageNumber": 1,
"totalPages": 1,
"limit": 1,
"offset": 0
}
}
字段说明
参数名
类型
说明
status
string
状态值
result
object
响应的结果
pageNumber
int
页数
totalItems
int
总条数
vidieoId
string
回放的视频表ID
videoPoolId
string
点播的视频ID
url
string
MP4视频地址
userId
string
用户ID
channelId
int
频道ID
title
string
视频标题
firstImage
string
首图地址
php请求示例
<?php
$timestamp=time()*1000;
$appId="eh4z28vlbo";
$courseId="107269";
$appSecret = "f32c07974b2c4a1bae2a0bcc618b281c";
$str=$appSecret."appId".$appId."courseId".$channelId."timestamp".$timestamp.$appSecret;
$sign = strtoupper(md5($str));
$url="http://api.polyv.net/live/v2/channels/playback-list?appId=$appId&courseId=$courseId&sign=$sign×tamp=$timestamp";
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>
签名规则:
将请求参数按照参数名字典顺序排列,连接参数名与参数值,并在首尾加上appSecret,生成32位大写MD5值,作为sign。
以下是示例过程:
1、请求参数为:
timestamp =1489485894000
courseId="107269"
appId = "eh4z28vlbo"
2、将请求参数按照参数名字典顺序排列
appId = "eh4z28vlbo"
courseId="107269"
timestamp =1489485894000
3、连接字符串
连接参数名与参数值,并在首尾加上appSecret(appSecret的值为f32c07974b2c4a1bae2a0bcc618b281c),如下:
f32c07974b2c4a1bae2a0bcc618b281cappIdeh4z28vlbocourseId107269timestamp
1489485894000f32c07974b2c4a1bae2a0bcc618b281c
4、生成签名sign
18872B0CE34719CB34B15A3FB173D229
Last updated
Was this helpful?