Show / Hide Table of Contents

Struct TRTCParams

6.1 进房相关参数

只有该参数填写正确,才能顺利调用 enterRoom 进入 roomId 所指定的音视频房间。

Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: trtc
Assembly: cs.temp.dll.dll
Syntax
public struct TRTCParams

Fields

businessInfo

【字段含义】业务数据 [非必填],部分高级特性才需要使用该字段。

【推荐取值】不建议使用

Declaration
public String businessInfo
Field Value
Type Description
String

privateMapKey

【字段含义】房间签名 [非必填],当您希望某个房间只能让特定的 userId 进入时,需要使用 privateMapKey 进行权限保护。

【推荐取值】仅建议有高级别安全需求的客户使用,更多详情请参见 [进房权限保护](https://cloud.tencent.com/document/product/647/32240)。

Declaration
public String privateMapKey
Field Value
Type Description
String

role

【字段含义】直播场景下的角色,仅适用于直播场景(TRTCAppSceneLIVE),视频通话场景下指定无效。

【推荐取值】默认值:主播(TRTCRoleAnchor)

Declaration
public TRTCRoleType role
Field Value
Type Description
TRTCRoleType

roomId

【字段含义】房间号码 [必填],在同一个房间内的用户可以看到彼此并进行视频通话。

【推荐取值】您可以自定义设置该参数值,但不可重复。如果您的用户帐号 ID (userId)为数字类型,可直接使用创建者的用户 ID 作为 roomId。

Declaration
public UInt32 roomId
Field Value
Type Description
UInt32

sdkAppId

【字段含义】应用标识 [必填],腾讯视频云基于 sdkAppId 进行计费统计。

在 [实时音视频控制台](https://console.cloud.tencent.com/trtc/) 创建应用后可在帐号信息页面中得到该 ID。

Declaration
public UInt32 sdkAppId
Field Value
Type Description
UInt32

streamId

【字段含义】绑定腾讯云直播 CDN 流 ID[非必填],设置之后,您就可以在腾讯云直播 CDN 上通过标准直播方案(FLV或HLS)播放该用户的音视频流。

【推荐取值】限制长度为64字节,可以不填写,一种推荐的方案是使用 “sdkappid_roomid_userid_main” 作为 streamid,这样比较好辨认且不会在您的多个应用中发生冲突。

【特殊说明】要使用腾讯云直播 CDN,您需要先在[控制台](https://console.cloud.tencent.com/trtc/) 中的功能配置页开启“启用旁路推流”开关。

【参考文档】[CDN 旁路直播](https://cloud.tencent.com/document/product/647/16826)。

Declaration
public String streamId
Field Value
Type Description
String

strRoomId

Declaration
public String strRoomId
Field Value
Type Description
String

userDefineRecordId

【字段含义】设置云端录制完成后的回调消息中的 "userdefinerecordid" 字段内容,便于您更方便的识别录制回调。

【推荐取值】限制长度为64字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符。

【参考文档】[云端录制](https://cloud.tencent.com/document/product/647/16823)。

Declaration
public String userDefineRecordId
Field Value
Type Description
String

userId

【字段含义】用户标识 [必填],当前用户的 userId,相当于用户名,使用 UTF-8 编码。

【推荐取值】如果一个用户在您的帐号系统中的 ID 为“abc”,则 userId 即可设置为“abc”。

Declaration
public String userId
Field Value
Type Description
String

userSig

【字段含义】用户签名 [必填],当前 userId 对应的验证签名,相当于登录密码。

【推荐取值】具体计算方法请参见 [如何计算UserSig](https://cloud.tencent.com/document/product/647/17275)。

Declaration
public String userSig
Field Value
Type Description
String
In This Article
Back to top Generated by DocFX