Skip to content

Commit e59444e

Browse files
author
yutingzeng
committed
增加进房权限构造userbuf说明
1 parent 85c3427 commit e59444e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

TLSSigAPIv2.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ class TLSSigAPIv2:
3838
def __init__(self, sdkappid, key):
3939
self.__sdkappid = sdkappid
4040
self.__key = key
41+
##用于生成实时音视频(TRTC)业务进房权限加密串,具体用途用法参考TRTC文档:https://cloud.tencent.com/document/product/647/32240
42+
# TRTC业务进房权限加密串需使用用户定义的userbuf
43+
# @brief 生成 userbuf
44+
# @param account 用户名
45+
# @param dwSdkappid sdkappid
46+
# @param dwAuthID 数字房间号
47+
# @param dwExpTime 过期时间:该权限加密串的过期时间,建议300秒,300秒内拿到该签名,并且发起进房间操作
48+
# @param dwPrivilegeMap 用户权限,255表示所有权限
49+
# @param dwAccountType 用户类型,默认为0
50+
# @return userbuf {string} 返回的userbuf
51+
#/
4152
def get_userbuf(self,account, dwAuthID, dwExpTime,
4253
dwPrivilegeMap, dwAccountType):
4354
userBuf = b''
@@ -65,8 +76,7 @@ def get_userbuf(self,account, dwAuthID, dwExpTime,
6576
(dwAuthID & 0x000000FF),
6677
])
6778

68-
# time_t now = time(0);
69-
# uint32_t expiredTime = now + dwExpTime;
79+
# dwExpTime = now + 300;
7080
userBuf += bytearray([
7181
((dwExpTime & 0xFF000000) >> 24),
7282
((dwExpTime & 0x00FF0000) >> 16),

0 commit comments

Comments
 (0)