trtc-cloud-js-sdk 1.0.13 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/.eslintrc.js +88 -0
  2. package/.prettierrc +5 -0
  3. package/CHANGELOG.md +58 -0
  4. package/build/jsdoc/clean-doc.js +12 -0
  5. package/build/jsdoc/fix-doc.js +141 -0
  6. package/build/jsdoc/jsdoc.json +42 -0
  7. package/build/package-bundle.js +29 -0
  8. package/build/rollup.config.dev.js +88 -0
  9. package/build/rollup.config.prod.js +93 -0
  10. package/build/rollup.js +359 -0
  11. package/build/template/npm-package/package.json +24 -0
  12. package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/base.css +213 -0
  13. package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/index.html +80 -0
  14. package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.css +1 -0
  15. package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.js +1 -0
  16. package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sort-arrow-sprite.png +0 -0
  17. package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sorter.js +158 -0
  18. package/examples/apiExample/.env +2 -0
  19. package/examples/apiExample/README.md +70 -0
  20. package/examples/apiExample/package-lock.json +30915 -0
  21. package/examples/apiExample/package.json +51 -0
  22. package/examples/apiExample/public/audio.js +195 -0
  23. package/examples/apiExample/public/audio.js.map +7 -0
  24. package/examples/apiExample/public/av_processing.js +1 -0
  25. package/examples/apiExample/public/basic/av_processing.wasm +0 -0
  26. package/examples/apiExample/public/basic/worker.js +10434 -0
  27. package/examples/apiExample/public/favicon.ico +0 -0
  28. package/examples/apiExample/public/index.html +47 -0
  29. package/examples/apiExample/public/logo192.png +0 -0
  30. package/examples/apiExample/public/logo512.png +0 -0
  31. package/examples/apiExample/public/manifest.json +25 -0
  32. package/examples/apiExample/public/robots.txt +3 -0
  33. package/examples/apiExample/src/App.css +37 -0
  34. package/examples/apiExample/src/App.js +25 -0
  35. package/examples/apiExample/src/api/http.js +127 -0
  36. package/examples/apiExample/src/api/nav.js +44 -0
  37. package/examples/apiExample/src/components/BasicInfoComponent.css +16 -0
  38. package/examples/apiExample/src/components/BasicInfoComponent.js +27 -0
  39. package/examples/apiExample/src/config/gen-test-user-sig.js +64 -0
  40. package/examples/apiExample/src/config/lib-generate-test-usersig.min.js +7052 -0
  41. package/examples/apiExample/src/config/nav.js +136 -0
  42. package/examples/apiExample/src/home.js +16 -0
  43. package/examples/apiExample/src/index.css +21 -0
  44. package/examples/apiExample/src/index.js +12 -0
  45. package/examples/apiExample/src/logo.svg +1 -0
  46. package/examples/apiExample/src/page/basic/screen-share/index.css +52 -0
  47. package/examples/apiExample/src/page/basic/screen-share/index.js +223 -0
  48. package/examples/apiExample/src/page/basic/setDevice/index.js +262 -0
  49. package/examples/apiExample/src/page/basic/setDevice/index.scss +93 -0
  50. package/examples/apiExample/src/page/basic/video-call/index.js +521 -0
  51. package/examples/apiExample/src/page/basic/video-call/index.scss +93 -0
  52. package/examples/apiExample/src/page/basic/video-call-init/index.js +382 -0
  53. package/examples/apiExample/src/page/basic/video-call-init/index.scss +93 -0
  54. package/examples/apiExample/src/page/basic/video-live/index.css +37 -0
  55. package/examples/apiExample/src/page/basic/video-live/index.js +188 -0
  56. package/examples/apiExample/src/page/layout.js +22 -0
  57. package/examples/apiExample/src/page/layout.scss +76 -0
  58. package/examples/apiExample/src/utils/utils.js +35 -0
  59. package/examples/jsExample/assets/css/bootstrap-material-design.css +12169 -0
  60. package/examples/jsExample/assets/css/bootstrap-material-design.min.css +8 -0
  61. package/examples/jsExample/assets/css/common.css +48 -0
  62. package/examples/jsExample/assets/icon/iconfont.js +1 -0
  63. package/examples/jsExample/assets/js/bootstrap-material-design.js +6939 -0
  64. package/examples/jsExample/assets/js/bootstrap-material-design.js.map +1 -0
  65. package/examples/jsExample/assets/js/bootstrap-material-design.min.js +1 -0
  66. package/examples/jsExample/assets/js/graph.js +695 -0
  67. package/examples/jsExample/assets/js/jquery-3.2.1.min.js +4 -0
  68. package/examples/jsExample/assets/js/jquery-3.2.1.slim.min.js +4 -0
  69. package/examples/jsExample/assets/js/lib-generate-test-usersig.min.js +2 -0
  70. package/examples/jsExample/assets/js/popper.js +2442 -0
  71. package/examples/jsExample/index.html +57 -0
  72. package/examples/jsExample/rtc/css/common.css +82 -0
  73. package/examples/jsExample/rtc/index.html +107 -0
  74. package/examples/jsExample/rtc/js/index.js +142 -0
  75. package/examples/vueDemo/LICENSE +21 -0
  76. package/examples/vueDemo/README.md +144 -0
  77. package/examples/vueDemo/README_EN.md +136 -0
  78. package/examples/vueDemo/av_processing.wasm +0 -0
  79. package/examples/vueDemo/index.html +23 -0
  80. package/examples/vueDemo/package-lock.json +1375 -0
  81. package/examples/vueDemo/package.json +36 -0
  82. package/examples/vueDemo/src/App.vue +12 -0
  83. package/examples/vueDemo/src/api/index.js +59 -0
  84. package/examples/vueDemo/src/assets/css/color-dark.css +28 -0
  85. package/examples/vueDemo/src/assets/css/icon.css +4 -0
  86. package/examples/vueDemo/src/assets/css/main.css +177 -0
  87. package/examples/vueDemo/src/assets/img/img.jpg +0 -0
  88. package/examples/vueDemo/src/assets/img/login-bg.jpg +0 -0
  89. package/examples/vueDemo/src/components/Header.vue +172 -0
  90. package/examples/vueDemo/src/components/Sidebar.vue +117 -0
  91. package/examples/vueDemo/src/components/Tags.vue +174 -0
  92. package/examples/vueDemo/src/components/tendency.vue +206 -0
  93. package/examples/vueDemo/src/components/trtc/main-menu.vue +50 -0
  94. package/examples/vueDemo/src/components/trtc/nav-bar.vue +53 -0
  95. package/examples/vueDemo/src/components/trtc/show-screen-capture.vue +118 -0
  96. package/examples/vueDemo/src/components/trtc/trtc-state-check.vue +117 -0
  97. package/examples/vueDemo/src/config/gen-test-user-sig.js +67 -0
  98. package/examples/vueDemo/src/config/lib-generate-test-usersig.min.js +7052 -0
  99. package/examples/vueDemo/src/main.js +11 -0
  100. package/examples/vueDemo/src/plugins/element.js +17 -0
  101. package/examples/vueDemo/src/router/index.js +73 -0
  102. package/examples/vueDemo/src/store/sidebar.js +17 -0
  103. package/examples/vueDemo/src/store/tags.js +48 -0
  104. package/examples/vueDemo/src/utils/i18n.js +24 -0
  105. package/examples/vueDemo/src/utils/request.js +34 -0
  106. package/examples/vueDemo/src/utils/utils.js +35 -0
  107. package/examples/vueDemo/src/views/Home.vue +46 -0
  108. package/examples/vueDemo/src/views/I18n.vue +40 -0
  109. package/examples/vueDemo/src/views/Icon.vue +229 -0
  110. package/examples/vueDemo/src/views/basic/trtc.vue +194 -0
  111. package/examples/vueDemo/src/views/feature/index.vue +259 -0
  112. package/examples/vueDemo/src/views/github/index.vue +243 -0
  113. package/examples/vueDemo/src/views/improve/live-index.vue +256 -0
  114. package/examples/vueDemo/src/views/improve/live-room-anchor.vue +689 -0
  115. package/examples/vueDemo/src/views/improve/live-room-audience.vue +383 -0
  116. package/examples/vueDemo/src/views/sdkAppId/index.vue +284 -0
  117. package/examples/vueDemo/vite.config.js +18 -0
  118. package/examples/vueDemo/worker.js +22 -0
  119. package/karma.conf.js +99 -0
  120. package/package.json +57 -7
  121. package/scripts/publish.js +86 -0
  122. package/src/Camera.ts +80 -0
  123. package/src/Mic.ts +145 -0
  124. package/src/common/IError.ts +6 -0
  125. package/src/common/ITRTCCloud.ts +68 -0
  126. package/src/common/constants.ts +116 -0
  127. package/src/common/trtc-code.ts +43 -0
  128. package/src/common/trtc-define.ts +1007 -0
  129. package/src/common/trtc-event.ts +29 -0
  130. package/src/index.ts +1672 -0
  131. package/src/utils/environment.js +297 -0
  132. package/src/utils/raf.js +131 -0
  133. package/src/utils/time.js +22 -0
  134. package/src/utils/utils.ts +71 -0
  135. package/src/utils/uuid.js +12 -0
  136. package/test/unit/env.test.js +25 -0
  137. package/test/unit/get-user-media.test.js +40 -0
  138. package/test/unit/ice-parser.test.js +23 -0
  139. package/test/unit/sdp.test.js +45 -0
  140. package/test/unit/signal.test.js +78 -0
  141. package/tsconfig.json +32 -0
  142. package/trtc-cloud-js-sdk.js +0 -1
  143. /package/{README.md → build/template/npm-package/README.md} +0 -0
@@ -0,0 +1,47 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ <meta name="theme-color" content="#000000" />
9
+ <meta name="description" content="Web site created using create-react-app" />
10
+ <!-- <script src="https://web.sdk.qcloud.com/trtc/webrtc/download/wasm/test/trtc.js"></script> -->
11
+ <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
12
+ <!--
13
+ manifest.json provides metadata used when your web app is installed on a
14
+ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
15
+ -->
16
+ <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
17
+ <!--
18
+ Notice the use of %PUBLIC_URL% in the tags above.
19
+ It will be replaced with the URL of the `public` folder during the build.
20
+ Only files inside the `public` folder can be referenced from the HTML.
21
+
22
+ Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
23
+ work correctly both with client-side routing and a non-root public URL.
24
+ Learn how to configure a non-root public URL by running `npm run build`.
25
+ -->
26
+ <title>React App</title>
27
+ </head>
28
+
29
+ <body>
30
+ <noscript>You need to enable JavaScript to run this app.</noscript>
31
+ <div id="root"></div>
32
+ <!--
33
+ This HTML file is a template.
34
+ If you open it directly in the browser, you will see an empty page.
35
+
36
+ You can add webfonts, meta tags, or analytics to this file.
37
+ The build step will place the bundled scripts into the <body> tag.
38
+
39
+ To begin the development, run `npm start` or `yarn start`.
40
+ To create a production bundle, use `npm run build` or `yarn build`.
41
+ -->
42
+ <script>
43
+
44
+ </script>
45
+ </body>
46
+
47
+ </html>
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,37 @@
1
+ .App {
2
+ text-align: center;
3
+ }
4
+
5
+ .App-logo {
6
+ height: 40vmin;
7
+ pointer-events: none;
8
+ }
9
+
10
+ @media (prefers-reduced-motion: no-preference) {
11
+ .App-logo {
12
+ animation: App-logo-spin infinite 20s linear;
13
+ }
14
+ }
15
+
16
+ .App-header {
17
+ min-height: 200px;
18
+ display: flex;
19
+ flex-direction: column;
20
+ align-items: center;
21
+ justify-content: center;
22
+ font-size: calc(10px + 2vmin);
23
+ color: white;
24
+ }
25
+
26
+ .App-link {
27
+ color: #61dafb;
28
+ }
29
+
30
+ @keyframes App-logo-spin {
31
+ from {
32
+ transform: rotate(0deg);
33
+ }
34
+ to {
35
+ transform: rotate(360deg);
36
+ }
37
+ }
@@ -0,0 +1,25 @@
1
+ import './App.css';
2
+ import { BrowserRouter as Router, HashRouter, Route, Switch } from 'react-router-dom';
3
+ import navList from './config/nav';
4
+ import Layout from './page/layout';
5
+ import Home from './home';
6
+ import VideoCall from './page/basic/video-call';
7
+
8
+ function App() {
9
+ return (
10
+ <div className="App">
11
+ <HashRouter base>
12
+ <Switch>
13
+ <Layout>
14
+ <Route exact path="/" component={VideoCall}></Route>
15
+ {/* {navList.map((obj, idx) => (
16
+ <Route exact path={obj.path} key={`${obj.path}-${idx}`} component={obj.pageContent}></Route>
17
+ ))} */}
18
+ </Layout>
19
+ </Switch>
20
+ </HashRouter>
21
+ </div>
22
+ );
23
+ }
24
+
25
+ export default App;
@@ -0,0 +1,127 @@
1
+ import axios from 'axios';
2
+ import Cookies from '@utils/cookieStorage';
3
+ import { goToPage } from '@utils/login-util';
4
+
5
+ const premixUrl = 'https://demo-2gfpjobv0b7026e1-1256993030.ap-shanghai.app.tcloudbase.com';
6
+
7
+ const http = axios.create({
8
+ baseURL: premixUrl,
9
+ headers: {
10
+ 'Content-Type': 'application/json',
11
+ }
12
+ });
13
+
14
+ http.interceptors.response.use((response) => {
15
+ const { errorCode } = response.data;
16
+ if (errorCode === -1005) {
17
+ Cookies.remove('trtc-token');
18
+ goToPage('login');
19
+ }
20
+ return response.data;
21
+ }, error => {
22
+ console.warn(error);
23
+ if (window.aegis && window.aegis.error){
24
+ window.aegis.error(error);
25
+ }
26
+ Promise.reject(error);
27
+ });
28
+
29
+ /**
30
+ * 用户图形验证码通过后,获取短信验证码
31
+ * @param {string} phoneArea 用户手机号区号
32
+ * @param {string} phoneNumber 用户手机号码
33
+ * @param {string} randstr 图形验证码成功后返回的随机串
34
+ * @param {string} ticket 图形验证码成功后返回的票据
35
+ */
36
+ export function getImageVerifyCode(phoneArea, phoneNumber, randstr, ticket) {
37
+ const params = {
38
+ method: 'getImgSms',
39
+ areaCode: `+${phoneArea}`,
40
+ phone: phoneNumber,
41
+ randstr,
42
+ ticket,
43
+ };
44
+ return http.get('/login', { params });
45
+ }
46
+
47
+ /**
48
+ * 短信登录
49
+ * @param {string} phoneArea 用户手机号区号
50
+ * @param {string} phoneNumber 用户手机号码
51
+ * @param {string} verifyNumber 验证码
52
+ * @param {string} sessionId sessionId
53
+ */
54
+ export function smsLogin(phoneArea, phoneNumber, verifyNumber, sessionId) {
55
+ const params = {
56
+ method: 'login',
57
+ areaCode: `+${phoneArea}`,
58
+ phone: phoneNumber,
59
+ code: verifyNumber,
60
+ sessionId,
61
+ };
62
+ return http.get('/login', { params });
63
+ }
64
+
65
+ /**
66
+ * 手机号 + 密码 登录
67
+ * @param {string} phoneArea 用户手机号区号
68
+ * @param {string} phoneNumber 用户手机号码
69
+ * @param {string} password 用户密码
70
+ */
71
+ export function passwordLogin(phoneArea, phoneNumber, password) {
72
+ const params = {
73
+ method: 'login',
74
+ loginType: 'pwd',
75
+ areaCode: `+${phoneArea}`,
76
+ phone: phoneNumber,
77
+ password,
78
+ };
79
+ return http.get('/login', { params });
80
+ }
81
+
82
+ /**
83
+ * 手机号 + 密码 注册
84
+ * @param {string} phoneArea 用户手机号区号
85
+ * @param {string} phoneNumber 用户手机号码
86
+ * @param {string} password 用户密码
87
+ * @param {string} verifyNumber 短信验证码
88
+ * @param {string} sessionId
89
+ */
90
+ export function userRegister(phoneArea, phoneNumber, password, verifyNumber, sessionId) {
91
+ const params = {
92
+ method: 'register',
93
+ areaCode: `+${phoneArea}`,
94
+ phone: phoneNumber,
95
+ password,
96
+ code: verifyNumber,
97
+ sessionId,
98
+ };
99
+ return http.get('/login', { params });
100
+ }
101
+
102
+ /**
103
+ * 获取userSig
104
+ */
105
+ export function getUserSig(sdkAppID, userID, phone, token) {
106
+ const data = {
107
+ appid: parseInt(sdkAppID, 10),
108
+ identifier: userID,
109
+ phone,
110
+ token,
111
+ };
112
+ return http.post('/userSigService', data);
113
+ }
114
+
115
+ /**
116
+ * 注销用户
117
+ * @param {string} phoneArea 用户手机号区号
118
+ * @param {string} phoneNumber 用户手机号码
119
+ */
120
+ export function unRegister(phoneArea, phoneNumber) {
121
+ const params = {
122
+ method: 'unregister',
123
+ areaCode: `+${phoneArea}`,
124
+ phone: phoneNumber,
125
+ };
126
+ return http.get('/login', { params });
127
+ }
@@ -0,0 +1,44 @@
1
+ import config from '../config/nav';
2
+
3
+ function getPageUrl(page) {
4
+ return `/home/${page}`;
5
+ }
6
+
7
+ const navConfig = [];
8
+ const idObj = {};
9
+ Object.values(config).forEach((item, index) => {
10
+ const itemConfig = {};
11
+ itemConfig.id = index + 1;
12
+ itemConfig.title = item.name;
13
+ if (item.content && item.content.length > 0) {
14
+ itemConfig.type = 'group';
15
+ itemConfig.content = item.content.map((contentItem, index) => {
16
+ const newItem = {
17
+ id: (itemConfig.id * 100) + index,
18
+ title: contentItem.name,
19
+ path: contentItem.path,
20
+ url: getPageUrl(contentItem.path),
21
+ pageContent: contentItem.pageContent
22
+ };
23
+ idObj[newItem.path] = newItem.id;
24
+ return newItem;
25
+ });
26
+ } else {
27
+ itemConfig.type = 'item';
28
+ }
29
+ if (item.path) {
30
+ itemConfig.url = getPageUrl(item.path);
31
+ idObj[item.path] = itemConfig.id;
32
+ }
33
+ if (item.pageContent) {
34
+ itemConfig.pageContent = item.pageContent;
35
+ }
36
+ navConfig.push(itemConfig);
37
+ });
38
+
39
+ export function getNavConfig(pageName) {
40
+ return {
41
+ activeId: idObj[pageName],
42
+ navConfig,
43
+ };
44
+ }
@@ -0,0 +1,16 @@
1
+ .basic-container {
2
+ margin-top: 20px;
3
+ }
4
+ .basic-input {
5
+ width: 170px;
6
+ height: 22px;
7
+ }
8
+ #basic-userId-container {
9
+ margin-top: 20px;
10
+ }
11
+ .basic-btn-container {
12
+ margin-top: 20px;
13
+ }
14
+ #basic-stop-btn {
15
+ margin-left: 40px;
16
+ }
@@ -0,0 +1,27 @@
1
+ import { Button } from '@material-ui/core';
2
+ import './BasicInfoComponent.css';
3
+
4
+ export default function BasicInfoComponent(props) {
5
+ const { userId, roomId, isJoined, handleInputChange, handleStart, handleStop } = props;
6
+
7
+ return (
8
+ <div className="basic-container">
9
+ <div>
10
+ <label>房间号:</label>
11
+ <input className="basic-input" placeholder="必填,数值类型,大于零整数" type="number" value={roomId} onChange={(e) => handleInputChange(e, 'ROOMID')} />
12
+ </div>
13
+ <div id="basic-userId-container">
14
+ <label>用户名:</label>
15
+ <input className="basic-input" placeholder="用户名" type="text" value={userId} onChange={(e) => handleInputChange(e, 'USERID')} />
16
+ </div>
17
+ <div className="basic-btn-container">
18
+ <Button variant="contained" color="primary" onClick={() => handleStart()} disabled={isJoined}>
19
+ 进房
20
+ </Button>
21
+ <Button variant="contained" id="basic-stop-btn" onClick={() => handleStop()} disabled={!isJoined} color="primary">
22
+ 退房
23
+ </Button>
24
+ </div>
25
+ </div>
26
+ );
27
+ }
@@ -0,0 +1,64 @@
1
+ import LibGenerateTestUserSig from './lib-generate-test-usersig.min';
2
+
3
+ const genTestUserSig = function (userID) {
4
+ /**
5
+ * 腾讯云 SDKAppId,需要替换为您自己账号下的 SDKAppId。
6
+ *
7
+ * 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ) 创建应用,即可看到 SDKAppId,
8
+ * 它是腾讯云用于区分客户的唯一标识。
9
+ */
10
+
11
+ const SDKAPPID = 1400704311;
12
+
13
+ /**
14
+ * 签名过期时间,建议不要设置的过短
15
+ * <p>
16
+ * 时间单位:秒
17
+ * 默认时间:7 x 24 x 60 x 60 = 604800 = 7 天
18
+ */
19
+ const EXPIRETIME = 604800;
20
+
21
+
22
+ /**
23
+ * 计算签名用的加密密钥,获取步骤如下:
24
+ *
25
+ * step1. 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ),如果还没有应用就创建一个,
26
+ * step2. 单击“应用配置”进入基础配置页面,并进一步找到“帐号体系集成”部分。
27
+ * step3. 点击“查看密钥”按钮,就可以看到计算 UserSig 使用的加密的密钥了,请将其拷贝并复制到如下的变量中
28
+ *
29
+ * 注意:该方案仅适用于调试Demo,正式上线前请将 UserSig 计算代码和密钥迁移到您的后台服务器上,以避免加密密钥泄露导致的流量盗用。
30
+ * 文档:https://cloud.tencent.com/document/product/647/17275#Server
31
+ */
32
+
33
+ const SECRETKEY = '8b897045d1ee4f067a745b1b6a3fb834d1bd4c5951de43282c21b945f98ec982';
34
+
35
+ if (SDKAPPID === '' || SECRETKEY === '') {
36
+ const msg = '请先配置好您的账号信息: SDKAPPID 及 SECRETKEY,配置文件位置:assets/debug/gen-test-user-sig.js';
37
+ console && console.error(msg);
38
+ alert && alert(msg);
39
+ }
40
+
41
+ /*
42
+ * 混流接口功能实现需要补齐此账号信息。
43
+ * 获取途径:腾讯云网页控制台->搜索“实时音视频”->应用管理->选择需要的应用,点击“应用信息”->旁路直播信息部分获取 appid 和 bizid
44
+ *
45
+ * CDN直播地址:开启旁路直播时,需要配置CDN直播域名
46
+ * 获取途径:腾讯云网页控制台->搜索“云直播”->域名管理->根据域名信息,构建云播放地址,格式为:https://播放域名/live/[streamId].flv
47
+ */
48
+ const APPID = 0;
49
+ const BIZID = 0;
50
+ const LIVE_DOMAIN = '';
51
+
52
+ const generator = new LibGenerateTestUserSig(SDKAPPID, SECRETKEY, EXPIRETIME);
53
+ const userSig = generator.genTestUserSig(userID);
54
+
55
+ return {
56
+ sdkAppId: SDKAPPID,
57
+ userSig,
58
+ appId: APPID,
59
+ bizId: BIZID,
60
+ liveDomain: LIVE_DOMAIN
61
+ };
62
+ };
63
+
64
+ export default genTestUserSig;