...
|
...
|
@@ -61,6 +61,46 @@ class RoomController extends BaseController |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 弹幕服务器上传房间一些数目参数
|
|
|
* @return mixed
|
|
|
*/
|
|
|
public function actionSetvideoargs()
|
|
|
{
|
|
|
$gets = $this->requests();
|
|
|
|
|
|
$room_id = $gets['room'];
|
|
|
if ($room_id) {
|
|
|
$model = new Video();
|
|
|
$video = $model->getCurrentLivingVideo($room_id);
|
|
|
|
|
|
if (isset($gets['likeNums'])) {
|
|
|
$video->like_num = $gets['likeNums'];
|
|
|
}
|
|
|
if (isset($gets['audienceNums'])) {
|
|
|
$video->audience_num = $gets['audienceNums'];
|
|
|
}
|
|
|
|
|
|
if ($video->save()) {
|
|
|
$retArr = [
|
|
|
'code' => Yii::$app->params['success_code'],
|
|
|
'messsage' => '保存成功'
|
|
|
];
|
|
|
} else {
|
|
|
$retArr = [
|
|
|
'code' => Yii::$app->params['failed_code'],
|
|
|
'messsage' => '保存失败'
|
|
|
];
|
|
|
}
|
|
|
} else {
|
|
|
$retArr = [
|
|
|
'code' => Yii::$app->params['failed_code'],
|
|
|
'messsage' => '更新失败,缺少房间号'
|
|
|
];
|
|
|
}
|
|
|
$this->renderJson($retArr['code'], $retArr['messsage']);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 弹幕服务器上报弹幕消息
|
|
|
* @author yaoxiaofeng
|
|
|
*/
|
...
|
...
|
@@ -241,16 +281,6 @@ class RoomController extends BaseController |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取评论表名称
|
|
|
* @param $room_id
|
|
|
* @return string
|
|
|
*/
|
|
|
private function getTableName($room_id)
|
|
|
{
|
|
|
return 'tbl_live_comment' . str_pad((int)($room_id % 10), 2, '0', STR_PAD_LEFT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 直播中的所有房间
|
|
|
*/
|
|
|
public function actionListing()
|
...
|
...
|
@@ -275,11 +305,21 @@ class RoomController extends BaseController |
|
|
}
|
|
|
|
|
|
public function actionTest(){
|
|
|
$re = \common\lib\QcloudApi\Client::self()->CreateRecord("16093425727657864680", date('Y-m-d H:i:s',time()+120), '');
|
|
|
// $re = \common\lib\QcloudApi\Client::self()->DescribeRecordList("16093425727657864680",1,10);
|
|
|
// $re = \common\lib\QcloudApi\Client::self()->CreateRecord("16093425727657864680", date('Y-m-d H:i:s',time()+120), '');
|
|
|
$re = \common\lib\QcloudApi\Client::self()->DescribeRecordList("16093425727657864680",1,10);
|
|
|
|
|
|
// $re = \common\lib\QcloudApi\Client::self()->StopRecord("16093425727657524184", "131525");
|
|
|
var_dump($re);
|
|
|
//http://200013340.vod.myqcloud.com/200013340_6e79da1e65d140d887cdbb7f3ebadf79.f20.mp4
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取评论表名称
|
|
|
* @param $room_id
|
|
|
* @return string
|
|
|
*/
|
|
|
private function getTableName($room_id)
|
|
|
{
|
|
|
return 'tbl_live_comment' . str_pad((int)($room_id % 10), 2, '0', STR_PAD_LEFT);
|
|
|
}
|
|
|
} |
...
|
...
|
|