feat: add test P2P methods
This commit is contained in:
parent
d01a65f73d
commit
fb47b6ae21
|
@ -729,6 +729,39 @@ export default {
|
||||||
return this._room
|
return this._room
|
||||||
&& this._room.getConnectionState();
|
&& this._room.getConnectionState();
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Obtains current P2P ICE connection state.
|
||||||
|
* @return {string|null} ICE connection state or <tt>null</tt> if there's no
|
||||||
|
* P2P connection
|
||||||
|
*/
|
||||||
|
getP2PConnectionState () {
|
||||||
|
return this._room
|
||||||
|
&& this._room.getP2PConnectionState();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Starts P2P (for tests only)
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_startP2P () {
|
||||||
|
try {
|
||||||
|
this._room && this._room.startP2PSession();
|
||||||
|
} catch (error) {
|
||||||
|
logger.error("Start P2P failed", error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Stops P2P (for tests only)
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_stopP2P () {
|
||||||
|
try {
|
||||||
|
this._room && this._room.stopP2PSession();
|
||||||
|
} catch (error) {
|
||||||
|
logger.error("Stop P2P failed", error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Checks whether or not our connection is currently in interrupted and
|
* Checks whether or not our connection is currently in interrupted and
|
||||||
* reconnect attempts are in progress.
|
* reconnect attempts are in progress.
|
||||||
|
|
11
config.js
11
config.js
|
@ -80,5 +80,14 @@ var config = { // eslint-disable-line no-unused-vars
|
||||||
// disables or enables RTX (RFC 4588) (defaults to false).
|
// disables or enables RTX (RFC 4588) (defaults to false).
|
||||||
disableRtx: false,
|
disableRtx: false,
|
||||||
// Sets the preferred resolution (height) for local video. Defaults to 360.
|
// Sets the preferred resolution (height) for local video. Defaults to 360.
|
||||||
resolution: 720
|
resolution: 720,
|
||||||
|
// Enables peer to peer mode. When enabled system will try to establish
|
||||||
|
// direct connection given that there are exactly 2 participants in
|
||||||
|
// the room. If that succeeds the conference will stop sending data through
|
||||||
|
// the JVB and use the peer to peer connection instead. When 3rd participant
|
||||||
|
// joins the conference will be moved back to the JVB connection.
|
||||||
|
//enableP2P: true
|
||||||
|
// How long we're going to wait, before going back to P2P after
|
||||||
|
// the 3rd participant has left the conference (to filter out page reload)
|
||||||
|
//backToP2PDelay: 5
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue