Skip to content

Commit 92d8270

Browse files
author
Oleksandr Shvetsov
committed
SDK version updated to 2.13.10
1 parent 950a77e commit 92d8270

File tree

8 files changed

+105
-131
lines changed

8 files changed

+105
-131
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Check out our [API Reference](https://quickblox.github.io/quickblox-javascript-s
1616
## Dependencies for browser
1717

1818
```html
19-
<script src="https://unpkg.com/quickblox@2.13.9/quickblox.min.js"></script>
19+
<script src="https://unpkg.com/quickblox/quickblox.min.js"></script>
2020
```
2121

2222
## Bower and RequireJS

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "quickblox",
33
"description": "QuickBlox JavaScript SDK",
4-
"version": "2.13.9",
4+
"version": "2.13.10",
55
"homepage": "https://quickblox.com/developers/Javascript",
66
"main": "src/qbMain.js",
77
"license": "(Apache-2.0)",

quickblox.js

Lines changed: 50 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -51141,48 +51141,31 @@ RTCPeerConnection.prototype.getAndSetLocalSessionDescription = function(callType
5114151141

5114251142
self.state = RTCPeerConnection.State.CONNECTING;
5114351143

51144-
if (self.type === 'offer') {
51145-
// Additional parameters for SDP Constraints
51146-
// http://www.w3.org/TR/webrtc/#h-offer-answer-options
51147-
51148-
self.createOffer().then(function(offer) {
51149-
if (self.delegate.bandwidth) {
51150-
offer.sdp = setMediaBitrate(
51151-
offer.sdp,
51152-
'video',
51153-
self.delegate.bandwidth
51154-
);
51155-
}
51156-
successCallback(offer);
51157-
}).catch(function(reason) {
51158-
errorCallback(reason);
51159-
});
51160-
51161-
} else {
51162-
self.createAnswer().then(function(answer) {
51163-
if (self.delegate.bandwidth) {
51164-
answer.sdp = setMediaBitrate(
51165-
answer.sdp,
51166-
'video',
51167-
self.delegate.bandwidth
51168-
);
51169-
}
51170-
successCallback(answer);
51171-
}).catch(function(reason) {
51172-
errorCallback(reason);
51173-
});
51174-
}
51175-
51176-
function successCallback(desc) {
51177-
self.setLocalDescription(desc).then(function() {
51178-
callback(null);
51179-
}).catch(function(error) {
51180-
errorCallback(error);
51181-
});
51144+
/**
51145+
* @param {RTCSessionDescriptionInit} description
51146+
*/
51147+
function successCallback(description) {
51148+
var modifiedDescription = _removeExtmapMixedFromSDP(description);
51149+
if (self.delegate.bandwidth) {
51150+
modifiedDescription.sdp = setMediaBitrate(
51151+
modifiedDescription.sdp,
51152+
'video',
51153+
self.delegate.bandwidth
51154+
);
51155+
}
51156+
self.setLocalDescription(modifiedDescription)
51157+
.then(function() {
51158+
callback(null);
51159+
})
51160+
.catch(function(error) {
51161+
callback(error);
51162+
});
5118251163
}
5118351164

51184-
function errorCallback(error) {
51185-
callback(error);
51165+
if (self.type === 'offer') {
51166+
self.createOffer().then(successCallback).catch(callback);
51167+
} else {
51168+
self.createAnswer().then(successCallback).catch(callback);
5118651169
}
5118751170
};
5118851171

@@ -51561,19 +51544,21 @@ function _getStats(peer, lastResults, successCallback, errorCallback) {
5156151544
}
5156251545

5156351546
/**
51564-
* It's functions to fixed issue
51565-
* https://bugzilla.mozilla.org/show_bug.cgi?id=1377434
51547+
* This is to fix error on legacy WebRTC implementations
51548+
* @param {RTCSessionDescriptionInit} description
5156651549
*/
51567-
function _modifySDPforFixIssue(sdp) {
51568-
var parsedSDP = transform.parse(sdp);
51569-
51570-
parsedSDP.groups = parsedSDP.groups ? parsedSDP.groups : [];
51571-
parsedSDP.groups.push({
51572-
mids: 'sdparta_0',
51573-
type: 'BUNDLE'
51574-
});
51575-
51576-
return transform.write(parsedSDP);
51550+
function _removeExtmapMixedFromSDP(description) {
51551+
if (description &&
51552+
description.sdp &&
51553+
description.sdp.indexOf('\na=extmap-allow-mixed') !== -1) {
51554+
description.sdp = description.sdp
51555+
.split('\n')
51556+
.filter(function (line) {
51557+
return line.trim() !== 'a=extmap-allow-mixed';
51558+
})
51559+
.join('\n');
51560+
}
51561+
return description;
5157751562
}
5157851563

5157951564
function setMediaBitrate(sdp, media, bitrate) {
@@ -52762,14 +52747,17 @@ WebRTCSession.prototype.processOnAccept = function(userID, extension) {
5276252747

5276352748
if(peerConnection){
5276452749
peerConnection._clearDialingTimer();
52765-
52766-
peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
52767-
if(error){
52768-
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
52769-
}else{
52770-
Helpers.trace("'setRemoteSessionDescription' success");
52771-
}
52772-
});
52750+
if (peerConnection.signalingState !== 'stable') {
52751+
peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
52752+
if(error){
52753+
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
52754+
}else{
52755+
Helpers.trace("'setRemoteSessionDescription' success");
52756+
}
52757+
});
52758+
} else {
52759+
Helpers.traceError("Ignore 'onAccept', PeerConnection is already in 'stable' state");
52760+
}
5277352761
}else{
5277452762
Helpers.traceError("Ignore 'OnAccept', there is no information about peer connection by some reason.");
5277552763
}
@@ -52910,7 +52898,6 @@ WebRTCSession.prototype._createPeer = function(userID, peerConnectionType) {
5291052898

5291152899
var pcConfig = {
5291252900
iceServers: config.webrtc.iceServers,
52913-
offerExtmapAllowMixed: false
5291452901
};
5291552902

5291652903
Helpers.trace("_createPeer, iceServers: " + JSON.stringify(pcConfig));
@@ -53652,8 +53639,8 @@ module.exports = StreamManagement;
5365253639
*/
5365353640

5365453641
var config = {
53655-
version: '2.13.9',
53656-
buildNumber: '1102',
53642+
version: '2.13.10',
53643+
buildNumber: '1104',
5365753644
creds: {
5365853645
appId: '',
5365953646
authKey: '',

quickblox.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/webrtc/qbRTCPeerConnection.js

Lines changed: 37 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -172,48 +172,31 @@ RTCPeerConnection.prototype.getAndSetLocalSessionDescription = function(callType
172172

173173
self.state = RTCPeerConnection.State.CONNECTING;
174174

175-
if (self.type === 'offer') {
176-
// Additional parameters for SDP Constraints
177-
// http://www.w3.org/TR/webrtc/#h-offer-answer-options
178-
179-
self.createOffer().then(function(offer) {
180-
if (self.delegate.bandwidth) {
181-
offer.sdp = setMediaBitrate(
182-
offer.sdp,
183-
'video',
184-
self.delegate.bandwidth
185-
);
186-
}
187-
successCallback(offer);
188-
}).catch(function(reason) {
189-
errorCallback(reason);
190-
});
191-
192-
} else {
193-
self.createAnswer().then(function(answer) {
194-
if (self.delegate.bandwidth) {
195-
answer.sdp = setMediaBitrate(
196-
answer.sdp,
197-
'video',
198-
self.delegate.bandwidth
199-
);
200-
}
201-
successCallback(answer);
202-
}).catch(function(reason) {
203-
errorCallback(reason);
204-
});
205-
}
206-
207-
function successCallback(desc) {
208-
self.setLocalDescription(desc).then(function() {
209-
callback(null);
210-
}).catch(function(error) {
211-
errorCallback(error);
212-
});
175+
/**
176+
* @param {RTCSessionDescriptionInit} description
177+
*/
178+
function successCallback(description) {
179+
var modifiedDescription = _removeExtmapMixedFromSDP(description);
180+
if (self.delegate.bandwidth) {
181+
modifiedDescription.sdp = setMediaBitrate(
182+
modifiedDescription.sdp,
183+
'video',
184+
self.delegate.bandwidth
185+
);
186+
}
187+
self.setLocalDescription(modifiedDescription)
188+
.then(function() {
189+
callback(null);
190+
})
191+
.catch(function(error) {
192+
callback(error);
193+
});
213194
}
214195

215-
function errorCallback(error) {
216-
callback(error);
196+
if (self.type === 'offer') {
197+
self.createOffer().then(successCallback).catch(callback);
198+
} else {
199+
self.createAnswer().then(successCallback).catch(callback);
217200
}
218201
};
219202

@@ -592,19 +575,21 @@ function _getStats(peer, lastResults, successCallback, errorCallback) {
592575
}
593576

594577
/**
595-
* It's functions to fixed issue
596-
* https://bugzilla.mozilla.org/show_bug.cgi?id=1377434
578+
* This is to fix error on legacy WebRTC implementations
579+
* @param {RTCSessionDescriptionInit} description
597580
*/
598-
function _modifySDPforFixIssue(sdp) {
599-
var parsedSDP = transform.parse(sdp);
600-
601-
parsedSDP.groups = parsedSDP.groups ? parsedSDP.groups : [];
602-
parsedSDP.groups.push({
603-
mids: 'sdparta_0',
604-
type: 'BUNDLE'
605-
});
606-
607-
return transform.write(parsedSDP);
581+
function _removeExtmapMixedFromSDP(description) {
582+
if (description &&
583+
description.sdp &&
584+
description.sdp.indexOf('\na=extmap-allow-mixed') !== -1) {
585+
description.sdp = description.sdp
586+
.split('\n')
587+
.filter(function (line) {
588+
return line.trim() !== 'a=extmap-allow-mixed';
589+
})
590+
.join('\n');
591+
}
592+
return description;
608593
}
609594

610595
function setMediaBitrate(sdp, media, bitrate) {

src/modules/webrtc/qbWebRTCSession.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -643,14 +643,17 @@ WebRTCSession.prototype.processOnAccept = function(userID, extension) {
643643

644644
if(peerConnection){
645645
peerConnection._clearDialingTimer();
646-
647-
peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
648-
if(error){
649-
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
650-
}else{
651-
Helpers.trace("'setRemoteSessionDescription' success");
652-
}
653-
});
646+
if (peerConnection.signalingState !== 'stable') {
647+
peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
648+
if(error){
649+
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
650+
}else{
651+
Helpers.trace("'setRemoteSessionDescription' success");
652+
}
653+
});
654+
} else {
655+
Helpers.traceError("Ignore 'onAccept', PeerConnection is already in 'stable' state");
656+
}
654657
}else{
655658
Helpers.traceError("Ignore 'OnAccept', there is no information about peer connection by some reason.");
656659
}
@@ -791,7 +794,6 @@ WebRTCSession.prototype._createPeer = function(userID, peerConnectionType) {
791794

792795
var pcConfig = {
793796
iceServers: config.webrtc.iceServers,
794-
offerExtmapAllowMixed: false
795797
};
796798

797799
Helpers.trace("_createPeer, iceServers: " + JSON.stringify(pcConfig));

src/qbConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
*/
1313

1414
var config = {
15-
version: '2.13.9',
16-
buildNumber: '1102',
15+
version: '2.13.10',
16+
buildNumber: '1104',
1717
creds: {
1818
appId: '',
1919
authKey: '',

0 commit comments

Comments
 (0)