Przeglądaj źródła

feat(JitsiConference) add dispose method

It's a short-hand for leaving the conference and then disconnecting the
underlying connection.

In the general case (no breakout rooms) this is likely a preferred way
to handle leaving, since there is no good reason to keep the connection
open afterwards.
master
Saúl Ibarra Corretgé 6 miesięcy temu
rodzic
commit
39f9e4e644
1 zmienionych plików z 9 dodań i 0 usunięć
  1. 9
    0
      JitsiConference.js

+ 9
- 0
JitsiConference.js Wyświetl plik

@@ -745,6 +745,15 @@ JitsiConference.prototype.leave = async function(reason) {
745 745
     }
746 746
 };
747 747
 
748
+/**
749
+ * Disposes of conference resources. This operation is a short-hand for leaving
750
+ * the conference and disconnecting the connection.
751
+ */
752
+JitsiConference.prototype.dispose = async function() {
753
+    await this.leave();
754
+    await this.connection?.disconnect();
755
+};
756
+
748 757
 /**
749 758
  * Returns <tt>true</tt> if end conference support is enabled in the backend.
750 759
  *

Ładowanie…
Anuluj
Zapisz