@@ -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