...
|
...
|
@@ -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([
|
...
|
...
|
|