Options
All
  • Public
  • Public/Protected
  • All
Menu
  • Room entry parameters
  • You can enter the room specified by roomId successfully only if you pass in the room entry parameters correctly.

Hierarchy

  • TRTCParams

Index

Constructors

  • new TRTCParams(params: { businessInfo?: string; privateMapKey?: string; role?: number; roomId?: number; sdkAppId: number; strRoomId?: string; streamId?: string; userDefineRecordId?: string; userId: string; userSig: string }): TRTCParams
  • Parameters

    • params: { businessInfo?: string; privateMapKey?: string; role?: number; roomId?: number; sdkAppId: number; strRoomId?: string; streamId?: string; userDefineRecordId?: string; userId: string; userSig: string }
      • Optional businessInfo?: string
      • Optional privateMapKey?: string
      • Optional role?: number
      • Optional roomId?: number
      • sdkAppId: number
      • Optional strRoomId?: string
      • Optional streamId?: string
      • Optional userDefineRecordId?: string
      • userId: string
      • userSig: string

    Returns TRTCParams

Properties

businessInfo?: string
  • Description: business data (optional). This parameter is needed only in rare, special circumstances.
  • Value: We do not recommend using this parameter.
privateMapKey?: string
  • Description: room signature (optional). You can use this parameter to allow only specified users (userId) to enter a room.
  • Value: Use this parameter only if you have high security requirements. For more information, please see Enabling Advanced Permission Control.
role?: number
  • Description: role in live streaming scenarios. The SDK uses this parameter to determine whether a user is in the role of “anchor” or “audience”. This parameter is required in live streaming scenarios and not in call scenarios.
  • Note: This parameter is only applicable to live streaming scenarios (TRTC_APP_SCENE_LIVE and TRTC_APP_SCENE_VOICE_CHATROOM) and not to call scenarios (AUDIOCALL and VIDEOCALL).
  • Value: default value: TRTCRoleAnchor (anchor)
roomId?: number
  • Description: numeric room ID (required). Users (userId) in the same room can see one another and make a video call.
  • Value: value range: 1-4294967294
sdkAppId: number
  • Description: application ID (required). Tencent Video Cloud bills by sdkAppId.
  • Value: After creating an application in the TRTC console, you can view its ID on the Application Info page.
strRoomId?: string
  • String-type room ID. Users (userId) in the same room can see one another and make a video call.
  • Value: up to 64 bytes; supports 89 characters: letters (a-z and A-Z), digits (0-9), space, "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", and ","
  • You must specify either roomId or strRoomId. If you use string-type room IDs, set roomId to 0. If both parameters are specified, roomId will be used. Please note that you need to use the same room ID type to allow cross-room communication under the same application (sdkAppId).
streamId?: string
  • Description: stream ID bound to Tencent Cloud’s live streaming CDN (optional). If this parameter is specified, audience will be able to play the user’s stream via Tencent Cloud’s CDN using a standard streaming protocol (FLV or HLS).
  • Value: This parameter cannot exceed 64 bytes and is optional. To make it easier to distinguish between different stream IDs and avoid application conflicts, we recommend that you set it to sdkappid_roomid_userid_main.
  • Note: To use Tencent Cloud’s CDN, you need to enable relayed push in Function Configuration of the console.
  • Reference: CDN Relayed Live Streaming
userDefineRecordId?: string
  • Description: whether to enable on-cloud recording, i.e., whether to record the user's audio/video stream into a file in the specified format in the cloud
  • Value: up to 64 bytes, supports letters (a-z and A-Z), digits (0-9), underscores, and hyphens
  • Reference: On-Cloud Recording and Playback
userId: string
  • Description: user ID (required), i.e., username of the local user
  • Value: up to 32 bytes; supports letters (a-z and A-Z), digits (0-9), underscores, and hyphens
userSig: string
  • Description: user signature (required) of the current userId, which functions as the login password for Tencent Cloud services
  • Value: For how to calculate user signatures, please see UserSig.

Generated using TypeDoc