File tree 3 files changed +40
-4
lines changed
3 files changed +40
-4
lines changed Original file line number Diff line number Diff line change
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [* ]
5
+ charset = utf-8
6
+ end_of_line = lf
7
+ indent_size = 4
8
+ indent_style = space
9
+ max_line_length = 80
10
+ trim_trailing_whitespace = true
11
+
12
+ [* .md ]
13
+ max_line_length = 120
14
+ trim_trailing_whitespace = false
15
+
16
+ [COMMIT_EDITMSG ]
17
+ max_line_length = 80
Original file line number Diff line number Diff line change @@ -82,11 +82,30 @@ JitsiConference.prototype.isJoined = function () {
82
82
83
83
/**
84
84
* Leaves the conference.
85
+ * @returns {Promise }
85
86
*/
86
87
JitsiConference . prototype . leave = function ( ) {
87
- if ( this . xmpp && this . room )
88
- this . xmpp . leaveRoom ( this . room . roomjid ) ;
89
- this . room = null ;
88
+ var conference = this ;
89
+
90
+ // leave the conference
91
+ if ( conference . xmpp && conference . room ) {
92
+ conference . xmpp . leaveRoom ( conference . room . roomjid ) ;
93
+ }
94
+
95
+ conference . room = null ;
96
+
97
+ // remove local tracks
98
+ return Promise . all (
99
+ conference . getLocalTracks ( ) . map ( function ( track ) {
100
+ return conference . removeTrack ( track ) ;
101
+ } )
102
+ ) . then ( function ( ) {
103
+
104
+ // remove all participants
105
+ conference . getParticipants ( ) . forEach ( function ( participant ) {
106
+ conference . onMemberLeft ( participant . getJid ( ) ) ;
107
+ } ) ;
108
+ } ) ;
90
109
} ;
91
110
92
111
/**
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ The object represents a conference. We have the following methods to control the
187
187
1 . join(password) - Joins the conference
188
188
- password - string of the password. This parameter is not mandatory.
189
189
190
- 2 . leave() - leaves the conference
190
+ 2 . leave() - leaves the conference. Returns Promise.
191
191
192
192
4 . getLocalTracks() - Returns array with JitsiTrack objects for the local streams.
193
193
You can’t perform that action at this time.
0 commit comments