...
|
...
|
@@ -124,6 +124,7 @@ class Video extends \yii\db\ActiveRecord |
|
|
//$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'), '');
|
|
|
file_put_contents("/tmp/live.log",date('Y-m-d H:i:s')."|start ".var_export($ret,true),FILE_APPEND);
|
|
|
if ($ret['code'] == 0) {
|
|
|
$this->setAttributes([
|
|
|
'app' => $room['app'],
|
...
|
...
|
@@ -171,6 +172,7 @@ class Video extends \yii\db\ActiveRecord |
|
|
->one();
|
|
|
if ($video) {
|
|
|
$ret = QcloudApiClient::self()->StopRecord($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);
|
|
|
if ($ret['code'] == 0) {
|
|
|
$this->setAttributes([
|
|
|
'live_end_time' => time(),
|
...
|
...
|
|