src/Biz/Util/EdusohoLiveClient.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Biz\Util;
use Biz\CloudPlatform\CloudAPIFactory;
use AppBundle\Common\ArrayToolkit;
class EdusohoLiveClient
{
const LIVE_STATUS_UNSTART = 'unstart';
const LIVE_STATUS_LIVING = 'live';
const LIVE_STATUS_PAUSE = 'pause';
const LIVE_STATUS_CLOSED = 'closed';
const OLD_ES_LIVE_PROVIDER = 8;
const NEW_ES_LIVE_PROVIDER = 9;
const LIVE_ROOM_LARGE = 'large';
const LIVE_ROOM_SMALL = 'small';
private $cloudApi;
/**
* 创建直播.
*
* @param array $args 直播参数,支持的参数有:title, speaker, startTime, endTime, authUrl, jumpUrl, errorJumpUrl, roomType
*
* @return [type] [description]
*/
public function createLive(array $args)
{
return $this->createCloudApi('root')->post('/lives', $args);
}
public function updateLive(array $args)
{
return $this->createCloudApi('root')->patch('/lives/'.$args['liveId'], $args);
}
public function getCapacity()
{
$args = array(
'timestamp' => time().'',
);
return $this->createCloudApi('leaf')->get('/lives/capacity', $args);
}
public function getRoomUrl($args, $server = 'leaf')
{
return $this->createCloudApi($server)->post('/lives/'.$args['liveId'].'/room_url', $args);
}
public function deleteLive($liveId)
{
$args = array(
'liveId' => $liveId,
);
return $this->createCloudApi('root')->delete('/lives/'.$liveId, $args);
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。