Skip to content

Commit

Permalink
1.增加回放接口
Browse files Browse the repository at this point in the history
2.设置查询回调接口
  • Loading branch information
zoulux committed Dec 13, 2019
1 parent dc23473 commit 6b02eed
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "百家云直播",
"type": "library",
"license": "MIT",
"version": "0.4.4",
"version": "0.4.5",
"authors": [
{
"name": "Jake zou",
Expand Down
83 changes: 83 additions & 0 deletions src/BJCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,89 @@ public function roomDataGetEvaluationStat($roomId, $page, $pageSize = 20, $date
return $this->call('/openapi/room_data/getEvaluationStat', $params);
}

/**
* 查询直播回放信息
* http://dev.baijiayun.com/wiki/detail/6#h2-3
* @param string|int $roomId 房间id
* @param string $sessionId 序列号(针对长期房间才会用到)
* @return array|mixed
* @throws BJCloudException
*/
public function playbackGetBasicInfo($roomId, $sessionId = null)
{
$params = [
'room_id' => $roomId,
];

if ($sessionId) {
$params['session_id'] = $sessionId;
}
return $this->call('/openapi/playback/getBasicInfo', $params);
}

/**
* 获取回放token
* http://dev.baijiayun.com/wiki/detail/6#h2-5
* @param string|int $roomId 房间id
* @param int $expiresIn 过期时间,以秒为单位。如果传0则表示不过期
* @param string $sessionId 序列号(针对长期房间才会用到)
* @return array|mixed
* @throws BJCloudException
*/
public function playbackGetPlayerToken($roomId, $expiresIn = 0, $sessionId = null)
{
$params = [
'room_id' => $roomId,
'expires_in' => $expiresIn,
];

if ($sessionId) {
$params['session_id'] = $sessionId;
}
return $this->call('/openapi/playback/getPlayerToken', $params);
}

/**
* 批量获取回放token
* http://dev.baijiayun.com/wiki/detail/6#h2-5
* @param string $roomIds 短期房间传{room_id},长期房间传{room_id}-{session_id},多个回放用英文逗号分隔,如:17110879095169,1711087909231-201711281
* @param int $expiresIn 过期时间,以秒为单位。如果传0则表示不过期
* @return array|mixed
* @throws BJCloudException
*/
public function playbackGetPlayerTokenBatch($roomIds, $expiresIn = 0)
{
return $this->call('/openapi/playback/getPlayerTokenBatch', [
'room_ids' => $roomIds,
'expires_in' => $expiresIn,
]);
}

/**
* 设置转码回调地址(点播和回放)
* http://dev.baijiayun.com/default/wiki/detail/4#h37-38
* @param string $url 回调地址,必须是http(s)://开头
* @return array|mixed
* @throws BJCloudException
*/
public function videoAccountSetTranscodeCallbackUrl($url)
{
return $this->call('/openapi/video_account/setTranscodeCallbackUrl', [
'url' => $url,
]);
}

/**
* 查询转码回调地址(点播和回放)
* http://dev.baijiayun.com/default/wiki/detail/4#h37-38
* @return array|mixed
* @throws BJCloudException
*/
public function videoAccountGetTranscodeCallbackUrl()
{
return $this->call('/openapi/video_account/getTranscodeCallbackUrl');
}

/**
* 校验签名
* @param null $data
Expand Down

0 comments on commit 6b02eed

Please sign in to comment.