Documentation
¶
Index ¶
- Variables
- type App
- type AppInitConf
- type AppUpdateInfo
- type Manager
- func (r *Manager) CreateApp(appReq AppInitConf) (App, error)
- func (r *Manager) DeleteApp(appID string) error
- func (r *Manager) GetApp(appID string) (App, error)
- func (r *Manager) GetRoomToken(roomAccess RoomAccess) (token string, err error)
- func (r *Manager) KickUser(appID, roomName, userID string) error
- func (r *Manager) ListActiveRooms(appID, roomNamePrefix string, offset, limit int) (RoomQuery, error)
- func (r *Manager) ListAllActiveRooms(appID, roomNamePrefix string) ([]RoomName, error)
- func (r *Manager) ListUser(appID, roomName string) ([]User, error)
- func (r *Manager) UpdateApp(appID string, appInfo AppUpdateInfo) (App, error)
- type MergePublishRtmp
- type MergePublishRtmpInfo
- type RoomAccess
- type RoomName
- type RoomQuery
- type User
Constants ¶
This section is empty.
Variables ¶
var (
// RtcHost 为 Qiniu RTC Server API服务域名
RtcHost = "rtc.qiniuapi.com"
)
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
AppID string `json:"appId"`
AppInitConf
MergePublishRtmp MergePublishRtmp `json:"mergePublishRtmp,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
App 完整信息 AppID: app 的唯一标识,创建的时候由系统生成。
type AppInitConf ¶
type AppInitConf struct {
Hub string `json:"hub,omitempty"`
Title string `json:"title,omitempty"`
MaxUsers int `json:"maxUsers,omitempty"`
NoAutoKickUser bool `json:"noAutoKickUser,omitempty"`
}
AppInitConf 创建 App 请求参数 Title: app 的名称, 可选。 Hub: 绑定的直播 hub,可选,用于合流后 rtmp 推流。 MaxUsers: int 类型,可选,连麦房间支持的最大在线人数。 NoAutoKickUser: bool 类型,可选,禁止自动踢人。
type AppUpdateInfo ¶
type AppUpdateInfo struct {
Hub *string `json:"hub,omitempty"`
Title *string `json:"title,omitempty"`
MaxUsers *int `json:"maxUsers,omitempty"`
NoAutoKickUser *bool `json:"noAutoKickUser,omitempty"`
MergePublishRtmp *MergePublishRtmpInfo `json:"mergePublishRtmp,omitempty"`
}
AppUpdateInfo 更改信息 MergePublishRtmpInfo 连麦合流转推 RTMP 的配置更改信息
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 提供了 Qiniu RTC Server API 相关功能
func (*Manager) CreateApp ¶
func (r *Manager) CreateApp(appReq AppInitConf) (App, error)
CreateApp 新建实时音视频云
func (*Manager) GetRoomToken ¶
func (r *Manager) GetRoomToken(roomAccess RoomAccess) (token string, err error)
GetRoomToken 生成房间管理鉴权,连麦用户终端通过房间管理鉴权获取七牛连麦服务。
func (*Manager) KickUser ¶
KickUser 根据 appID, roomName, UserID 剔除在线的用户 appID: 连麦房间所属的 app 。 roomName: 连麦房间。 userID: 操作所剔除的用户。
func (*Manager) ListActiveRooms ¶
func (r *Manager) ListActiveRooms(appID, roomNamePrefix string, offset, limit int) (RoomQuery, error)
ListActiveRooms 根据 appID, roomNamePrefix, offset, limit 查询当前活跃的房间 appID: 连麦房间所属的 app 。 roomNamePrefix: 所查询房间名的前缀索引,可以为空。 offset: int 类型,分页查询的位移标记。 limit: int 类型,此次查询的最大长度。
func (*Manager) ListAllActiveRooms ¶
ListAllActiveRooms 根据 appID, roomNamePrefix 查询当前活跃的房间 appID: 连麦房间所属的 app 。 roomNamePrefix: 所查询房间名的前缀索引,可以为空。
type MergePublishRtmp ¶
type MergePublishRtmp struct {
Enable bool `json:"enable,omitempty"`
AudioOnly bool `json:"audioOnly,omitempty"`
Height int `json:"height,omitempty"`
Width int `json:"width,omitempty"`
OutputFps int `json:"fps,omitempty"`
OutputKbps int `json:"kbps,omitempty"`
URL string `json:"url,omitempty"`
StreamTitle string `json:"streamTitle,omitempty"`
}
MergePublishRtmp 连麦合流转推 RTMP 的配置 Enable: 布尔类型,用于开启和关闭所有房间的合流功能。 AudioOnly: 布尔类型,可选,指定是否只合成音频。 Height, Width: int,可选,指定合流输出的高和宽,默认为 640 x 480。 OutputFps: int,可选,指定合流输出的帧率,默认为 25 fps 。 OutputKbps: int,可选,指定合流输出的码率,默认为 1000 。 URL: 合流后转推旁路直播的地址,可选,支持魔法变量配置按照连麦房间号生成不同的推流地址。如果是转推到七牛直播云,不建议使用该配置 StreamTitle: 转推七牛直播云的流名,可选,支持魔法变量配置按照连麦房间号生成不同的流名。例如,配置 Hub 为 qn-zhibo ,配置 StreamTitle 为 $(roomName) ,则房间 meeting-001 的合流将会被转推到 rtmp://pili-publish.qn-zhibo.***.com/qn-zhibo/meeting-001地址。详细配置细则,请咨询七牛技术支持。
type MergePublishRtmpInfo ¶
type MergePublishRtmpInfo struct {
Enable *bool `json:"enable,omitempty"`
AudioOnly *bool `json:"audioOnly,omitempty"`
Height *int `json:"height,omitempty"`
Width *int `json:"width,omitempty"`
OutputFps *int `json:"fps,omitempty"`
OutputKbps *int `json:"kbps,omitempty"`
URL *string `json:"url,omitempty"`
StreamTitle *string `json:"streamTitle,omitempty"`
}
MergePublishRtmpInfo 连麦合流转推 RTMP 的配置更改信息
type RoomAccess ¶
type RoomAccess struct {
AppID string `json:"appId"`
RoomName string `json:"roomName"`
UserID string `json:"userId"`
ExpireAt int64 `json:"expireAt"`
Permission string `json:"permission"`
}
RoomAccess 房间管理凭证 AppID: 房间所属帐号的 app 。 RoomName: 房间名称,需满足规格 ^[a-zA-Z0-9_-]{3,64}$ UserID: 请求加入房间的用户 ID,需满足规格 ^[a-zA-Z0-9_-]{3,50}$ ExpireAt: int64 类型,鉴权的有效时间,传入以秒为单位的64位Unix绝对时间,token 将在该时间后失效。 Permission: 该用户的房间管理权限,"admin" 或 "user",默认为 "user" 。当权限角色为 "admin" 时,拥有将其他用户移除出房间等特权.