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