\Qiniu\RtcAppClient

Summary

Methods
Properties
Constants
__construct()
createApp()
updateApp()
getApp()
deleteApp()
listUser()
kickUser()
stopMerge()
listActiveRooms()
appToken()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
get()
delete()
post()
$auth
$baseURL
N/A

Properties

$auth

$auth

$baseURL

$baseURL

Methods

__construct()

__construct(\Qiniu\Auth  $auth) : mixed

Parameters

\Qiniu\Auth $auth

Returns

mixed —

createApp()

createApp(string  $hub, string  $title, int  $maxUsers = null, bool  $noAutoKickUser = null) : array

创建应用

Parameters

string $hub

绑定的直播 hub

string $title

app 的名称 注意,Title 不是唯一标识,重复 create 动作将生成多个 app

int $maxUsers

连麦房间支持的最大在线人数

bool $noAutoKickUser

禁止自动踢人(抢流),默认为 false

Returns

array —

updateApp()

updateApp(string  $appId, string  $hub, string  $title, int  $maxUsers = null, bool  $noAutoKickUser = null, null  $mergePublishRtmp = null) : array

更新一个应用的配置信息

Parameters

string $appId

app 的唯一标识,创建的时候由系统生成

string $hub

app 的名称,可选

string $title

绑定的直播 hub,可选,用于合流后 rtmp 推流

int $maxUsers

连麦房间支持的最大在线人数,可选

bool $noAutoKickUser

禁止自动踢人,可选

null $mergePublishRtmp

连麦合流转推 RTMP 的配置,可选择。其详细配置可以参考文档

Returns

array —

getApp()

getApp(string  $appId) : array

获取应用信息

Parameters

string $appId

Returns

array —

deleteApp()

deleteApp(string  $appId) : array

删除应用

Parameters

string $appId

app 的唯一标识,创建的时候由系统生成

Returns

array —

listUser()

listUser(string  $appId, string  $roomName) : array

获取房间内用户列表

Parameters

string $appId

app 的唯一标识,创建的时候由系统生成

string $roomName

操作所查询的连麦房间

Returns

array —

kickUser()

kickUser(string  $appId, string  $roomName, string  $userId) : mixed

指定一个用户踢出房间

Parameters

string $appId

app 的唯一标识,创建的时候由系统生成

string $roomName

连麦房间

string $userId

操作所剔除的用户

Returns

mixed —

stopMerge()

stopMerge(string  $appId, string  $roomName) : array

停止一个房间的合流转推

Parameters

string $appId
string $roomName

Returns

array —

listActiveRooms()

listActiveRooms(string  $appId, null  $prefix = null, int  $offset = null, int  $limit = null) : array

获取应用中活跃房间

Parameters

string $appId

连麦房间所属的 app

null $prefix

所查询房间名的前缀索引,可以为空。

int $offset

分页查询的位移标记

int $limit

此次查询的最大长度

Returns

array —

appToken()

appToken(string  $appId, string  $roomName, string  $userId, int  $expireAt, string  $permission) : string

生成加入房间的令牌

Parameters

string $appId

app 的唯一标识,创建的时候由系统生成

string $roomName

房间名称,需满足规格 ^[a-zA-Z0-9_-]{3,64}$

string $userId

请求加入房间的用户 ID,需满足规格 ^[a-zA-Z0-9_-]{3,50}$

int $expireAt

鉴权的有效时间,传入以秒为单位的64位 Unix 绝对时间

string $permission

该用户的房间管理权限,"admin" 或 "user",默认为 "user"

Returns

string —

get()

get(mixed  $url, mixed  $cType = null) : mixed

Parameters

mixed $url
mixed $cType

Returns

mixed —

delete()

delete(mixed  $url, mixed  $contentType = 'application/json') : mixed

Parameters

mixed $url
mixed $contentType

Returns

mixed —

post()

post(mixed  $url, mixed  $body, mixed  $contentType = 'application/json') : mixed

Parameters

mixed $url
mixed $body
mixed $contentType

Returns

mixed —