Authored by xiaofeng.yao@yoho.cn

录播任务修改

@@ -402,6 +402,25 @@ class Client{ @@ -402,6 +402,25 @@ class Client{
402 } 402 }
403 } 403 }
404 404
  405 + public function DescribeRecordList($channelId,$pageNo,$pageSize){
  406 + $package = array(
  407 + 'channelId'=>$channelId,
  408 + 'pageNo'=>$pageNo,
  409 + 'pageSize'=>$pageSize
  410 + );
  411 + $a = $this->_obj->generateUrl('DescribeRecordList', $package);//获取接口url
  412 + if ($a === false) {
  413 + return false;
  414 + } else {
  415 + $res = $this->_obj->DescribeRecordList($package); //执行url
  416 + if($res === false){
  417 + return false;
  418 + } else{
  419 + return $res;
  420 + }
  421 + }
  422 + }
  423 +
405 public function error(){ 424 public function error(){
406 $error = $this->_obj->getError(); 425 $error = $this->_obj->getError();
407 return $error->getMessage(); 426 return $error->getMessage();
@@ -120,9 +120,9 @@ class Video extends \yii\db\ActiveRecord @@ -120,9 +120,9 @@ class Video extends \yii\db\ActiveRecord
120 ->from('tbl_room') 120 ->from('tbl_room')
121 ->where(['room_id' => $room_id]) 121 ->where(['room_id' => $room_id])
122 ->one(); 122 ->one();
123 - //$qchannel = $this->find()->select('id,channel_id,task_id')->where(['room_id'=>$room_id])->one();  
124 $time = time(); 123 $time = time();
125 - $ret = QcloudApiClient::self()->CreateRecord($qchannel['channel_id'], date('Y-m-d H:i:s'), ''); 124 + //此处有bug,channel_id必须要转成字符串,不然底层会转换成科学计数法的格式
  125 + $ret = QcloudApiClient::self()->CreateRecord(strval($qchannel['channel_id']), date('Y-m-d H:i:s',time()+120), '');
126 file_put_contents("/tmp/live.log",date('Y-m-d H:i:s')."|start ".var_export($ret,true),FILE_APPEND)."\n"; 126 file_put_contents("/tmp/live.log",date('Y-m-d H:i:s')."|start ".var_export($ret,true),FILE_APPEND)."\n";
127 if ($ret['code'] == 0) { 127 if ($ret['code'] == 0) {
128 $this->setAttributes([ 128 $this->setAttributes([
@@ -170,7 +170,8 @@ class Video extends \yii\db\ActiveRecord @@ -170,7 +170,8 @@ class Video extends \yii\db\ActiveRecord
170 ->orderBy(['live_start_time' => SORT_DESC]) 170 ->orderBy(['live_start_time' => SORT_DESC])
171 ->one(); 171 ->one();
172 if ($video) { 172 if ($video) {
173 - $ret = QcloudApiClient::self()->StopRecord($qchannel['channel_id'], $video['task_id']); 173 + //此处有bug,channel_id必须要转成字符串,不然底层会转换成科学计数法的格式
  174 + $ret = QcloudApiClient::self()->StopRecord(strval($qchannel['channel_id']), $video['task_id']);
174 file_put_contents("/tmp/live.log",date('Y-m-d H:i:s')."|stop ".var_export($ret,true),FILE_APPEND)."\n"; 175 file_put_contents("/tmp/live.log",date('Y-m-d H:i:s')."|stop ".var_export($ret,true),FILE_APPEND)."\n";
175 if ($ret['code'] == 0) { 176 if ($ret['code'] == 0) {
176 $this->setAttributes([ 177 $this->setAttributes([
@@ -273,4 +273,12 @@ class RoomController extends BaseController @@ -273,4 +273,12 @@ class RoomController extends BaseController
273 $level = ""; 273 $level = "";
274 Yii::$app->log->getLogger()->log($message, $level); 274 Yii::$app->log->getLogger()->log($message, $level);
275 } 275 }
  276 +
  277 + public function actionTest(){
  278 +// $re = \common\lib\QcloudApi\Client::self()->CreateRecord("16093425727657524184", date('Y-m-d H:i:s',time()+120), '');
  279 + $re = \common\lib\QcloudApi\Client::self()->DescribeRecordList("16093425727657524184",1,10);
  280 +
  281 +// $re = \common\lib\QcloudApi\Client::self()->StopRecord("16093425727657524184", "131525");
  282 + var_dump($re);
  283 + }
276 } 284 }