Commit b89fbb8 1 parent 66eac44 commit b89fbb8 Copy full SHA for b89fbb8
File tree 3 files changed +6
-6
lines changed
web/flat-web/src/api-middleware/rtc
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ module.exports = {
92
92
"zindex" , // antd
93
93
"geogebra" , // @netless /app-geogebra
94
94
"commitlintrc" , // @commitlint /cli
95
+ "unpublish" , // agora-rtc-sdk-ng
95
96
96
97
// misc
97
98
"npmrc" ,
Original file line number Diff line number Diff line change @@ -57,10 +57,8 @@ export class RtcAvatar extends EventEmitter {
57
57
this . observeVolumeId = window . setInterval ( this . checkVolume , 500 ) ;
58
58
}
59
59
60
- public async destroy ( ) : Promise < void > {
60
+ public destroy ( ) : void {
61
61
clearInterval ( this . observeVolumeId ) ;
62
- await this . setMic ( false ) ;
63
- await this . setCamera ( false ) ;
64
62
this . rtc . removeAvatar ( this ) ;
65
63
}
66
64
Original file line number Diff line number Diff line change @@ -103,12 +103,13 @@ export class RtcRoom {
103
103
setMicrophoneTrack ( ) ;
104
104
setCameraTrack ( ) ;
105
105
if ( this . client . localTracks . length > 0 ) {
106
- for ( const track of this . client . localTracks ) {
106
+ const tracks = this . client . localTracks ;
107
+ console . log ( "[rtc] unpublish local tracks" ) ;
108
+ await this . client . unpublish ( tracks ) ;
109
+ for ( const track of tracks ) {
107
110
track . stop ( ) ;
108
111
track . close ( ) ;
109
112
}
110
- console . log ( "[rtc] unpublish local tracks" ) ;
111
- await this . client . unpublish ( this . client . localTracks ) ;
112
113
}
113
114
this . client . off ( "user-published" , this . onUserPublished ) ;
114
115
this . client . off ( "user-unpublished" , this . onUserUnpublished ) ;
You can’t perform that action at this time.
0 commit comments