...
|
...
|
@@ -122,12 +122,12 @@ class Video extends \yii\db\ActiveRecord |
|
|
->one();
|
|
|
$time = time();
|
|
|
//此处有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) {
|
|
|
//$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 (1) {//$ret['code'] == 0
|
|
|
$this->setAttributes([
|
|
|
'app' => $room['app'],
|
|
|
'task_id' => $ret['task_id'],
|
|
|
'task_id' => 0,//$ret['task_id']
|
|
|
'live_title' => $room['title'],
|
|
|
'live_start_time' => $time,
|
|
|
'live_end_time' => 0,
|
...
|
...
|
@@ -171,9 +171,9 @@ class Video extends \yii\db\ActiveRecord |
|
|
->one();
|
|
|
if ($video) {
|
|
|
//此处有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) {
|
|
|
//$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 (1) {//$ret['code'] == 0
|
|
|
$this->setAttributes([
|
|
|
'live_end_time' => time(),
|
|
|
]);
|
...
|
...
|
|