TRTCSwitchRoomParam

TRTCSwitchRoomParam

Room switch parameter

Constructor

new TRTCSwitchRoomParam(roomId, strRoomId, userSig, privateMapKey)

This parameter is used for the room switch API switchRoom, which can quickly switch a user from one room to another.

Parameters:
Name Type Description
roomId Number required

numeric room ID, which is optional. Users in the same room can see one another and make audio/video calls. [Note] either roomId or strRoomId must be entered. If both are entered, roomId will be 0(zero).

strRoomId String required

string-type room ID, which is optional. Users in the same room can see one another and make audio/video calls.

userSig String required

user signature, which is optional. It is the authentication signature corresponding to the current userId and acts as the login password. If you don't specify the newly calculated userSig during room switch, the SDK will continue to use the userSig you specified during room entry (enterRoom). This requires you to ensure that the old userSig is still within the validity period allowed by the signature at the moment of room switch; otherwise, room switch will fail. For the calculation method, please see UserSig.

privateMapKey String required

permission credential used for permission control, which is optional. If you want only users with the specified userId values to enter a room, you need to use privateMapKey to restrict the permission. We recommend you use this parameter only if you have high security requirements. For more information, please see Enabling Advanced Permission Control.