Authored by xiaofeng.yao@yoho.cn

录播任务修改

... ... @@ -402,6 +402,25 @@ class Client{
}
}
public function DescribeRecordList($channelId,$pageNo,$pageSize){
$package = array(
'channelId'=>$channelId,
'pageNo'=>$pageNo,
'pageSize'=>$pageSize
);
$a = $this->_obj->generateUrl('DescribeRecordList', $package);//获取接口url
if ($a === false) {
return false;
} else {
$res = $this->_obj->DescribeRecordList($package); //执行url
if($res === false){
return false;
} else{
return $res;
}
}
}
public function error(){
$error = $this->_obj->getError();
return $error->getMessage();
... ...
... ... @@ -120,9 +120,9 @@ class Video extends \yii\db\ActiveRecord
->from('tbl_room')
->where(['room_id' => $room_id])
->one();
//$qchannel = $this->find()->select('id,channel_id,task_id')->where(['room_id'=>$room_id])->one();
$time = time();
$ret = QcloudApiClient::self()->CreateRecord($qchannel['channel_id'], date('Y-m-d H:i:s'), '');
//此处有bug,channel_id必须要转成字符串,不然底层会转换成科学计数法的格式
$ret = QcloudApiClient::self()->CreateRecord(strval($qchannel['channel_id']), date('Y-m-d H:i:s',time()+120), '');
file_put_contents("/tmp/live.log",date('Y-m-d H:i:s')."|start ".var_export($ret,true),FILE_APPEND)."\n";
if ($ret['code'] == 0) {
$this->setAttributes([
... ... @@ -170,7 +170,8 @@ class Video extends \yii\db\ActiveRecord
->orderBy(['live_start_time' => SORT_DESC])
->one();
if ($video) {
$ret = QcloudApiClient::self()->StopRecord($qchannel['channel_id'], $video['task_id']);
//此处有bug,channel_id必须要转成字符串,不然底层会转换成科学计数法的格式
$ret = QcloudApiClient::self()->StopRecord(strval($qchannel['channel_id']), $video['task_id']);
file_put_contents("/tmp/live.log",date('Y-m-d H:i:s')."|stop ".var_export($ret,true),FILE_APPEND)."\n";
if ($ret['code'] == 0) {
$this->setAttributes([
... ...
... ... @@ -273,4 +273,12 @@ class RoomController extends BaseController
$level = "";
Yii::$app->log->getLogger()->log($message, $level);
}
public function actionTest(){
// $re = \common\lib\QcloudApi\Client::self()->CreateRecord("16093425727657524184", date('Y-m-d H:i:s',time()+120), '');
$re = \common\lib\QcloudApi\Client::self()->DescribeRecordList("16093425727657524184",1,10);
// $re = \common\lib\QcloudApi\Client::self()->StopRecord("16093425727657524184", "131525");
var_dump($re);
}
}
... ...