|
@@ -729,6 +729,39 @@ export default {
|
729
|
729
|
return this._room
|
730
|
730
|
&& this._room.getConnectionState();
|
731
|
731
|
},
|
|
732
|
+ /**
|
|
733
|
+ * Obtains current P2P ICE connection state.
|
|
734
|
+ * @return {string|null} ICE connection state or <tt>null</tt> if there's no
|
|
735
|
+ * P2P connection
|
|
736
|
+ */
|
|
737
|
+ getP2PConnectionState () {
|
|
738
|
+ return this._room
|
|
739
|
+ && this._room.getP2PConnectionState();
|
|
740
|
+ },
|
|
741
|
+ /**
|
|
742
|
+ * Starts P2P (for tests only)
|
|
743
|
+ * @private
|
|
744
|
+ */
|
|
745
|
+ _startP2P () {
|
|
746
|
+ try {
|
|
747
|
+ this._room && this._room.startP2PSession();
|
|
748
|
+ } catch (error) {
|
|
749
|
+ logger.error("Start P2P failed", error);
|
|
750
|
+ throw error;
|
|
751
|
+ }
|
|
752
|
+ },
|
|
753
|
+ /**
|
|
754
|
+ * Stops P2P (for tests only)
|
|
755
|
+ * @private
|
|
756
|
+ */
|
|
757
|
+ _stopP2P () {
|
|
758
|
+ try {
|
|
759
|
+ this._room && this._room.stopP2PSession();
|
|
760
|
+ } catch (error) {
|
|
761
|
+ logger.error("Stop P2P failed", error);
|
|
762
|
+ throw error;
|
|
763
|
+ }
|
|
764
|
+ },
|
732
|
765
|
/**
|
733
|
766
|
* Checks whether or not our connection is currently in interrupted and
|
734
|
767
|
* reconnect attempts are in progress.
|