Skip to content

Commit

Permalink
SDK version updated to 2.13.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Shvetsov committed Aug 31, 2021
1 parent 950a77e commit 92d8270
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 131 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Check out our [API Reference](https://quickblox.github.io/quickblox-javascript-s
## Dependencies for browser

```html
<script src="https://unpkg.com/quickblox@2.13.9/quickblox.min.js"></script>
<script src="https://unpkg.com/quickblox/quickblox.min.js"></script>
```

## Bower and RequireJS
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quickblox",
"description": "QuickBlox JavaScript SDK",
"version": "2.13.9",
"version": "2.13.10",
"homepage": "https://quickblox.com/developers/Javascript",
"main": "src/qbMain.js",
"license": "(Apache-2.0)",
Expand Down
113 changes: 50 additions & 63 deletions quickblox.js
Original file line number Diff line number Diff line change
Expand Up @@ -51141,48 +51141,31 @@ RTCPeerConnection.prototype.getAndSetLocalSessionDescription = function(callType

self.state = RTCPeerConnection.State.CONNECTING;

if (self.type === 'offer') {
// Additional parameters for SDP Constraints
// http://www.w3.org/TR/webrtc/#h-offer-answer-options

self.createOffer().then(function(offer) {
if (self.delegate.bandwidth) {
offer.sdp = setMediaBitrate(
offer.sdp,
'video',
self.delegate.bandwidth
);
}
successCallback(offer);
}).catch(function(reason) {
errorCallback(reason);
});

} else {
self.createAnswer().then(function(answer) {
if (self.delegate.bandwidth) {
answer.sdp = setMediaBitrate(
answer.sdp,
'video',
self.delegate.bandwidth
);
}
successCallback(answer);
}).catch(function(reason) {
errorCallback(reason);
});
}

function successCallback(desc) {
self.setLocalDescription(desc).then(function() {
callback(null);
}).catch(function(error) {
errorCallback(error);
});
/**
* @param {RTCSessionDescriptionInit} description
*/
function successCallback(description) {
var modifiedDescription = _removeExtmapMixedFromSDP(description);
if (self.delegate.bandwidth) {
modifiedDescription.sdp = setMediaBitrate(
modifiedDescription.sdp,
'video',
self.delegate.bandwidth
);
}
self.setLocalDescription(modifiedDescription)
.then(function() {
callback(null);
})
.catch(function(error) {
callback(error);
});
}

function errorCallback(error) {
callback(error);
if (self.type === 'offer') {
self.createOffer().then(successCallback).catch(callback);
} else {
self.createAnswer().then(successCallback).catch(callback);
}
};

Expand Down Expand Up @@ -51561,19 +51544,21 @@ function _getStats(peer, lastResults, successCallback, errorCallback) {
}

/**
* It's functions to fixed issue
* https://bugzilla.mozilla.org/show_bug.cgi?id=1377434
* This is to fix error on legacy WebRTC implementations
* @param {RTCSessionDescriptionInit} description
*/
function _modifySDPforFixIssue(sdp) {
var parsedSDP = transform.parse(sdp);

parsedSDP.groups = parsedSDP.groups ? parsedSDP.groups : [];
parsedSDP.groups.push({
mids: 'sdparta_0',
type: 'BUNDLE'
});

return transform.write(parsedSDP);
function _removeExtmapMixedFromSDP(description) {
if (description &&
description.sdp &&
description.sdp.indexOf('\na=extmap-allow-mixed') !== -1) {
description.sdp = description.sdp
.split('\n')
.filter(function (line) {
return line.trim() !== 'a=extmap-allow-mixed';
})
.join('\n');
}
return description;
}

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

if(peerConnection){
peerConnection._clearDialingTimer();

peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
if(error){
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
}else{
Helpers.trace("'setRemoteSessionDescription' success");
}
});
if (peerConnection.signalingState !== 'stable') {
peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
if(error){
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
}else{
Helpers.trace("'setRemoteSessionDescription' success");
}
});
} else {
Helpers.traceError("Ignore 'onAccept', PeerConnection is already in 'stable' state");
}
}else{
Helpers.traceError("Ignore 'OnAccept', there is no information about peer connection by some reason.");
}
Expand Down Expand Up @@ -52910,7 +52898,6 @@ WebRTCSession.prototype._createPeer = function(userID, peerConnectionType) {

var pcConfig = {
iceServers: config.webrtc.iceServers,
offerExtmapAllowMixed: false
};

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

var config = {
version: '2.13.9',
buildNumber: '1102',
version: '2.13.10',
buildNumber: '1104',
creds: {
appId: '',
authKey: '',
Expand Down
2 changes: 1 addition & 1 deletion quickblox.min.js

Large diffs are not rendered by default.

89 changes: 37 additions & 52 deletions src/modules/webrtc/qbRTCPeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,48 +172,31 @@ RTCPeerConnection.prototype.getAndSetLocalSessionDescription = function(callType

self.state = RTCPeerConnection.State.CONNECTING;

if (self.type === 'offer') {
// Additional parameters for SDP Constraints
// http://www.w3.org/TR/webrtc/#h-offer-answer-options

self.createOffer().then(function(offer) {
if (self.delegate.bandwidth) {
offer.sdp = setMediaBitrate(
offer.sdp,
'video',
self.delegate.bandwidth
);
}
successCallback(offer);
}).catch(function(reason) {
errorCallback(reason);
});

} else {
self.createAnswer().then(function(answer) {
if (self.delegate.bandwidth) {
answer.sdp = setMediaBitrate(
answer.sdp,
'video',
self.delegate.bandwidth
);
}
successCallback(answer);
}).catch(function(reason) {
errorCallback(reason);
});
}

function successCallback(desc) {
self.setLocalDescription(desc).then(function() {
callback(null);
}).catch(function(error) {
errorCallback(error);
});
/**
* @param {RTCSessionDescriptionInit} description
*/
function successCallback(description) {
var modifiedDescription = _removeExtmapMixedFromSDP(description);
if (self.delegate.bandwidth) {
modifiedDescription.sdp = setMediaBitrate(
modifiedDescription.sdp,
'video',
self.delegate.bandwidth
);
}
self.setLocalDescription(modifiedDescription)
.then(function() {
callback(null);
})
.catch(function(error) {
callback(error);
});
}

function errorCallback(error) {
callback(error);
if (self.type === 'offer') {
self.createOffer().then(successCallback).catch(callback);
} else {
self.createAnswer().then(successCallback).catch(callback);
}
};

Expand Down Expand Up @@ -592,19 +575,21 @@ function _getStats(peer, lastResults, successCallback, errorCallback) {
}

/**
* It's functions to fixed issue
* https://bugzilla.mozilla.org/show_bug.cgi?id=1377434
* This is to fix error on legacy WebRTC implementations
* @param {RTCSessionDescriptionInit} description
*/
function _modifySDPforFixIssue(sdp) {
var parsedSDP = transform.parse(sdp);

parsedSDP.groups = parsedSDP.groups ? parsedSDP.groups : [];
parsedSDP.groups.push({
mids: 'sdparta_0',
type: 'BUNDLE'
});

return transform.write(parsedSDP);
function _removeExtmapMixedFromSDP(description) {
if (description &&
description.sdp &&
description.sdp.indexOf('\na=extmap-allow-mixed') !== -1) {
description.sdp = description.sdp
.split('\n')
.filter(function (line) {
return line.trim() !== 'a=extmap-allow-mixed';
})
.join('\n');
}
return description;
}

function setMediaBitrate(sdp, media, bitrate) {
Expand Down
20 changes: 11 additions & 9 deletions src/modules/webrtc/qbWebRTCSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,14 +643,17 @@ WebRTCSession.prototype.processOnAccept = function(userID, extension) {

if(peerConnection){
peerConnection._clearDialingTimer();

peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
if(error){
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
}else{
Helpers.trace("'setRemoteSessionDescription' success");
}
});
if (peerConnection.signalingState !== 'stable') {
peerConnection.setRemoteSessionDescription('answer', extension.sdp, function(error){
if(error){
Helpers.traceError("'setRemoteSessionDescription' error: " + error);
}else{
Helpers.trace("'setRemoteSessionDescription' success");
}
});
} else {
Helpers.traceError("Ignore 'onAccept', PeerConnection is already in 'stable' state");
}
}else{
Helpers.traceError("Ignore 'OnAccept', there is no information about peer connection by some reason.");
}
Expand Down Expand Up @@ -791,7 +794,6 @@ WebRTCSession.prototype._createPeer = function(userID, peerConnectionType) {

var pcConfig = {
iceServers: config.webrtc.iceServers,
offerExtmapAllowMixed: false
};

Helpers.trace("_createPeer, iceServers: " + JSON.stringify(pcConfig));
Expand Down
4 changes: 2 additions & 2 deletions src/qbConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/

var config = {
version: '2.13.9',
buildNumber: '1102',
version: '2.13.10',
buildNumber: '1104',
creds: {
appId: '',
authKey: '',
Expand Down

0 comments on commit 92d8270

Please sign in to comment.