You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Merge branch 'master' into develop
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
Changes in [0.9.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v0.9.1) (2017-11-17)
|
||||||
|
================================================================================================
|
||||||
|
[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v0.9.0...v0.9.1)
|
||||||
|
|
||||||
|
* Fix the force TURN option
|
||||||
|
[\#577](https://github.com/matrix-org/matrix-js-sdk/pull/577)
|
||||||
|
|
||||||
Changes in [0.9.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v0.9.0) (2017-11-15)
|
Changes in [0.9.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v0.9.0) (2017-11-15)
|
||||||
================================================================================================
|
================================================================================================
|
||||||
[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v0.9.0-rc.1...v0.9.0)
|
[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v0.9.0-rc.1...v0.9.0)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "matrix-js-sdk",
|
"name": "matrix-js-sdk",
|
||||||
"version": "0.9.0",
|
"version": "0.9.1",
|
||||||
"description": "Matrix Client-Server SDK for Javascript",
|
"description": "Matrix Client-Server SDK for Javascript",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -175,6 +175,8 @@ function MatrixClient(opts) {
|
|||||||
this._cryptoStore = opts.cryptoStore;
|
this._cryptoStore = opts.cryptoStore;
|
||||||
this._sessionStore = opts.sessionStore;
|
this._sessionStore = opts.sessionStore;
|
||||||
|
|
||||||
|
this._forceTURN = opts.forceTURN || false;
|
||||||
|
|
||||||
if (CRYPTO_ENABLED) {
|
if (CRYPTO_ENABLED) {
|
||||||
this.olmVersion = Crypto.getOlmVersion();
|
this.olmVersion = Crypto.getOlmVersion();
|
||||||
}
|
}
|
||||||
@@ -252,6 +254,16 @@ MatrixClient.prototype.supportsVoip = function() {
|
|||||||
return this._supportsVoip;
|
return this._supportsVoip;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether VoIP calls are forced to use only TURN
|
||||||
|
* candidates. This is the same as the forceTURN option
|
||||||
|
* when creating the client.
|
||||||
|
* @param {bool} forceTURN True to force use of TURN servers
|
||||||
|
*/
|
||||||
|
MatrixClient.prototype.setForceTURN = function(forceTURN) {
|
||||||
|
this._forceTURN = forceTURN;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current sync state.
|
* Get the current sync state.
|
||||||
* @return {?string} the sync state, which may be null.
|
* @return {?string} the sync state, which may be null.
|
||||||
@@ -3154,7 +3166,9 @@ function setupCallEventHandler(client) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
call = webRtcCall.createNewMatrixCall(client, event.getRoomId());
|
call = webRtcCall.createNewMatrixCall(client, event.getRoomId(), {
|
||||||
|
forceTURN: client._forceTURN,
|
||||||
|
});
|
||||||
if (!call) {
|
if (!call) {
|
||||||
console.log(
|
console.log(
|
||||||
"Incoming call ID " + content.call_id + " but this client " +
|
"Incoming call ID " + content.call_id + " but this client " +
|
||||||
|
|||||||
@@ -1296,8 +1296,8 @@ module.exports.setVideoInput = function(deviceId) { videoInput = deviceId; };
|
|||||||
* Create a new Matrix call for the browser.
|
* Create a new Matrix call for the browser.
|
||||||
* @param {MatrixClient} client The client instance to use.
|
* @param {MatrixClient} client The client instance to use.
|
||||||
* @param {string} roomId The room the call is in.
|
* @param {string} roomId The room the call is in.
|
||||||
* @param {Object?} options optional options map.
|
* @param {Object?} options DEPRECATED optional options map.
|
||||||
* @param {boolean} options.forceTURN whether relay through TURN should be forced.
|
* @param {boolean} options.forceTURN DEPRECATED whether relay through TURN should be forced. This option is deprecated - use opts.forceTURN when creating the matrix client since it's only possible to set this option on outbound calls.
|
||||||
* @return {MatrixCall} the call or null if the browser doesn't support calling.
|
* @return {MatrixCall} the call or null if the browser doesn't support calling.
|
||||||
*/
|
*/
|
||||||
module.exports.createNewMatrixCall = function(client, roomId, options) {
|
module.exports.createNewMatrixCall = function(client, roomId, options) {
|
||||||
@@ -1350,6 +1350,9 @@ module.exports.createNewMatrixCall = function(client, roomId, options) {
|
|||||||
!webRtc.RtcPeerConnection || !webRtc.getUserMedia) {
|
!webRtc.RtcPeerConnection || !webRtc.getUserMedia) {
|
||||||
return null; // WebRTC is not supported.
|
return null; // WebRTC is not supported.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const optionsForceTURN = options ? options.forceTURN : false;
|
||||||
|
|
||||||
const opts = {
|
const opts = {
|
||||||
webRtc: webRtc,
|
webRtc: webRtc,
|
||||||
client: client,
|
client: client,
|
||||||
@@ -1357,7 +1360,7 @@ module.exports.createNewMatrixCall = function(client, roomId, options) {
|
|||||||
roomId: roomId,
|
roomId: roomId,
|
||||||
turnServers: client.getTurnServers(),
|
turnServers: client.getTurnServers(),
|
||||||
// call level options
|
// call level options
|
||||||
forceTURN: options ? options.forceTURN : false,
|
forceTURN: client._forceTURN || optionsForceTURN,
|
||||||
};
|
};
|
||||||
return new MatrixCall(opts);
|
return new MatrixCall(opts);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user