取得課程的回放影片列表
更新時間:2022-05-23 19:00:06
介面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
