You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Function: Used to issue UserSig that is required by the TRTC and IM services.
195
+
*
196
+
* Parameter description:
197
+
* @param userid - User ID. The value can be up to 32 bytes in length and contain letters (a-z and A-Z), digits (0-9), underscores (_), and hyphens (-).
198
+
* @param expire - UserSig expiration time, in seconds. For example, 86400 indicates that the generated UserSig will expire one day after being generated.
199
+
*/
178
200
Api.prototype.genUserSig=function(userid,expire){
179
201
returnthis.genSig(userid,expire,null);
180
202
};
@@ -203,6 +225,32 @@ Api.prototype.genUserSig = function (userid, expire) {
* Used to issue PrivateMapKey that is optional for room entry.
232
+
* PrivateMapKey must be used together with UserSig but with more powerful permission control capabilities.
233
+
* - UserSig can only control whether a UserID has permission to use the TRTC service. As long as the UserSig is correct, the user with the corresponding UserID can enter or leave any room.
234
+
* - PrivateMapKey specifies more stringent permissions for a UserID, including whether the UserID can be used to enter a specific room and perform audio/video upstreaming in the room.
235
+
* To enable stringent PrivateMapKey permission bit verification, you need to enable permission key in TRTC console > Application Management > Application Info.
236
+
*
237
+
* Parameter description:
238
+
* userid - User ID. The value can be up to 32 bytes in length and contain letters (a-z and A-Z), digits (0-9), underscores (_), and hyphens (-).
239
+
* roomid - ID of the room to which the specified UserID can enter.
240
+
* expire - PrivateMapKey expiration time, in seconds. For example, 86400 indicates that the generated PrivateMapKey will expire one day after being generated.
241
+
* privilegeMap - Permission bits. Eight bits in the same byte are used as the permission switches of eight specific features:
242
+
* - Bit 1: 0000 0001 = 1, permission for room creation
243
+
* - Bit 2: 0000 0010 = 2, permission for room entry
244
+
* - Bit 3: 0000 0100 = 4, permission for audio sending
245
+
* - Bit 4: 0000 1000 = 8, permission for audio receiving
246
+
* - Bit 5: 0001 0000 = 16, permission for video sending
247
+
* - Bit 6: 0010 0000 = 32, permission for video receiving
248
+
* - Bit 7: 0100 0000 = 64, permission for substream video sending (screen sharing)
249
+
* - Bit 8: 1000 0000 = 200, permission for substream video receiving (screen sharing)
250
+
* - privilegeMap == 1111 1111 == 255: Indicates that the UserID has all feature permissions of the room specified by roomid.
251
+
* - privilegeMap == 0010 1010 == 42: Indicates that the UserID has only the permissions to enter the room and receive audio/video data.
* Used to issue PrivateMapKey that is optional for room entry.
287
+
* PrivateMapKey must be used together with UserSig but with more powerful permission control capabilities.
288
+
* - UserSig can only control whether a UserID has permission to use the TRTC service. As long as the UserSig is correct, the user with the corresponding UserID can enter or leave any room.
289
+
* - PrivateMapKey specifies more stringent permissions for a UserID, including whether the UserID can be used to enter a specific room and perform audio/video upstreaming in the room.
290
+
* To enable stringent PrivateMapKey permission bit verification, you need to enable permission key in TRTC console > Application Management > Application Info.
291
+
*
292
+
* Parameter description:
293
+
* @param userid - User ID. The value can be up to 32 bytes in length and contain letters (a-z and A-Z), digits (0-9), underscores (_), and hyphens (-).
294
+
* @param roomstr - ID of the room to which the specified UserID can enter.
295
+
* @param expire - PrivateMapKey expiration time, in seconds. For example, 86400 indicates that the generated PrivateMapKey will expire one day after being generated.
296
+
* @param privilegeMap - Permission bits. Eight bits in the same byte are used as the permission switches of eight specific features:
297
+
* - Bit 1: 0000 0001 = 1, permission for room creation
298
+
* - Bit 2: 0000 0010 = 2, permission for room entry
299
+
* - Bit 3: 0000 0100 = 4, permission for audio sending
300
+
* - Bit 4: 0000 1000 = 8, permission for audio receiving
301
+
* - Bit 5: 0001 0000 = 16, permission for video sending
302
+
* - Bit 6: 0010 0000 = 32, permission for video receiving
303
+
* - Bit 7: 0100 0000 = 64, permission for substream video sending (screen sharing)
304
+
* - Bit 8: 1000 0000 = 200, permission for substream video receiving (screen sharing)
305
+
* - privilegeMap == 1111 1111 == 255: Indicates that the UserID has all feature permissions of the room specified by roomid.
306
+
* - privilegeMap == 0010 1010 == 42: Indicates that the UserID has only the permissions to enter the room and receive audio/video data.
0 commit comments