Parcourir la source

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é il y a 6 mois
Parent
révision
39f9e4e644
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. 9
    0
      JitsiConference.js

+ 9
- 0
JitsiConference.js Voir le fichier

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
  * Returns <tt>true</tt> if end conference support is enabled in the backend.
758
  * Returns <tt>true</tt> if end conference support is enabled in the backend.
750
  *
759
  *

Chargement…
Annuler
Enregistrer