Skip to content

Commit f224905

Browse files
Rychouanderlu
authored andcommitted
feat: update Web/base-react-next
1 parent 2aa9cc9 commit f224905

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

Web/base-react-next/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ WebRTC 技术由 Google 最先提出,目前主要在桌面版 Chrome 浏览器
232232
<span id="requirements"></span>
233233
## 环境要求
234234
- 请使用最新版本的 Chrome 浏览器。
235-
- TRTC Web SDK 依赖以下端口进行数据传输,请将其加入防火墙白名单,参考:[WebRTC 需要配置哪些端口或域名为白名单?](https://cloud.tencent.com/document/product/647/34399#webrtc-.E9.9C.80.E8.A6.81.E9.85.8D.E7.BD.AE.E5.93.AA.E4.BA.9B.E7.AB.AF.E5.8F.A3.E6.88.96.E5.9F.9F.E5.90.8D.E4.B8.BA.E7.99.BD.E5.90.8D.E5.8D.95.EF.BC.9F) 配置完成后,您可以通过访问并体验 [官网 Demo](https://web.sdk.qcloud.com/trtc/webrtc/demo/api-sample/basic-rtc.html) 检查配置是否生效。
235+
- TRTC Web SDK 依赖以下端口进行数据传输,请将其加入防火墙白名单,配置完成后,您可以通过访问并体验 [官网 Demo](https://trtc-1252463788.file.myqcloud.com/web/demo/official-demo/index.html) 检查配置是否生效。
236+
- TCP 端口:8687
237+
- UDP 端口:8000;8080;8800;843;443;16285
238+
- 域名:qcloud.rtc.qq.com
236239

237240
## 常见问题
238241

Web/base-react-next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
"react-dom": "17.0.2",
3636
"react-i18next": "^11.8.15",
3737
"rtc-audio-mixer": "0.0.1",
38-
"rtc-beauty-plugin": "^0.0.6",
38+
"rtc-beauty-plugin": "^0.0.7",
3939
"rtc-device-detector-react": "^1.0.4",
4040
"sass": "^1.32.12",
41-
"trtc-js-sdk": "latest"
41+
"trtc-js-sdk": "^4.11.7"
4242
},
4343
"devDependencies": {
4444
"eslint-config-tencent": "^1.0.0",

Web/base-react-next/src/components/RtcClient/improve-publishCDNStream-rtc-client.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class Client extends RTC {
2121
// ref: https://web.sdk.qcloud.com/trtc/webrtc/doc/zh-cn/Client.html#startPublishCDNStream
2222

2323
// example 1:“全局自动旁路”模式下,修改当前用户音视频流在腾讯云 CDN 对应的 StreamId
24-
// handleStartPublishCDNStream() {
24+
// async handleStartPublishCDNStream() {
2525
// if (!this.streamID) {
2626
// Toast.error('please input streamID');
2727
// return;
2828
// }
2929
// const options = { streamId: this.streamID };
3030
// try {
31-
// this.client.startPublishCDNStream(options);
31+
// await this.client.startPublishCDNStream(options);
3232
// Toast.success('start publishCDNStream success', 2000);
3333
// } catch (error) {
3434
// console.error('start publishCDNStream error', error);
@@ -37,9 +37,9 @@ class Client extends RTC {
3737
// }
3838

3939
// example 2:“指定流旁路”模式下,以默认 streamId: ${sdkAppId}_${roomId}_${userId}_main 发布当前用户音视频流到腾讯云 CDN
40-
// handleStartPublishCDNStream() {
40+
// async handleStartPublishCDNStream() {
4141
// try {
42-
// this.client.startPublishCDNStream();
42+
// await this.client.startPublishCDNStream();
4343
// Toast.success('start publishCDNStream success', 2000);
4444
// } catch (error) {
4545
// console.error('start publishCDNStream error', error);
@@ -48,13 +48,13 @@ class Client extends RTC {
4848
// }
4949

5050
// example 3:“指定流旁路”模式下,以指定 streamId 发布当前用户音视频流到腾讯云 CDN
51-
// handleStartPublishCDNStream() {
51+
// async handleStartPublishCDNStream() {
5252
// if (!this.streamID) {
5353
// Toast.error('please input streamID');
5454
// }
5555
// const options = { streamId: this.streamID };
5656
// try {
57-
// this.client.startPublishCDNStream(options);
57+
// await this.client.startPublishCDNStream(options);
5858
// Toast.success('start publishCDNStream success', 2000);
5959
// } catch (error) {
6060
// console.error('start publishCDNStream error', error);
@@ -63,7 +63,7 @@ class Client extends RTC {
6363
// }
6464

6565
// example 4: 将当前用户音视频流发布到指定的 CDN 地址
66-
// handleStartPublishCDNStream() {
66+
// async handleStartPublishCDNStream() {
6767
// if (!this.appID || !this.bizID || !this.publishCDNUrl) {
6868
// Toast.error('please input appID, bizID, publishCDNUrl');
6969
// }
@@ -73,7 +73,7 @@ class Client extends RTC {
7373
// url: this.publishCDNUrl,
7474
// };
7575
// try {
76-
// this.client.startPublishCDNStream(options);
76+
// await this.client.startPublishCDNStream(options);
7777
// Toast.success('start publishCDNStream success', 2000);
7878
// } catch (error) {
7979
// console.error('start publishCDNStream error', error);
@@ -82,7 +82,7 @@ class Client extends RTC {
8282
// }
8383

8484
// example 5: 修改当前用户音视频流在腾讯云 CDN 对应的 StreamId,并且发布当前用户音视频流到指定的 CDN 地址
85-
handleStartPublishCDNStream() {
85+
async handleStartPublishCDNStream() {
8686
if (!this.streamID || !this.appID || !this.bizID || !this.publishCDNUrl) {
8787
Toast.error('please input streamID, appID, bizID, publishCDNUrl');
8888
return;
@@ -94,7 +94,7 @@ class Client extends RTC {
9494
url: this.publishCDNUrl,
9595
};
9696
try {
97-
this.client.startPublishCDNStream(options);
97+
await this.client.startPublishCDNStream(options);
9898
Toast.success('start publishCDNStream success', 2000);
9999
} catch (error) {
100100
console.error('start publishCDNStream error', error);
@@ -104,9 +104,9 @@ class Client extends RTC {
104104

105105

106106
// ref: https://web.sdk.qcloud.com/trtc/webrtc/doc/zh-cn/Client.html#stopPublishCDNStream
107-
handleStopPublishCDNStream() {
107+
async handleStopPublishCDNStream() {
108108
try {
109-
this.client.stopPublishCDNStream();
109+
await this.client.stopPublishCDNStream();
110110
Toast.success('start publishCDNStream success', 2000);
111111
} catch (error) {
112112
console.error('start publishCDNStream error', error);

0 commit comments

Comments
 (0)