podchat-browser 11.3.3 → 11.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +20 -2
- package/dist/{podchat-11.2.3.js → podchat-11.3.4.js} +945 -808
- package/dist/{podchat-11.2.2.js → podchat-11.4.1.js} +57048 -56947
- package/dist/{podchat-11.2.1.js → podchat-11.4.2.js} +57379 -55481
- package/examples/index.html +63 -5
- package/package.json +3 -3
- package/src/call.module.js +289 -317
- package/src/chat.js +60 -20
- package/config.js +0 -59
- package/dist/podchat-10.14.11.js +0 -71188
- package/dist/podchat-10.14.12.js +0 -71188
- package/dist/podchat-11.1.0.js +0 -72792
|
@@ -56228,7 +56228,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56228
56228
|
|
|
56229
56229
|
|
|
56230
56230
|
var Utility = params.Utility,
|
|
56231
|
-
|
|
56231
|
+
currentModuleInstance = this,
|
|
56232
56232
|
Sentry = params.Sentry,
|
|
56233
56233
|
asyncClient = params.asyncClient,
|
|
56234
56234
|
chatEvents = params.chatEvents,
|
|
@@ -56341,6 +56341,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56341
56341
|
START_SCREEN_SHARE: 123,
|
|
56342
56342
|
END_SCREEN_SHARE: 124,
|
|
56343
56343
|
DELETE_FROM_CALL_HISTORY: 125,
|
|
56344
|
+
DESTINATED_RECORD_CALL: 126,
|
|
56344
56345
|
MUTUAL_GROUPS: 130,
|
|
56345
56346
|
CREATE_TAG: 140,
|
|
56346
56347
|
EDIT_TAG: 141,
|
|
@@ -56349,6 +56350,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56349
56350
|
REMOVE_TAG_PARTICIPANT: 144,
|
|
56350
56351
|
GET_TAG_LIST: 145,
|
|
56351
56352
|
DELETE_MESSAGE_THREAD: 151,
|
|
56353
|
+
EXPORT_CHAT: 152,
|
|
56352
56354
|
ERROR: 999
|
|
56353
56355
|
},
|
|
56354
56356
|
inviteeVOidTypes = {
|
|
@@ -56400,20 +56402,25 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56400
56402
|
currentCallId = null,
|
|
56401
56403
|
shouldReconnectCallTimeout = null,
|
|
56402
56404
|
callTopics = {},
|
|
56405
|
+
screenShareState = {
|
|
56406
|
+
started: false,
|
|
56407
|
+
imOwner: false
|
|
56408
|
+
},
|
|
56403
56409
|
callClientType = {
|
|
56404
56410
|
WEB: 1,
|
|
56405
56411
|
ANDROID: 2,
|
|
56406
56412
|
DESKTOP: 3
|
|
56407
56413
|
},
|
|
56408
56414
|
webpeers = {},
|
|
56415
|
+
callUsers = {},
|
|
56409
56416
|
webpeersMetadata = {},
|
|
56410
56417
|
callRequestController = {
|
|
56411
56418
|
callRequestReceived: false,
|
|
56412
56419
|
callEstablishedInMySide: false,
|
|
56413
56420
|
iCanAcceptTheCall: function () {
|
|
56414
56421
|
return callRequestController.callRequestReceived && callRequestController.callEstablishedInMySide;
|
|
56415
|
-
|
|
56416
|
-
|
|
56422
|
+
},
|
|
56423
|
+
cameraPaused: true
|
|
56417
56424
|
},
|
|
56418
56425
|
uiRemoteMedias = {},
|
|
56419
56426
|
callStopQueue = {
|
|
@@ -56647,7 +56654,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56647
56654
|
},
|
|
56648
56655
|
|
|
56649
56656
|
endCall = function (params, callback) {
|
|
56650
|
-
consoleLogging && console.log('endCall called...');
|
|
56657
|
+
consoleLogging && console.log('[SDK][endCall] called...');
|
|
56651
56658
|
|
|
56652
56659
|
var endCallData = {
|
|
56653
56660
|
chatMessageVOType: chatMessageVOTypes.END_CALL_REQUEST,
|
|
@@ -56686,6 +56693,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56686
56693
|
}
|
|
56687
56694
|
});
|
|
56688
56695
|
},
|
|
56696
|
+
|
|
56689
56697
|
/*
|
|
56690
56698
|
* Call Functionalities
|
|
56691
56699
|
*/
|
|
@@ -56693,21 +56701,31 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56693
56701
|
if (callDivId) {
|
|
56694
56702
|
var callParentDiv,
|
|
56695
56703
|
callVideo = (typeof params.video === 'boolean') ? params.video : true,
|
|
56696
|
-
callMute = (typeof params.mute === 'boolean') ? params.mute : false
|
|
56697
|
-
sendingTopic = params.sendingTopic,
|
|
56698
|
-
receiveTopic = params.receiveTopic;
|
|
56704
|
+
callMute = (typeof params.mute === 'boolean') ? params.mute : false;
|
|
56705
|
+
//sendingTopic = params.sendingTopic,
|
|
56706
|
+
//receiveTopic = params.receiveTopic;
|
|
56707
|
+
|
|
56708
|
+
if(params.clientsList && params.clientsList.length) {
|
|
56709
|
+
for(var i in params.clientsList) {
|
|
56710
|
+
callStateController.setupCallParticipant(params.clientsList[i]);
|
|
56711
|
+
//callStateController.callUsers.push(params.clientsList[i]);
|
|
56712
|
+
}
|
|
56713
|
+
}
|
|
56714
|
+
|
|
56715
|
+
callStateController.setupScreenSharingObject(params.screenShare);
|
|
56699
56716
|
|
|
56700
|
-
callTopics['sendVideoTopic'] = 'Vi-' + sendingTopic;
|
|
56717
|
+
/*callTopics['sendVideoTopic'] = 'Vi-' + sendingTopic;
|
|
56701
56718
|
callTopics['sendAudioTopic'] = 'Vo-' + sendingTopic;
|
|
56719
|
+
callTopics['screenShare'] = params.screenShare;
|
|
56702
56720
|
//callTopics['receiveVideoTopic'] = 'Vi-' + receiveTopic;
|
|
56703
56721
|
//callTopics['receiveAudioTopic'] = 'Vo-' + receiveTopic;
|
|
56704
56722
|
callTopics['receive'] = [];
|
|
56705
56723
|
callTopics['receive'].push({
|
|
56706
56724
|
"VideoTopic": 'Vi-' + receiveTopic,
|
|
56707
56725
|
"AudioTopic": 'Vo-' + receiveTopic
|
|
56708
|
-
})
|
|
56726
|
+
});*/
|
|
56709
56727
|
|
|
56710
|
-
webpeersMetadata[callTopics['sendVideoTopic']] = {
|
|
56728
|
+
/*webpeersMetadata[callTopics['sendVideoTopic']] = {
|
|
56711
56729
|
interval: null,
|
|
56712
56730
|
receivedSdpAnswer: false,
|
|
56713
56731
|
connectionQualityInterval: null,
|
|
@@ -56723,6 +56741,14 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56723
56741
|
poorConnectionResolvedCount: 0,
|
|
56724
56742
|
isConnectionPoor: false
|
|
56725
56743
|
};
|
|
56744
|
+
webpeersMetadata[callTopics['screenShare']] = {
|
|
56745
|
+
interval: null,
|
|
56746
|
+
receivedSdpAnswer: false,
|
|
56747
|
+
connectionQualityInterval: null,
|
|
56748
|
+
poorConnectionCount: 0,
|
|
56749
|
+
poorConnectionResolvedCount: 0,
|
|
56750
|
+
isConnectionPoor: false
|
|
56751
|
+
};
|
|
56726
56752
|
|
|
56727
56753
|
for(var i in callTopics['receive']) {
|
|
56728
56754
|
webpeersMetadata[callTopics['receive'][i]['VideoTopic']] = {
|
|
@@ -56733,11 +56759,11 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56733
56759
|
interval: null,
|
|
56734
56760
|
receivedSdpAnswer: false
|
|
56735
56761
|
};
|
|
56736
|
-
}
|
|
56762
|
+
}*/
|
|
56737
56763
|
|
|
56738
|
-
callParentDiv = document.getElementById(callDivId);
|
|
56764
|
+
//callParentDiv = document.getElementById(callDivId);
|
|
56739
56765
|
|
|
56740
|
-
|
|
56766
|
+
/*// Local Video Tag
|
|
56741
56767
|
if (callVideo && !uiRemoteMedias[callTopics['sendVideoTopic']]) {
|
|
56742
56768
|
uiRemoteMedias[callTopics['sendVideoTopic']] = document.createElement('video');
|
|
56743
56769
|
var el = uiRemoteMedias[callTopics['sendVideoTopic']];
|
|
@@ -56783,19 +56809,13 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56783
56809
|
callMute && el.setAttribute('muted', '');
|
|
56784
56810
|
el.setAttribute('controls', '');
|
|
56785
56811
|
}
|
|
56786
|
-
}
|
|
56812
|
+
}*/
|
|
56787
56813
|
|
|
56788
|
-
|
|
56789
|
-
for(var i in callTopics['receive']) {
|
|
56790
|
-
/*uiRemoteElements.push(uiRemoteMedias[callTopics['receive'][i]['AudioTopic']])
|
|
56791
|
-
callVideo && uiRemoteElements.push(uiRemoteMedias[callTopics['receive'][i]['VideoTopic']])*/
|
|
56814
|
+
callback && callback(generateCallUIList());
|
|
56792
56815
|
|
|
56793
|
-
|
|
56794
|
-
|
|
56795
|
-
|
|
56796
|
-
uiRemoteVideo: callVideo && uiRemoteMedias[callTopics['receive'][i]['VideoTopic']]
|
|
56797
|
-
}
|
|
56798
|
-
)
|
|
56816
|
+
/*for(var i in callTopics['receive']) {
|
|
56817
|
+
uiRemoteElements.push(uiRemoteMedias[callTopics['receive'][i]['AudioTopic']])
|
|
56818
|
+
callVideo && uiRemoteElements.push(uiRemoteMedias[callTopics['receive'][i]['VideoTopic']])
|
|
56799
56819
|
}
|
|
56800
56820
|
|
|
56801
56821
|
if (callParentDiv) {
|
|
@@ -56814,18 +56834,19 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56814
56834
|
'uiLocalVideo': uiRemoteMedias[callTopics['sendVideoTopic']],
|
|
56815
56835
|
'uiLocalAudio': uiRemoteMedias[callTopics['sendAudioTopic']],
|
|
56816
56836
|
uiRemoteElements: uiRemoteElements
|
|
56817
|
-
|
|
56818
|
-
'uiRemoteAudio': uiRemoteMedias[callTopics['receiveAudioTopic']]
|
|
56837
|
+
/!* 'uiRemoteVideo': uiRemoteMedias[callTopics['receiveVideoTopic']],
|
|
56838
|
+
'uiRemoteAudio': uiRemoteMedias[callTopics['receiveAudioTopic']]*!/
|
|
56819
56839
|
});
|
|
56820
56840
|
} else {
|
|
56821
56841
|
callback && callback({
|
|
56822
56842
|
'uiLocalVideo': uiRemoteMedias[callTopics['sendVideoTopic']],
|
|
56823
56843
|
'uiLocalAudio': uiRemoteMedias[callTopics['sendAudioTopic']],
|
|
56824
56844
|
uiRemoteElements: uiRemoteElements
|
|
56825
|
-
|
|
56826
|
-
'uiRemoteAudio': uiRemoteMedias[callTopics['receiveAudioTopic']]
|
|
56845
|
+
/!*'uiRemoteVideo': uiRemoteMedias[callTopics['receiveVideoTopic']],
|
|
56846
|
+
'uiRemoteAudio': uiRemoteMedias[callTopics['receiveAudioTopic']]*!/
|
|
56827
56847
|
});
|
|
56828
|
-
}
|
|
56848
|
+
}*/
|
|
56849
|
+
|
|
56829
56850
|
|
|
56830
56851
|
callStateController.createSessionInChat(Object.assign(params, {
|
|
56831
56852
|
callVideo: callVideo,
|
|
@@ -56850,29 +56871,26 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56850
56871
|
}
|
|
56851
56872
|
},
|
|
56852
56873
|
|
|
56853
|
-
|
|
56854
|
-
|
|
56855
|
-
|
|
56856
|
-
|
|
56857
|
-
|
|
56858
|
-
|
|
56859
|
-
|
|
56860
|
-
|
|
56861
|
-
}, function (res) {
|
|
56862
|
-
if (res.done === 'TRUE') {
|
|
56863
|
-
callStopQueue.callStarted = true;
|
|
56864
|
-
generateAndSendSdpOffers(params, [callTopics['sendVideoTopic'], callTopics['receiveVideoTopic'], callTopics['sendAudioTopic'], callTopics['receiveAudioTopic']]);
|
|
56865
|
-
} else if (res.done === 'SKIP') {
|
|
56866
|
-
callStopQueue.callStarted = true;
|
|
56867
|
-
generateAndSendSdpOffers(params, [callTopics['sendVideoTopic'], callTopics['receiveVideoTopic'], callTopics['sendAudioTopic'], callTopics['receiveAudioTopic']]);
|
|
56868
|
-
} else {
|
|
56869
|
-
consoleLogging && console.log('CREATE_SESSION faced a problem', res);
|
|
56870
|
-
endCall({
|
|
56871
|
-
callId: currentCallId
|
|
56872
|
-
});
|
|
56874
|
+
generateCallUIList = function () {
|
|
56875
|
+
var me = chatMessaging.userInfo.Id;
|
|
56876
|
+
var callUIElements = {};
|
|
56877
|
+
for(var i in callUsers) {
|
|
56878
|
+
callUIElements[i] = {
|
|
56879
|
+
container: callUsers[i].htmlElements.container,
|
|
56880
|
+
video: callUsers[i].htmlElements[callUsers[i].videoTopicName],
|
|
56881
|
+
audio: callUsers[i].htmlElements[callUsers[i].audioTopicName]
|
|
56873
56882
|
}
|
|
56874
|
-
|
|
56875
|
-
|
|
56883
|
+
|
|
56884
|
+
/* callUIElements[i].container = callUsers[i].htmlElements.container;
|
|
56885
|
+
callUIElements[i].video = callUsers[i].htmlElements[callUsers[i].videoTopicName];
|
|
56886
|
+
callUIElements[i].audio = callUsers[i].htmlElements[callUsers[i].audioTopicName];
|
|
56887
|
+
*/
|
|
56888
|
+
//callUIElements[i] = callUsers[i].htmlElements;
|
|
56889
|
+
}
|
|
56890
|
+
return {
|
|
56891
|
+
uiElements: callUIElements,
|
|
56892
|
+
};
|
|
56893
|
+
},
|
|
56876
56894
|
|
|
56877
56895
|
callStateController = {
|
|
56878
56896
|
createSessionInChat: function (params) {
|
|
@@ -56884,7 +56902,6 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56884
56902
|
brokerAddress: params.brokerAddress,
|
|
56885
56903
|
turnAddress: params.turnAddress.split(',')[0]
|
|
56886
56904
|
}, function (res) {
|
|
56887
|
-
consoleLogging && console.log("createSessionInChat:onresult", res)
|
|
56888
56905
|
if (res.done === 'TRUE') {
|
|
56889
56906
|
callStopQueue.callStarted = true;
|
|
56890
56907
|
callController.startCall(params);
|
|
@@ -56906,18 +56923,144 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56906
56923
|
*/
|
|
56907
56924
|
startCall: function (params) {
|
|
56908
56925
|
var callController = this;
|
|
56909
|
-
|
|
56910
|
-
|
|
56911
|
-
|
|
56912
|
-
|
|
56913
|
-
|
|
56926
|
+
for(var i in callUsers) {
|
|
56927
|
+
if(i === 'screenShare')
|
|
56928
|
+
continue;
|
|
56929
|
+
|
|
56930
|
+
if(callUsers[i].video) {
|
|
56931
|
+
callController.startParticipantVideo(i);
|
|
56932
|
+
}
|
|
56933
|
+
if(!callUsers[i].mute) {
|
|
56934
|
+
callController.startParticipantAudio(i);
|
|
56935
|
+
}
|
|
56936
|
+
/*if (params.callVideo) {
|
|
56937
|
+
callController.startParticipantVideo(i);
|
|
56938
|
+
}*/
|
|
56939
|
+
/*if(params.callAudio) {
|
|
56940
|
+
callController.startParticipantAudio(i);
|
|
56941
|
+
}*/
|
|
56942
|
+
}
|
|
56943
|
+
},
|
|
56944
|
+
setupCallParticipant: function (participant) {
|
|
56945
|
+
var user = participant;
|
|
56946
|
+
user.topicMetaData = {};
|
|
56947
|
+
user.peers = {};
|
|
56948
|
+
if(user.userId === chatMessaging.userInfo.id) {
|
|
56949
|
+
user.direction = 'send';
|
|
56950
|
+
} else {
|
|
56951
|
+
user.direction = 'receive';
|
|
56952
|
+
}
|
|
56953
|
+
user.videoTopicName = 'Vi-' + user.topicSend;
|
|
56954
|
+
user.audioTopicName = 'Vo-' + user.topicSend;
|
|
56955
|
+
user.topicMetaData[user.videoTopicName] = {
|
|
56956
|
+
interval: null,
|
|
56957
|
+
receivedSdpAnswer: false,
|
|
56958
|
+
connectionQualityInterval: null,
|
|
56959
|
+
poorConnectionCount: 0,
|
|
56960
|
+
poorConnectionResolvedCount: 0,
|
|
56961
|
+
isConnectionPoor: false
|
|
56962
|
+
};
|
|
56963
|
+
user.topicMetaData[user.audioTopicName] = {
|
|
56964
|
+
interval: null,
|
|
56965
|
+
receivedSdpAnswer: false,
|
|
56966
|
+
connectionQualityInterval: null,
|
|
56967
|
+
poorConnectionCount: 0,
|
|
56968
|
+
poorConnectionResolvedCount: 0,
|
|
56969
|
+
isConnectionPoor: false
|
|
56970
|
+
};
|
|
56971
|
+
callUsers[user.userId] = user;
|
|
56972
|
+
this.appendUserToCallDiv(user.userId, this.generateHTMLElements(user.userId));
|
|
56973
|
+
},
|
|
56974
|
+
setupScreenSharingObject: function (topic) {
|
|
56975
|
+
var obj = {
|
|
56976
|
+
video: true,
|
|
56977
|
+
};
|
|
56978
|
+
obj.topicMetaData = {};
|
|
56979
|
+
obj.peers = {};
|
|
56980
|
+
if(screenShareState.imOwner) {
|
|
56981
|
+
obj.direction = 'send';
|
|
56982
|
+
} else {
|
|
56983
|
+
obj.direction = 'receive'
|
|
56984
|
+
}
|
|
56985
|
+
obj.videoTopicName = topic;
|
|
56986
|
+
obj.topicMetaData[obj.videoTopicName] = {
|
|
56987
|
+
interval: null,
|
|
56988
|
+
receivedSdpAnswer: false,
|
|
56989
|
+
connectionQualityInterval: null,
|
|
56990
|
+
poorConnectionCount: 0,
|
|
56991
|
+
poorConnectionResolvedCount: 0,
|
|
56992
|
+
isConnectionPoor: false
|
|
56993
|
+
};
|
|
56994
|
+
callUsers['screenShare'] = obj;
|
|
56995
|
+
this.generateHTMLElements('screenShare')
|
|
56996
|
+
},
|
|
56997
|
+
appendUserToCallDiv: function (userId) {
|
|
56998
|
+
if(!callDivId) {
|
|
56999
|
+
consoleLogging && console.log('No Call DIV has been declared!');
|
|
57000
|
+
return;
|
|
57001
|
+
}
|
|
57002
|
+
var user = callUsers[userId]
|
|
57003
|
+
var callParentDiv = document.getElementById(callDivId);
|
|
57004
|
+
if(user.video) {
|
|
57005
|
+
console.log("appendUserToCallDiv1", user, document.getElementById("callParticipantWrapper-" + userId), document.getElementById("uiRemoteVideo-" + user.videoTopicName))
|
|
57006
|
+
if(!document.getElementById("callParticipantWrapper-" + userId)) {
|
|
57007
|
+
if (!document.getElementById("uiRemoteVideo-" + user.videoTopicName)) {
|
|
57008
|
+
user.htmlElements.container.appendChild(user.htmlElements[user.videoTopicName])
|
|
57009
|
+
}
|
|
57010
|
+
}
|
|
57011
|
+
else {
|
|
57012
|
+
document.getElementById("callParticipantWrapper-" + userId).append(user.htmlElements[user.videoTopicName])
|
|
57013
|
+
}
|
|
57014
|
+
}
|
|
57015
|
+
if(typeof user.mute !== "undefined" && !user.mute){
|
|
57016
|
+
if(!document.getElementById("callParticipantWrapper-" + userId)) {
|
|
57017
|
+
if(!document.getElementById("uiRemoteAudio-" + user.videoTopicName)) {
|
|
57018
|
+
user.htmlElements.container.appendChild(user.htmlElements[user.audioTopicName])
|
|
57019
|
+
}
|
|
57020
|
+
} else {
|
|
57021
|
+
document.getElementById("callParticipantWrapper-" + userId).append(user.htmlElements[user.audioTopicName])
|
|
57022
|
+
}
|
|
57023
|
+
}
|
|
57024
|
+
|
|
57025
|
+
if(!document.getElementById("callParticipantWrapper-" + userId))
|
|
57026
|
+
callParentDiv.appendChild(user.htmlElements.container);
|
|
57027
|
+
},
|
|
57028
|
+
generateHTMLElements: function (userId) {
|
|
57029
|
+
var user = callUsers[userId]
|
|
57030
|
+
if(!user.htmlElements) {
|
|
57031
|
+
user.htmlElements = {
|
|
57032
|
+
container: document.createElement('div')
|
|
57033
|
+
};
|
|
57034
|
+
var el = user.htmlElements.container;
|
|
57035
|
+
el.setAttribute('id', 'callParticipantWrapper-' + userId);
|
|
57036
|
+
el.classList.add('participant');
|
|
57037
|
+
el.classList.add('wrapper');
|
|
57038
|
+
el.classList.add('user-' + userId);
|
|
57039
|
+
el.classList.add((userId === chatMessaging.userInfo.id ? 'local' : 'remote'));
|
|
56914
57040
|
}
|
|
56915
|
-
|
|
56916
|
-
|
|
56917
|
-
|
|
56918
|
-
|
|
56919
|
-
|
|
57041
|
+
|
|
57042
|
+
if (user.video && !user.htmlElements[user.videoTopicName]) {
|
|
57043
|
+
user.htmlElements[user.videoTopicName] = document.createElement('video');
|
|
57044
|
+
var el = user.htmlElements[user.videoTopicName];
|
|
57045
|
+
el.setAttribute('id', 'uiRemoteVideo-' + user.videoTopicName);
|
|
57046
|
+
el.setAttribute('class', callVideoTagClassName);
|
|
57047
|
+
el.setAttribute('playsinline', '');
|
|
57048
|
+
el.setAttribute('muted', '');
|
|
57049
|
+
el.setAttribute('width', callVideoMinWidth + 'px');
|
|
57050
|
+
el.setAttribute('height', callVideoMinHeight + 'px');
|
|
56920
57051
|
}
|
|
57052
|
+
|
|
57053
|
+
if (typeof user.mute !== 'undefined' && !user.mute && !user.htmlElements[user.audioTopicName]) {
|
|
57054
|
+
user.htmlElements[user.audioTopicName] = document.createElement('audio');
|
|
57055
|
+
var el = user.htmlElements[user.audioTopicName];
|
|
57056
|
+
el.setAttribute('id', 'uiRemoteAudio-' + user.audioTopicName);
|
|
57057
|
+
el.setAttribute('class', callAudioTagClassName);
|
|
57058
|
+
el.setAttribute('autoplay', '');
|
|
57059
|
+
el.setAttribute('muted', '');
|
|
57060
|
+
el.setAttribute('controls', '');
|
|
57061
|
+
}
|
|
57062
|
+
|
|
57063
|
+
return user.htmlElements;
|
|
56921
57064
|
},
|
|
56922
57065
|
/**
|
|
56923
57066
|
* When call started we can add participants
|
|
@@ -56943,50 +57086,39 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56943
57086
|
return;
|
|
56944
57087
|
}
|
|
56945
57088
|
},
|
|
56946
|
-
|
|
56947
|
-
this.removeTopic(
|
|
56948
|
-
},
|
|
56949
|
-
startMyAudio: function () {
|
|
56950
|
-
this.createTopic(callTopics['sendAudioTopic'], 'audio', 'send');
|
|
56951
|
-
},
|
|
56952
|
-
stopParticipantAudio: function (topic) {
|
|
56953
|
-
this.removeTopic(topic);
|
|
57089
|
+
stopParticipantAudio: function (userId) {
|
|
57090
|
+
this.removeTopic(userId, callUsers[userId].peers[userId].audioTopicName);
|
|
56954
57091
|
},
|
|
56955
|
-
startParticipantAudio: function (
|
|
56956
|
-
this.createTopic(
|
|
57092
|
+
startParticipantAudio: function (userId) {
|
|
57093
|
+
this.createTopic(userId, callUsers[userId].audioTopicName, 'audio', callUsers[userId].direction);
|
|
56957
57094
|
},
|
|
56958
|
-
|
|
56959
|
-
this.removeTopic(
|
|
57095
|
+
stopParticipantVideo: function (userId) {
|
|
57096
|
+
this.removeTopic(userId, callUsers[userId].peers[userId].videoTopicName);
|
|
56960
57097
|
},
|
|
56961
|
-
|
|
56962
|
-
this.createTopic(
|
|
57098
|
+
startParticipantVideo: function (userId) {
|
|
57099
|
+
this.createTopic(userId, callUsers[userId].videoTopicName, 'video', callUsers[userId].direction);
|
|
56963
57100
|
},
|
|
56964
|
-
|
|
56965
|
-
|
|
56966
|
-
|
|
56967
|
-
|
|
56968
|
-
this.createTopic(topic, 'video', 'receive');
|
|
56969
|
-
},
|
|
56970
|
-
createTopic: function (topic, mediaType, direction, shareScreen) {
|
|
57101
|
+
createTopic: function (userId, topic, mediaType, direction, shareScreen) {
|
|
57102
|
+
if(callUsers[userId] && callUsers[userId].peers[topic]) {
|
|
57103
|
+
return;
|
|
57104
|
+
}
|
|
56971
57105
|
shareScreen = typeof shareScreen !== 'undefined' ? shareScreen : false;
|
|
56972
|
-
this.getSdpOfferOptions(topic, mediaType, direction, shareScreen).then(function (options){
|
|
56973
|
-
callStateController.generateTopicPeer(topic, mediaType, direction, options);
|
|
57106
|
+
this.getSdpOfferOptions(userId, topic, mediaType, direction, shareScreen).then(function (options){
|
|
57107
|
+
callStateController.generateTopicPeer(userId, topic, mediaType, direction, options);
|
|
56974
57108
|
});
|
|
56975
57109
|
},
|
|
56976
|
-
removeTopic: function (topic) {
|
|
56977
|
-
|
|
56978
|
-
|
|
56979
|
-
|
|
56980
|
-
|
|
56981
|
-
webpeers[i] = null;
|
|
56982
|
-
}
|
|
57110
|
+
removeTopic: function (userId, topic) {
|
|
57111
|
+
if(callUsers[userId].peers[topic]) {
|
|
57112
|
+
this.removeConnectionQualityInterval(userId, topic);
|
|
57113
|
+
callUsers[userId].peers[topic].dispose();
|
|
57114
|
+
callUsers[userId].peers[topic] = null;
|
|
56983
57115
|
}
|
|
56984
57116
|
},
|
|
56985
|
-
getSdpOfferOptions: function (topic, mediaType, direction, shareScreen) {
|
|
57117
|
+
getSdpOfferOptions: function (userId, topic, mediaType, direction, shareScreen) {
|
|
56986
57118
|
return new Promise(function (resolve, reject) {
|
|
56987
57119
|
var mediaConstraints = {audio: (mediaType === 'audio'), video: (mediaType === 'video')};
|
|
56988
57120
|
|
|
56989
|
-
if(direction === 'send') {
|
|
57121
|
+
if(direction === 'send' && mediaType === 'video') {
|
|
56990
57122
|
mediaConstraints.video = {
|
|
56991
57123
|
width: callVideoMinWidth,
|
|
56992
57124
|
height: callVideoMinHeight,
|
|
@@ -56998,13 +57130,13 @@ WildEmitter.mixin(WildEmitter);
|
|
|
56998
57130
|
mediaConstraints: mediaConstraints,
|
|
56999
57131
|
iceTransportPolicy: 'relay',
|
|
57000
57132
|
onicecandidate: (candidate) => {
|
|
57001
|
-
if (
|
|
57002
|
-
clearInterval(
|
|
57133
|
+
if (callUsers[userId].topicMetaData[topic].interval !== null) {
|
|
57134
|
+
clearInterval(callUsers[userId].topicMetaData[topic].interval);
|
|
57003
57135
|
}
|
|
57004
|
-
|
|
57005
|
-
if (
|
|
57006
|
-
|
|
57007
|
-
clearInterval(
|
|
57136
|
+
callUsers[userId].topicMetaData[topic].interval = setInterval(function () {
|
|
57137
|
+
if (callUsers[userId].topicMetaData[topic].sdpAnswerReceived === true) {
|
|
57138
|
+
callUsers[userId].topicMetaData[topic].sdpAnswerReceived = false;
|
|
57139
|
+
clearInterval(callUsers[userId].topicMetaData[topic].interval);
|
|
57008
57140
|
sendCallMessage({
|
|
57009
57141
|
id: 'ADD_ICE_CANDIDATE',
|
|
57010
57142
|
topic: topic,
|
|
@@ -57017,7 +57149,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57017
57149
|
iceServers: callStateController.getTurnServer(currentCallParams)
|
|
57018
57150
|
}
|
|
57019
57151
|
};
|
|
57020
|
-
|
|
57152
|
+
|
|
57153
|
+
options[(direction === 'send' ? 'localVideo' : 'remoteVideo')] = callUsers[userId].htmlElements[topic];
|
|
57021
57154
|
|
|
57022
57155
|
if(direction === 'send' && mediaType === 'video' && shareScreen) {
|
|
57023
57156
|
navigator.mediaDevices.getDisplayMedia().then(function (result) {
|
|
@@ -57026,9 +57159,9 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57026
57159
|
// options[(direction === 'send' ? 'localVideo' : 'remoteVideo')] = uiRemoteMedias[topic];
|
|
57027
57160
|
resolve(options);
|
|
57028
57161
|
}).catch(function (error) {
|
|
57029
|
-
console.
|
|
57162
|
+
console.error("[SDK][navigator.mediaDevices.getDisplayMedia]", error);
|
|
57030
57163
|
explainUserMediaError(error, 'video', 'screen');
|
|
57031
|
-
resolve(options);
|
|
57164
|
+
//resolve(options);
|
|
57032
57165
|
});
|
|
57033
57166
|
} else {
|
|
57034
57167
|
resolve(options);
|
|
@@ -57057,100 +57190,26 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57057
57190
|
];
|
|
57058
57191
|
}
|
|
57059
57192
|
},
|
|
57060
|
-
|
|
57061
|
-
|
|
57062
|
-
|
|
57063
|
-
|
|
57064
|
-
webpeers[topic].peerConnection.onconnectionstatechange = function () {
|
|
57065
|
-
console.log("on connection state change, ", "peer: ", topic, "peerConnection.connectionState: ", webpeers[topic].peerConnection.connectionState);
|
|
57066
|
-
if (webpeers[topic].peerConnection.connectionState === 'disconnected') {
|
|
57067
|
-
console.log(topic, 'peerConnection.onconnectionstatechange: disconnected');
|
|
57068
|
-
|
|
57069
|
-
callController.removeConnectionQualityInterval(topic);
|
|
57070
|
-
}
|
|
57071
|
-
|
|
57072
|
-
if (webpeers[topic].peerConnection.connectionState === "failed") {
|
|
57073
|
-
chatEvents.fireEvent('callEvents', {
|
|
57074
|
-
type: 'CALL_STATUS',
|
|
57075
|
-
errorCode: 7000,
|
|
57076
|
-
errorMessage: `Call Peer (${topic}) has failed!`,
|
|
57077
|
-
errorInfo: webpeers[topic]
|
|
57078
|
-
});
|
|
57079
|
-
setTimeout(function () {
|
|
57080
|
-
if(chatMessaging.chatState) {
|
|
57081
|
-
callController.shouldReconnectTopic(topic, mediaType, direction);
|
|
57082
|
-
}
|
|
57083
|
-
}, 7000);
|
|
57084
|
-
|
|
57085
|
-
callController.removeConnectionQualityInterval(topic);
|
|
57086
|
-
}
|
|
57087
|
-
|
|
57088
|
-
if(webpeers[topic].peerConnection.connectionState === 'connected') {
|
|
57089
|
-
if(mediaType === 'video' && direction === 'send') {
|
|
57090
|
-
webpeersMetadata[topic]['connectionQualityInterval'] = setInterval(function() {
|
|
57091
|
-
callController.checkConnectionQuality(topic, mediaType, direction)
|
|
57092
|
-
}, 1000);
|
|
57093
|
-
}
|
|
57094
|
-
}
|
|
57095
|
-
}
|
|
57096
|
-
|
|
57097
|
-
webpeers[topic].peerConnection.oniceconnectionstatechange = function () {
|
|
57098
|
-
console.log("on ice connection state change: ", topic, webpeers[topic].peerConnection.iceConnectionState);
|
|
57099
|
-
if (webpeers[topic].peerConnection.iceConnectionState === 'disconnected') {
|
|
57100
|
-
console.log(topic, 'peerConnection.oniceconnectionstatechange disconnected');
|
|
57101
|
-
chatEvents.fireEvent('callEvents', {
|
|
57102
|
-
type: 'CALL_STATUS',
|
|
57103
|
-
errorCode: 7000,
|
|
57104
|
-
errorMessage: `Call Peer (${topic}) is disconnected!`,
|
|
57105
|
-
errorInfo: webpeers[topic]
|
|
57106
|
-
});
|
|
57107
|
-
|
|
57108
|
-
console.log('Internet connection failed, Reconnect your call, topic:', topic);
|
|
57109
|
-
}
|
|
57110
|
-
|
|
57111
|
-
if (webpeers[topic].peerConnection.iceConnectionState === "failed") {
|
|
57112
|
-
chatEvents.fireEvent('callEvents', {
|
|
57113
|
-
type: 'CALL_STATUS',
|
|
57114
|
-
errorCode: 7000,
|
|
57115
|
-
errorMessage: `Call Peer (${topic}) has failed!`,
|
|
57116
|
-
errorInfo: webpeers[topic]
|
|
57117
|
-
});
|
|
57118
|
-
if(chatMessaging.chatState) {
|
|
57119
|
-
callController.shouldReconnectTopic(topic, mediaType, direction);
|
|
57120
|
-
} else {
|
|
57121
|
-
setTimeout(function () {
|
|
57122
|
-
if(chatMessaging.chatState) {
|
|
57123
|
-
callController.shouldReconnectTopic(topic, mediaType, direction);
|
|
57124
|
-
}
|
|
57125
|
-
}, 7000);
|
|
57126
|
-
}
|
|
57127
|
-
}
|
|
57128
|
-
|
|
57129
|
-
if (webpeers[topic].peerConnection.iceConnectionState === "connected") {
|
|
57130
|
-
callRequestController.callEstablishedInMySide = true;
|
|
57131
|
-
chatEvents.fireEvent('callEvents', {
|
|
57132
|
-
type: 'CALL_STATUS',
|
|
57133
|
-
errorCode: 7000,
|
|
57134
|
-
errorMessage: `Call Peer (${topic}) has connected!`,
|
|
57135
|
-
errorInfo: webpeers[topic]
|
|
57136
|
-
});
|
|
57137
|
-
}
|
|
57193
|
+
checkConnectionQuality: function (userId, topic) {
|
|
57194
|
+
if(!callUsers[userId] || !callUsers[userId].peers[topic] || !callUsers[userId].peers[topic].peerConnection) {
|
|
57195
|
+
callStateController.removeConnectionQualityInterval(userId, topic);
|
|
57196
|
+
return;
|
|
57138
57197
|
}
|
|
57139
|
-
|
|
57140
|
-
checkConnectionQuality: function (topic) {
|
|
57141
|
-
webpeers[topic].peerConnection.getStats(null).then(stats => {
|
|
57198
|
+
callUsers[userId].peers[topic].peerConnection.getStats(null).then(stats => {
|
|
57142
57199
|
//console.log(' watchRTCPeerConnection:: window.setInterval then(stats:', stats)
|
|
57143
57200
|
//let statsOutput = "";
|
|
57201
|
+
var user = callUsers[userId],
|
|
57202
|
+
userMetadata = user.topicMetaData[topic]
|
|
57144
57203
|
|
|
57145
57204
|
stats.forEach(report => {
|
|
57146
57205
|
if(report && report.type && report.type === 'remote-inbound-rtp') {
|
|
57147
|
-
|
|
57148
|
-
|
|
57206
|
+
/*statsOutput += `<h2>Report: ${report.type}</h2>\n<strong>ID:</strong> ${report.id}<br>\n` +
|
|
57207
|
+
`<strong>Timestamp:</strong> ${report.timestamp}<br>\n`;*/
|
|
57149
57208
|
|
|
57150
57209
|
// Now the statistics for this report; we intentially drop the ones we
|
|
57151
57210
|
// sorted to the top above
|
|
57152
57211
|
if(!report['roundTripTime'] || report['roundTripTime'] > 1) {
|
|
57153
|
-
if(
|
|
57212
|
+
if(userMetadata.poorConnectionCount === 10) {
|
|
57154
57213
|
chatEvents.fireEvent('callEvents', {
|
|
57155
57214
|
type: 'POOR_VIDEO_CONNECTION',
|
|
57156
57215
|
subType: 'LONG_TIME',
|
|
@@ -57161,29 +57220,30 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57161
57220
|
}
|
|
57162
57221
|
});
|
|
57163
57222
|
}
|
|
57164
|
-
if(
|
|
57223
|
+
if(userMetadata.poorConnectionCount > 3 && !userMetadata.isConnectionPoor) {
|
|
57165
57224
|
//alert('Poor connection detected...');
|
|
57166
|
-
consoleLogging && console.log('Poor connection detected...');
|
|
57225
|
+
consoleLogging && console.log('[SDK][checkConnectionQuality] Poor connection detected...');
|
|
57167
57226
|
chatEvents.fireEvent('callEvents', {
|
|
57168
57227
|
type: 'POOR_VIDEO_CONNECTION',
|
|
57169
57228
|
subType: 'SHORT_TIME',
|
|
57170
57229
|
message: 'Poor connection detected',
|
|
57171
57230
|
metadata: {
|
|
57172
57231
|
elementId: "uiRemoteVideo-" + topic,
|
|
57173
|
-
topic: topic
|
|
57232
|
+
topic: topic,
|
|
57233
|
+
userId: userId
|
|
57174
57234
|
}
|
|
57175
57235
|
});
|
|
57176
|
-
|
|
57177
|
-
|
|
57178
|
-
|
|
57236
|
+
userMetadata.isConnectionPoor = true;
|
|
57237
|
+
userMetadata.poorConnectionCount = 0;
|
|
57238
|
+
userMetadata.poorConnectionResolvedCount = 0;
|
|
57179
57239
|
} else {
|
|
57180
|
-
|
|
57240
|
+
callUsers[userId].topicMetaData[topic].poorConnectionCount++;
|
|
57181
57241
|
}
|
|
57182
57242
|
} else if(report['roundTripTime'] || report['roundTripTime'] < 1) {
|
|
57183
|
-
if(
|
|
57184
|
-
|
|
57185
|
-
|
|
57186
|
-
|
|
57243
|
+
if(userMetadata.poorConnectionResolvedCount > 3 && userMetadata.isConnectionPoor) {
|
|
57244
|
+
userMetadata.poorConnectionResolvedCount = 0;
|
|
57245
|
+
userMetadata.poorConnectionCount = 0;
|
|
57246
|
+
userMetadata.isConnectionPoor = false;
|
|
57187
57247
|
chatEvents.fireEvent('callEvents', {
|
|
57188
57248
|
type: 'POOR_VIDEO_CONNECTION_RESOLVED',
|
|
57189
57249
|
message: 'Poor connection resolved',
|
|
@@ -57193,7 +57253,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57193
57253
|
}
|
|
57194
57254
|
});
|
|
57195
57255
|
} else {
|
|
57196
|
-
|
|
57256
|
+
userMetadata.poorConnectionResolvedCount++;
|
|
57197
57257
|
}
|
|
57198
57258
|
}
|
|
57199
57259
|
|
|
@@ -57208,72 +57268,35 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57208
57268
|
//document.querySelector(".stats-box").innerHTML = statsOutput;
|
|
57209
57269
|
});
|
|
57210
57270
|
},
|
|
57211
|
-
|
|
57212
|
-
//isConnectionPoor
|
|
57213
|
-
webpeersMetadata[topic]['poorConnectionCount'] = 0;
|
|
57214
|
-
clearInterval(webpeersMetadata[topic]['connectionQualityInterval']);
|
|
57215
|
-
},
|
|
57216
|
-
shouldReconnectTopic: function (topic, mediaType, direction) {
|
|
57217
|
-
var callController = this;
|
|
57218
|
-
if (currentCallParams && Object.keys(currentCallParams).length) {
|
|
57219
|
-
if (webpeers[topic].peerConnection.iceConnectionState != 'connected') {
|
|
57220
|
-
chatEvents.fireEvent('callEvents', {
|
|
57221
|
-
type: 'CALL_STATUS',
|
|
57222
|
-
errorCode: 7000,
|
|
57223
|
-
errorMessage: `Call Peer (${topic}) is not in connected state, Restarting call in progress ...!`,
|
|
57224
|
-
errorInfo: webpeers[topic]
|
|
57225
|
-
});
|
|
57226
|
-
|
|
57227
|
-
sendCallMessage({
|
|
57228
|
-
id: 'STOP',
|
|
57229
|
-
topic: topic
|
|
57230
|
-
}, function (result) {
|
|
57231
|
-
if (result.done === 'TRUE') {
|
|
57232
|
-
//handleCallSocketOpen(currentCallParams);
|
|
57233
|
-
/*webpeers[topic].dispose();
|
|
57234
|
-
webpeers[topic] = null;*/
|
|
57235
|
-
callController.removeTopic(topic);
|
|
57236
|
-
callController.createTopic(topic, mediaType, direction);
|
|
57237
|
-
//generateAndSendSdpOffers(currentCallParams, [topicName]);
|
|
57238
|
-
} else if (result.done === 'SKIP') {
|
|
57239
|
-
//handleCallSocketOpen(currentCallParams);
|
|
57240
|
-
/*webpeers[topic].dispose();
|
|
57241
|
-
webpeers[topic] = null;*/
|
|
57242
|
-
callController.removeTopic(topic);
|
|
57243
|
-
callController.createTopic(topic, mediaType, direction);
|
|
57244
|
-
//generateAndSendSdpOffers(currentCallParams, [topicName]);
|
|
57245
|
-
} else {
|
|
57246
|
-
consoleLogging && console.log('STOP topic faced a problem', result);
|
|
57247
|
-
endCall({
|
|
57248
|
-
callId: currentCallId
|
|
57249
|
-
});
|
|
57250
|
-
callStop();
|
|
57251
|
-
}
|
|
57252
|
-
});
|
|
57253
|
-
}
|
|
57254
|
-
}
|
|
57255
|
-
},
|
|
57256
|
-
generateTopicPeer: function (topic, mediaType, direction, options) {
|
|
57271
|
+
generateTopicPeer: function (userId, topic, mediaType, direction, options) {
|
|
57257
57272
|
var WebRtcFunction = direction === 'send' ? 'WebRtcPeerSendonly' : 'WebRtcPeerRecvonly',
|
|
57258
|
-
|
|
57273
|
+
callController = this,
|
|
57274
|
+
user = callUsers[userId],
|
|
57275
|
+
topicElement = user.htmlElements[topic],
|
|
57276
|
+
topicMetaData = user.topicMetaData[topic];
|
|
57259
57277
|
|
|
57260
|
-
|
|
57278
|
+
callUsers[userId].peers[topic] = new KurentoUtils.WebRtcPeer[WebRtcFunction](options, function (err) {
|
|
57261
57279
|
if (err) {
|
|
57262
57280
|
console.error("[SDK][start/webRtc " + direction + " " + mediaType + " Peer] Error: " + explainUserMediaError(err, mediaType));
|
|
57263
57281
|
return;
|
|
57264
57282
|
}
|
|
57265
57283
|
|
|
57266
|
-
callController.watchRTCPeerConnection(topic, mediaType, direction);
|
|
57284
|
+
callController.watchRTCPeerConnection(userId, topic, mediaType, direction);
|
|
57267
57285
|
|
|
57268
|
-
if(direction === 'send')
|
|
57269
|
-
startMedia(
|
|
57286
|
+
if(direction === 'send') {
|
|
57287
|
+
startMedia(topicElement);
|
|
57288
|
+
if(callRequestController.cameraPaused) {
|
|
57289
|
+
currentModuleInstance.pauseCamera();
|
|
57290
|
+
}
|
|
57291
|
+
}
|
|
57270
57292
|
|
|
57271
|
-
|
|
57293
|
+
callUsers[userId].peers[topic].generateOffer((err, sdpOffer) => {
|
|
57272
57294
|
if (err) {
|
|
57273
57295
|
console.error("[SDK][start/WebRc " + direction + " " + mediaType + " Peer/generateOffer] " + err);
|
|
57274
57296
|
return;
|
|
57275
57297
|
}
|
|
57276
57298
|
|
|
57299
|
+
sdpOffer = callController.setMediaBitrates(sdpOffer);
|
|
57277
57300
|
sendCallMessage({
|
|
57278
57301
|
id: (direction === 'send' ? 'SEND_SDP_OFFER' : 'RECIVE_SDP_OFFER'),
|
|
57279
57302
|
sdpOffer: sdpOffer,
|
|
@@ -57284,456 +57307,331 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57284
57307
|
});
|
|
57285
57308
|
});
|
|
57286
57309
|
});
|
|
57287
|
-
}
|
|
57288
|
-
|
|
57289
|
-
|
|
57290
|
-
|
|
57291
|
-
|
|
57292
|
-
if (currentCallParams && Object.keys(currentCallParams).length) {
|
|
57293
|
-
if (webpeers[topic] && webpeers[topic].peerConnection.iceConnectionState != 'connected') {
|
|
57294
|
-
|
|
57295
|
-
chatEvents.fireEvent('callEvents', {
|
|
57296
|
-
type: 'CALL_STATUS',
|
|
57297
|
-
errorCode: 7000,
|
|
57298
|
-
errorMessage: `Call Peer (${topic}) is not in connected state, Restarting call in progress ...!`,
|
|
57299
|
-
errorInfo: webpeers[topic]
|
|
57300
|
-
});
|
|
57301
|
-
|
|
57302
|
-
sendCallMessage({
|
|
57303
|
-
id: 'STOP',
|
|
57304
|
-
topic: topic
|
|
57305
|
-
}, function (result) {
|
|
57306
|
-
if (result.done === 'TRUE') {
|
|
57307
|
-
//handleCallSocketOpen(currentCallParams);
|
|
57308
|
-
/!*webpeers[topic].dispose();
|
|
57309
|
-
webpeers[topic] = null;*!/
|
|
57310
|
-
generateAndSendSdpOffers(currentCallParams, [topic]);
|
|
57311
|
-
|
|
57312
|
-
} else if (result.done === 'SKIP') {
|
|
57313
|
-
//handleCallSocketOpen(currentCallParams);
|
|
57314
|
-
/!*webpeers[topic].dispose();
|
|
57315
|
-
webpeers[topic] = null;*!/
|
|
57316
|
-
generateAndSendSdpOffers(currentCallParams, [topic]);
|
|
57317
|
-
} else {
|
|
57318
|
-
consoleLogging && console.log('STOP topic faced a problem', result);
|
|
57319
|
-
endCall({
|
|
57320
|
-
callId: currentCallId
|
|
57321
|
-
});
|
|
57322
|
-
callStop();
|
|
57323
|
-
}
|
|
57324
|
-
});
|
|
57325
|
-
}
|
|
57326
|
-
}
|
|
57327
|
-
},
|
|
57328
|
-
|
|
57329
|
-
generateAndSendSdpOffers = function (params, topics) {
|
|
57330
|
-
var turnServers = [];
|
|
57310
|
+
},
|
|
57311
|
+
watchRTCPeerConnection: function (userId, topic, mediaType, direction) {
|
|
57312
|
+
consoleLogging && console.log("[SDK][watchRTCPeerConnection] called with: ", userId, topic, mediaType, direction);
|
|
57313
|
+
var callController = this,
|
|
57314
|
+
user = callUsers[userId];
|
|
57331
57315
|
|
|
57332
|
-
|
|
57333
|
-
var serversTemp = params.turnAddress.split(',');
|
|
57316
|
+
consoleLogging && console.log("[SDK][watchRTCPeerConnection] called with: ", callUsers, user);
|
|
57334
57317
|
|
|
57335
|
-
|
|
57336
|
-
|
|
57337
|
-
|
|
57338
|
-
"urls": "turn:" + serversTemp[0],
|
|
57339
|
-
"username": "mkhorrami",
|
|
57340
|
-
"credential": "mkh_123456"
|
|
57318
|
+
user.peers[topic].peerConnection.onconnectionstatechange = function () {
|
|
57319
|
+
if(!user || !user.peers || !user.peers[topic]) {
|
|
57320
|
+
return; //avoid log errors
|
|
57341
57321
|
}
|
|
57342
|
-
|
|
57343
|
-
|
|
57344
|
-
|
|
57345
|
-
//{"urls": "stun:" + callTurnIp + ":3478"},
|
|
57346
|
-
{
|
|
57347
|
-
"urls": "turn:" + callTurnIp + ":3478",
|
|
57348
|
-
"username": "mkhorrami",
|
|
57349
|
-
"credential": "mkh_123456"
|
|
57322
|
+
consoleLogging && console.log("[SDK][peerConnection.onconnectionstatechange] ", "peer: ", topic, " peerConnection.connectionState: ", user.peers[topic].peerConnection.connectionState);
|
|
57323
|
+
if (user.peers[topic].peerConnection.connectionState === 'disconnected') {
|
|
57324
|
+
callController.removeConnectionQualityInterval(userId, topic);
|
|
57350
57325
|
}
|
|
57351
|
-
];
|
|
57352
|
-
}
|
|
57353
57326
|
|
|
57354
|
-
|
|
57355
|
-
|
|
57356
|
-
|
|
57357
|
-
|
|
57358
|
-
|
|
57359
|
-
|
|
57360
|
-
|
|
57361
|
-
|
|
57362
|
-
if (webpeersMetadata[callTopics['receiveVideoTopic']].interval !== null) {
|
|
57363
|
-
clearInterval(webpeersMetadata[callTopics['receiveVideoTopic']].interval);
|
|
57364
|
-
}
|
|
57365
|
-
webpeersMetadata[callTopics['receiveVideoTopic']].interval = setInterval(function () {
|
|
57366
|
-
if (webpeersMetadata[callTopics['receiveVideoTopic']].sdpAnswerReceived === true) {
|
|
57367
|
-
webpeersMetadata[callTopics['receiveVideoTopic']].sdpAnswerReceived = false;
|
|
57368
|
-
clearInterval(webpeersMetadata[callTopics['receiveVideoTopic']].interval);
|
|
57369
|
-
sendCallMessage({
|
|
57370
|
-
id: 'ADD_ICE_CANDIDATE',
|
|
57371
|
-
topic: callTopics['receiveVideoTopic'],
|
|
57372
|
-
candidateDto: candidate
|
|
57373
|
-
})
|
|
57374
|
-
}
|
|
57375
|
-
}, 500, {candidate: candidate});
|
|
57376
|
-
},
|
|
57377
|
-
configuration: {
|
|
57378
|
-
iceServers: turnServers
|
|
57379
|
-
}
|
|
57380
|
-
};
|
|
57381
|
-
|
|
57382
|
-
webpeers[callTopics['receiveVideoTopic']] = new KurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(receiveVideoOptions, function (err) {
|
|
57383
|
-
if (err) {
|
|
57384
|
-
console.error("[start/webRtcReceiveVideoPeer] Error: " + explainUserMediaError(err, 'video'));
|
|
57385
|
-
return;
|
|
57386
|
-
}
|
|
57387
|
-
|
|
57388
|
-
watchRTCPeerConnection(callTopics['receiveVideoTopic']);
|
|
57389
|
-
|
|
57390
|
-
webpeers[callTopics['receiveVideoTopic']].generateOffer((err, sdpOffer) => {
|
|
57391
|
-
if (err) {
|
|
57392
|
-
console.error("[start/WebRtcVideoPeerReceiveOnly/generateOffer] " + err);
|
|
57393
|
-
return;
|
|
57394
|
-
}
|
|
57395
|
-
|
|
57396
|
-
sendCallMessage({
|
|
57397
|
-
id: 'RECIVE_SDP_OFFER',
|
|
57398
|
-
sdpOffer: sdpOffer,
|
|
57399
|
-
useComedia: true,
|
|
57400
|
-
useSrtp: false,
|
|
57401
|
-
topic: callTopics['receiveVideoTopic'],
|
|
57402
|
-
mediaType: 2
|
|
57403
|
-
});
|
|
57404
|
-
});
|
|
57405
|
-
});
|
|
57406
|
-
}
|
|
57407
|
-
|
|
57408
|
-
if(topics.indexOf(callTopics['sendVideoTopic']) !== -1) {
|
|
57409
|
-
const sendVideoOptions = {
|
|
57410
|
-
localVideo: uiRemoteMedias[callTopics['sendVideoTopic']],
|
|
57411
|
-
mediaConstraints: {
|
|
57412
|
-
audio: false,
|
|
57413
|
-
video: {
|
|
57414
|
-
width: callVideoMinWidth,
|
|
57415
|
-
height: callVideoMinHeight,
|
|
57416
|
-
framerate: 15
|
|
57417
|
-
}
|
|
57418
|
-
},
|
|
57419
|
-
iceTransportPolicy: 'relay',
|
|
57420
|
-
onicecandidate: (candidate) => {
|
|
57421
|
-
if (webpeersMetadata[callTopics['sendVideoTopic']].interval !== null) {
|
|
57422
|
-
clearInterval(webpeersMetadata[callTopics['sendVideoTopic']].interval);
|
|
57423
|
-
}
|
|
57424
|
-
webpeersMetadata[callTopics['sendVideoTopic']].interval = setInterval(function () {
|
|
57425
|
-
if (webpeersMetadata[callTopics['sendVideoTopic']].sdpAnswerReceived === true) {
|
|
57426
|
-
webpeersMetadata[callTopics['sendVideoTopic']].sdpAnswerReceived = false;
|
|
57427
|
-
clearInterval(webpeersMetadata[callTopics['sendVideoTopic']].interval);
|
|
57428
|
-
sendCallMessage({
|
|
57429
|
-
id: 'ADD_ICE_CANDIDATE',
|
|
57430
|
-
topic: callTopics['sendVideoTopic'],
|
|
57431
|
-
candidateDto: candidate
|
|
57432
|
-
})
|
|
57433
|
-
}
|
|
57434
|
-
}, 500, {candidate: candidate});
|
|
57435
|
-
|
|
57436
|
-
},
|
|
57437
|
-
configuration: {
|
|
57438
|
-
iceServers: turnServers
|
|
57439
|
-
}
|
|
57440
|
-
};
|
|
57441
|
-
|
|
57442
|
-
setTimeout(function () {
|
|
57443
|
-
webpeers[callTopics['sendVideoTopic']] = new KurentoUtils.WebRtcPeer.WebRtcPeerSendonly(sendVideoOptions, function (err) {
|
|
57444
|
-
if (err) {
|
|
57445
|
-
sendCallSocketError("[start/WebRtcVideoPeerSendOnly] Error: " + explainUserMediaError(err, 'video'));
|
|
57446
|
-
//callStop();
|
|
57447
|
-
return;
|
|
57448
|
-
}
|
|
57449
|
-
|
|
57450
|
-
watchRTCPeerConnection(callTopics['sendVideoTopic']);
|
|
57451
|
-
startMedia(uiRemoteMedias[callTopics['sendVideoTopic']]);
|
|
57452
|
-
|
|
57453
|
-
webpeers[callTopics['sendVideoTopic']].generateOffer((err, sdpOffer) => {
|
|
57454
|
-
if (err) {
|
|
57455
|
-
sendCallSocketError("[start/WebRtcVideoPeerSendOnly/generateOffer] Error: " + err);
|
|
57456
|
-
//callStop();
|
|
57457
|
-
return;
|
|
57458
|
-
}
|
|
57459
|
-
|
|
57460
|
-
sendCallMessage({
|
|
57461
|
-
id: 'SEND_SDP_OFFER',
|
|
57462
|
-
topic: callTopics['sendVideoTopic'],
|
|
57463
|
-
sdpOffer: sdpOffer,
|
|
57464
|
-
mediaType: 2
|
|
57465
|
-
});
|
|
57466
|
-
});
|
|
57467
|
-
});
|
|
57468
|
-
}, 2000);
|
|
57469
|
-
}
|
|
57470
|
-
}
|
|
57471
|
-
|
|
57472
|
-
// Audio Topics
|
|
57473
|
-
if (params.callAudio) {
|
|
57474
|
-
if(topics.indexOf(callTopics['receiveAudioTopic']) !== -1) {
|
|
57475
|
-
const receiveAudioOptions = {
|
|
57476
|
-
remoteVideo: uiRemoteMedias[callTopics['receiveAudioTopic']],
|
|
57477
|
-
mediaConstraints: {audio: true, video: false},
|
|
57478
|
-
iceTransportPolicy: 'relay',
|
|
57479
|
-
onicecandidate: (candidate) => {
|
|
57480
|
-
if (webpeersMetadata[callTopics['receiveAudioTopic']].interval !== null) {
|
|
57481
|
-
clearInterval(webpeersMetadata[callTopics['receiveAudioTopic']].interval);
|
|
57482
|
-
}
|
|
57483
|
-
webpeersMetadata[callTopics['receiveAudioTopic']].interval = setInterval(function () {
|
|
57484
|
-
if (webpeersMetadata[callTopics['receiveAudioTopic']].sdpAnswerReceived === true) {
|
|
57485
|
-
webpeersMetadata[callTopics['receiveAudioTopic']].sdpAnswerReceived = false;
|
|
57486
|
-
clearInterval(webpeersMetadata[callTopics['receiveAudioTopic']].interval);
|
|
57487
|
-
sendCallMessage({
|
|
57488
|
-
id: 'ADD_ICE_CANDIDATE',
|
|
57489
|
-
topic: callTopics['receiveAudioTopic'],
|
|
57490
|
-
candidateDto: candidate,
|
|
57491
|
-
})
|
|
57492
|
-
}
|
|
57493
|
-
}, 500, {candidate: candidate});
|
|
57494
|
-
},
|
|
57495
|
-
configuration: {
|
|
57496
|
-
iceServers: turnServers
|
|
57497
|
-
}
|
|
57498
|
-
};
|
|
57499
|
-
|
|
57500
|
-
webpeers[callTopics['receiveAudioTopic']] = new KurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(receiveAudioOptions, function (err) {
|
|
57501
|
-
if (err) {
|
|
57502
|
-
console.error("[start/WebRtcAudioPeerReceiveOnly] Error: " + explainUserMediaError(err, 'audio'));
|
|
57503
|
-
return;
|
|
57504
|
-
}
|
|
57505
|
-
|
|
57506
|
-
watchRTCPeerConnection(callTopics['receiveAudioTopic']);
|
|
57507
|
-
|
|
57508
|
-
webpeers[callTopics['receiveAudioTopic']].generateOffer((err, sdpOffer) => {
|
|
57509
|
-
if (err) {
|
|
57510
|
-
console.error("[start/WebRtcAudioPeerReceiveOnly/generateOffer] " + err);
|
|
57511
|
-
return;
|
|
57512
|
-
}
|
|
57513
|
-
sendCallMessage({
|
|
57514
|
-
id: 'RECIVE_SDP_OFFER',
|
|
57515
|
-
sdpOffer: sdpOffer,
|
|
57516
|
-
useComedia: false,
|
|
57517
|
-
useSrtp: false,
|
|
57518
|
-
mediaType: 1,
|
|
57519
|
-
topic: callTopics['receiveAudioTopic']
|
|
57520
|
-
});
|
|
57521
|
-
});
|
|
57522
|
-
});
|
|
57523
|
-
}
|
|
57524
|
-
|
|
57525
|
-
if(topics.indexOf(callTopics['sendAudioTopic']) !== -1) {
|
|
57526
|
-
const sendAudioOptions = {
|
|
57527
|
-
localVideo: uiRemoteMedias[callTopics['sendAudioTopic']],
|
|
57528
|
-
mediaConstraints: {audio: true, video: false},
|
|
57529
|
-
iceTransportPolicy: 'relay',
|
|
57530
|
-
onicecandidate: (candidate) => {
|
|
57531
|
-
if (webpeersMetadata[callTopics['sendAudioTopic']].interval !== null) {
|
|
57532
|
-
clearInterval(webpeersMetadata[callTopics['sendAudioTopic']].interval);
|
|
57533
|
-
}
|
|
57534
|
-
webpeersMetadata[callTopics['sendAudioTopic']].interval = setInterval(function () {
|
|
57535
|
-
if (webpeersMetadata[callTopics['sendAudioTopic']].sdpAnswerReceived === true) {
|
|
57536
|
-
webpeersMetadata[callTopics['sendAudioTopic']].sdpAnswerReceived = false;
|
|
57537
|
-
clearInterval(webpeersMetadata[callTopics['sendAudioTopic']].interval);
|
|
57538
|
-
sendCallMessage({
|
|
57539
|
-
id: 'ADD_ICE_CANDIDATE',
|
|
57540
|
-
topic: callTopics['sendAudioTopic'],
|
|
57541
|
-
candidateDto: candidate,
|
|
57542
|
-
})
|
|
57543
|
-
}
|
|
57544
|
-
}, 500, {candidate: candidate});
|
|
57545
|
-
},
|
|
57546
|
-
configuration: {
|
|
57547
|
-
iceServers: turnServers
|
|
57548
|
-
}
|
|
57549
|
-
};
|
|
57550
|
-
|
|
57551
|
-
setTimeout(function () {
|
|
57552
|
-
webpeers[callTopics['sendAudioTopic']] = new KurentoUtils.WebRtcPeer.WebRtcPeerSendonly(sendAudioOptions, function (err) {
|
|
57553
|
-
if (err) {
|
|
57554
|
-
sendCallSocketError("[start/WebRtcAudioPeerSendOnly] Error: " + explainUserMediaError(err, 'audio'));
|
|
57555
|
-
//callStop();
|
|
57556
|
-
return;
|
|
57557
|
-
}
|
|
57558
|
-
watchRTCPeerConnection(callTopics['sendAudioTopic']);
|
|
57559
|
-
startMedia(uiRemoteMedias[callTopics['sendAudioTopic']]);
|
|
57560
|
-
|
|
57561
|
-
webpeers[callTopics['sendAudioTopic']].generateOffer((err, sdpOffer) => {
|
|
57562
|
-
if (err) {
|
|
57563
|
-
sendCallSocketError("[start/WebRtcAudioPeerSendOnly/generateOffer] Error: " + err);
|
|
57564
|
-
//callStop();
|
|
57565
|
-
return;
|
|
57566
|
-
}
|
|
57567
|
-
sendCallMessage({
|
|
57568
|
-
id: 'SEND_SDP_OFFER',
|
|
57569
|
-
topic: callTopics['sendAudioTopic'],
|
|
57570
|
-
sdpOffer: sdpOffer,
|
|
57571
|
-
mediaType: 1
|
|
57572
|
-
});
|
|
57573
|
-
});
|
|
57574
|
-
});
|
|
57575
|
-
}, 2000);
|
|
57576
|
-
}
|
|
57577
|
-
}
|
|
57578
|
-
|
|
57579
|
-
/!*setTimeout(function () {
|
|
57580
|
-
for (var peer in webpeers) {
|
|
57581
|
-
console.log("set callback on webpeers: ", peer);
|
|
57582
|
-
if (webpeers[peer]) {
|
|
57583
|
-
webpeers[peer].peerConnection.onconnectionstatechange = function () {
|
|
57584
|
-
console.log("on connection state change, ", "peer: ", peer, "peerConnection.connectionState: ", webpeers[peer].peerConnection.connectionState);
|
|
57585
|
-
if (webpeers[peer].peerConnection.connectionState == 'disconnected') {
|
|
57586
|
-
console.log(peer, 'peerConnection.onconnectionstatechange: disconnected');
|
|
57587
|
-
}
|
|
57588
|
-
}
|
|
57589
|
-
|
|
57590
|
-
webpeers[peer].peerConnection.oniceconnectionstatechange = function () {
|
|
57591
|
-
console.log("on ice connection state change: ", peer, webpeers[peer].peerConnection.connectionState);
|
|
57592
|
-
if (webpeers[peer].peerConnection.iceConnectionState == 'disconnected') {
|
|
57593
|
-
console.log( peer , '>>>>>>>>>>>>> disconnected');
|
|
57594
|
-
chatEvents.fireEvent('callEvents', {
|
|
57595
|
-
type: 'CALL_STATUS',
|
|
57596
|
-
errorCode: 7000,
|
|
57597
|
-
errorMessage: `Call Peer (${peer}) is disconnected!`,
|
|
57598
|
-
errorInfo: webpeers[peer]
|
|
57599
|
-
});
|
|
57600
|
-
|
|
57601
|
-
setTimeout(function () {
|
|
57602
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57603
|
-
}, 2000);
|
|
57604
|
-
|
|
57605
|
-
setTimeout(function () {
|
|
57606
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57607
|
-
}, 6000);
|
|
57608
|
-
|
|
57609
|
-
alert('Internet connection failed, Reconnect your call');
|
|
57610
|
-
/!*shouldReconnectCallTimeout && clearTimeout(shouldReconnectCallTimeout);
|
|
57611
|
-
shouldReconnectCallTimeout = setTimeout(function () {
|
|
57612
|
-
shouldReconnectCall();
|
|
57613
|
-
}, 7000);*!/
|
|
57614
|
-
}
|
|
57615
|
-
|
|
57616
|
-
if (webpeers[peer].peerConnection.iceConnectionState === "failed") {
|
|
57617
|
-
chatEvents.fireEvent('callEvents', {
|
|
57618
|
-
type: 'CALL_STATUS',
|
|
57619
|
-
errorCode: 7000,
|
|
57620
|
-
errorMessage: `Call Peer (${peer}) has failed!`,
|
|
57621
|
-
errorInfo: webpeers[peer]
|
|
57622
|
-
});
|
|
57623
|
-
}
|
|
57624
|
-
|
|
57625
|
-
if (webpeers[peer].peerConnection.iceConnectionState === "connected") {
|
|
57626
|
-
chatEvents.fireEvent('callEvents', {
|
|
57627
|
-
type: 'CALL_STATUS',
|
|
57628
|
-
errorCode: 7000,
|
|
57629
|
-
errorMessage: `Call Peer (${peer}) has connected!`,
|
|
57630
|
-
errorInfo: webpeers[peer]
|
|
57631
|
-
});
|
|
57327
|
+
if (user.peers[topic].peerConnection.connectionState === "failed") {
|
|
57328
|
+
chatEvents.fireEvent('callEvents', {
|
|
57329
|
+
type: 'CALL_STATUS',
|
|
57330
|
+
errorCode: 7000,
|
|
57331
|
+
errorMessage: `Call Peer (${topic}) has failed!`,
|
|
57332
|
+
errorInfo: user.peers[topic]
|
|
57333
|
+
});
|
|
57334
|
+
// setTimeout(function () {
|
|
57632
57335
|
|
|
57633
|
-
|
|
57634
|
-
|
|
57635
|
-
|
|
57336
|
+
if(chatMessaging.chatState) {
|
|
57337
|
+
callController.shouldReconnectTopic(userId, topic, mediaType, direction);
|
|
57338
|
+
}
|
|
57339
|
+
// }, 7000);
|
|
57340
|
+
//callController.removeConnectionQualityInterval(userId, topic);
|
|
57341
|
+
}
|
|
57636
57342
|
|
|
57637
|
-
|
|
57638
|
-
|
|
57639
|
-
|
|
57640
|
-
|
|
57343
|
+
if(user.peers[topic].peerConnection.connectionState === 'connected') {
|
|
57344
|
+
if(mediaType === 'video' && direction === 'send') {
|
|
57345
|
+
user.topicMetaData[topic].connectionQualityInterval = setInterval(function() {
|
|
57346
|
+
callController.checkConnectionQuality(userId, topic, mediaType, direction)
|
|
57347
|
+
}, 1000);
|
|
57641
57348
|
}
|
|
57642
57349
|
}
|
|
57643
57350
|
}
|
|
57644
|
-
}, 6000);*!/
|
|
57645
|
-
|
|
57646
|
-
setTimeout(function () {
|
|
57647
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57648
|
-
}, 4000);
|
|
57649
|
-
setTimeout(function () {
|
|
57650
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57651
|
-
}, 8000);
|
|
57652
|
-
setTimeout(function () {
|
|
57653
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57654
|
-
}, 12000);
|
|
57655
|
-
setTimeout(function () {
|
|
57656
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57657
|
-
}, 20000);
|
|
57658
|
-
},
|
|
57659
57351
|
|
|
57660
|
-
|
|
57661
|
-
|
|
57662
|
-
|
|
57663
|
-
webpeers[topic].peerConnection.onconnectionstatechange = function () {
|
|
57664
|
-
console.log("on connection state change, ", "peer: ", topic, "peerConnection.connectionState: ", webpeers[topic].peerConnection.connectionState);
|
|
57665
|
-
if (webpeers[topic].peerConnection.connectionState == 'disconnected') {
|
|
57666
|
-
console.log(topic, 'peerConnection.onconnectionstatechange: disconnected');
|
|
57352
|
+
user.peers[topic].peerConnection.oniceconnectionstatechange = function () {
|
|
57353
|
+
if(!user || !user.peers || !user.peers[topic]) {
|
|
57354
|
+
return; //avoid log errors
|
|
57667
57355
|
}
|
|
57668
|
-
}
|
|
57669
57356
|
|
|
57670
|
-
|
|
57671
|
-
|
|
57672
|
-
if (webpeers[topic].peerConnection.iceConnectionState == 'disconnected') {
|
|
57673
|
-
console.log(topic, 'peerConnection.oniceconnectionstatechange disconnected');
|
|
57357
|
+
consoleLogging && console.log("[SDK][oniceconnectionstatechange] ", "peer: ", topic, " peerConnection.connectionState: ", user.peers[topic].peerConnection.iceConnectionState);
|
|
57358
|
+
if (user.peers[topic].peerConnection.iceConnectionState === 'disconnected') {
|
|
57674
57359
|
chatEvents.fireEvent('callEvents', {
|
|
57675
57360
|
type: 'CALL_STATUS',
|
|
57676
57361
|
errorCode: 7000,
|
|
57677
57362
|
errorMessage: `Call Peer (${topic}) is disconnected!`,
|
|
57678
|
-
errorInfo:
|
|
57363
|
+
errorInfo: user.peers[topic]
|
|
57679
57364
|
});
|
|
57680
57365
|
|
|
57681
|
-
|
|
57682
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57683
|
-
}, 2000);*!/
|
|
57684
|
-
|
|
57685
|
-
/!*setTimeout(function () {
|
|
57686
|
-
restartMedia(callTopics['sendVideoTopic'])
|
|
57687
|
-
}, 6000);*!/
|
|
57688
|
-
|
|
57689
|
-
console.log('Internet connection failed, Reconnect your call, topic:', topic);
|
|
57690
|
-
//shouldReconnectCallTimeout && clearTimeout(shouldReconnectCallTimeout);
|
|
57691
|
-
/!*shouldReconnectCallTimeout = setTimeout(function () {
|
|
57692
|
-
shouldReconnectCall(topic);
|
|
57693
|
-
}, 7000);*!/
|
|
57366
|
+
consoleLogging && console.log('[SDK][oniceconnectionstatechange]:[disconnected] Internet connection failed, Reconnect your call, topic:', topic);
|
|
57694
57367
|
}
|
|
57695
57368
|
|
|
57696
|
-
if (
|
|
57369
|
+
if (user.peers[topic].peerConnection.iceConnectionState === "failed") {
|
|
57697
57370
|
chatEvents.fireEvent('callEvents', {
|
|
57698
57371
|
type: 'CALL_STATUS',
|
|
57699
57372
|
errorCode: 7000,
|
|
57700
57373
|
errorMessage: `Call Peer (${topic}) has failed!`,
|
|
57701
|
-
errorInfo:
|
|
57374
|
+
errorInfo: user.peers[topic]
|
|
57702
57375
|
});
|
|
57703
|
-
|
|
57704
57376
|
if(chatMessaging.chatState) {
|
|
57705
|
-
|
|
57706
|
-
|
|
57707
|
-
setTimeout(function () {
|
|
57708
|
-
if(chatMessaging.chatState) {
|
|
57709
|
-
shouldReconnectCall(topic);
|
|
57710
|
-
}
|
|
57711
|
-
}, 5000);
|
|
57377
|
+
callController.shouldReconnectTopic(userId, topic, mediaType, direction);
|
|
57378
|
+
//callController.removeConnectionQualityInterval(userId, topic);
|
|
57712
57379
|
}
|
|
57380
|
+
// } else {
|
|
57381
|
+
// setTimeout(function () {
|
|
57382
|
+
// if(chatMessaging.chatState) {
|
|
57383
|
+
// callController.shouldReconnectTopic(userId, topic, mediaType, direction);
|
|
57384
|
+
// }
|
|
57385
|
+
// }, 7000);
|
|
57386
|
+
// }
|
|
57713
57387
|
}
|
|
57714
57388
|
|
|
57715
|
-
if (
|
|
57389
|
+
if (user.peers[topic].peerConnection.iceConnectionState === "connected") {
|
|
57716
57390
|
callRequestController.callEstablishedInMySide = true;
|
|
57717
57391
|
chatEvents.fireEvent('callEvents', {
|
|
57718
57392
|
type: 'CALL_STATUS',
|
|
57719
57393
|
errorCode: 7000,
|
|
57720
57394
|
errorMessage: `Call Peer (${topic}) has connected!`,
|
|
57721
|
-
errorInfo:
|
|
57395
|
+
errorInfo: user.peers[topic]
|
|
57396
|
+
});
|
|
57397
|
+
}
|
|
57398
|
+
}
|
|
57399
|
+
},
|
|
57400
|
+
shouldReconnectTopic: function (userId, topic, mediaType, direction) {
|
|
57401
|
+
var callController = this, iceConnectionState = callUsers[userId].peers[topic].peerConnection.iceConnectionState;
|
|
57402
|
+
if (currentCallParams && Object.keys(currentCallParams).length) {
|
|
57403
|
+
if (callUsers[userId]
|
|
57404
|
+
&& callUsers[userId].peers[topic]
|
|
57405
|
+
&& iceConnectionState != 'connected') {
|
|
57406
|
+
chatEvents.fireEvent('callEvents', {
|
|
57407
|
+
type: 'CALL_STATUS',
|
|
57408
|
+
errorCode: 7000,
|
|
57409
|
+
errorMessage: `Call Peer (${topic}) is not in connected state, Restarting call in progress ...!`,
|
|
57410
|
+
errorInfo: callUsers[userId].peers[topic]
|
|
57722
57411
|
});
|
|
57723
57412
|
|
|
57724
|
-
|
|
57725
|
-
|
|
57726
|
-
|
|
57413
|
+
sendCallMessage({
|
|
57414
|
+
id: 'STOP',
|
|
57415
|
+
topic: topic
|
|
57416
|
+
}, function (result) {
|
|
57417
|
+
if (result.done === 'TRUE') {
|
|
57418
|
+
clearInterval(callUsers[userId].topicMetaData[topic].interval)
|
|
57419
|
+
callController.removeTopic(userId, topic);
|
|
57420
|
+
callController.createTopic(userId, topic, mediaType, direction, userId === 'screenShare');
|
|
57421
|
+
} else if (result.done === 'SKIP') {
|
|
57422
|
+
clearInterval(callUsers[userId].topicMetaData[topic].interval)
|
|
57423
|
+
callController.removeTopic(userId, topic);
|
|
57424
|
+
callController.createTopic(userId, topic, mediaType, direction, userId === 'screenShare');
|
|
57425
|
+
//generateAndSendSdpOffers(currentCallParams, [topicName]);
|
|
57426
|
+
} else {
|
|
57427
|
+
consoleLogging && console.log('STOP topic faced a problem', result);
|
|
57428
|
+
endCall({
|
|
57429
|
+
callId: currentCallId
|
|
57430
|
+
});
|
|
57431
|
+
callStop();
|
|
57432
|
+
}
|
|
57433
|
+
});
|
|
57434
|
+
}
|
|
57435
|
+
}
|
|
57436
|
+
},
|
|
57437
|
+
maybeReconnectAllTopics: function (){
|
|
57438
|
+
if(!callUsers || !Object.keys(callUsers).length || !callRequestController.callEstablishedInMySide)
|
|
57439
|
+
return;
|
|
57727
57440
|
|
|
57728
|
-
|
|
57729
|
-
|
|
57730
|
-
|
|
57441
|
+
for(var i in callUsers) {
|
|
57442
|
+
var videoTopic = callUsers[i].videoTopicName, audioTopic = callUsers[i].audioTopicName;
|
|
57443
|
+
if(callUsers[i] && callUsers[i].peers[videoTopic] && callUsers[i].peers[videoTopic].peerConnection.connectionState === 'failed'){
|
|
57444
|
+
this.shouldReconnectTopic(i, videoTopic, 'video', callUsers[i].direction)
|
|
57445
|
+
}
|
|
57446
|
+
if(callUsers[i] && callUsers[i].peers[audioTopic] && callUsers[i].peers[audioTopic].peerConnection.connectionState === 'failed'){
|
|
57447
|
+
this.shouldReconnectTopic(i, audioTopic, 'audio', callUsers[i].direction)
|
|
57731
57448
|
}
|
|
57732
57449
|
}
|
|
57733
|
-
}
|
|
57450
|
+
},
|
|
57451
|
+
removeConnectionQualityInterval: function (userId, topic) {
|
|
57452
|
+
callUsers[userId].topicMetaData[topic]['poorConnectionCount'] = 0;
|
|
57453
|
+
clearInterval(callUsers[userId].topicMetaData[topic]['connectionQualityInterval']);
|
|
57454
|
+
},
|
|
57455
|
+
removeStreamFromWebRTC : function (userId, topic) {
|
|
57456
|
+
if(callUsers[userId].htmlElements[topic]){
|
|
57457
|
+
const stream = callUsers[userId].htmlElements[topic].srcObject;
|
|
57458
|
+
if (!!stream) {
|
|
57459
|
+
const tracks = stream.getTracks();
|
|
57460
|
+
|
|
57461
|
+
if (!!tracks) {
|
|
57462
|
+
tracks.forEach(function (track) {
|
|
57463
|
+
track.stop();
|
|
57464
|
+
});
|
|
57465
|
+
}
|
|
57466
|
+
|
|
57467
|
+
callUsers[userId].htmlElements[topic].srcObject = null;
|
|
57468
|
+
}
|
|
57469
|
+
|
|
57470
|
+
callUsers[userId].htmlElements[topic].remove();
|
|
57471
|
+
delete (callUsers[userId].htmlElements[topic]);
|
|
57472
|
+
}
|
|
57473
|
+
},
|
|
57474
|
+
addScreenShareToCall: function (direction, shareScreen) {
|
|
57475
|
+
if(direction !== callUsers["screenShare"].direction) {
|
|
57476
|
+
callUsers['screenShare'].direction = direction
|
|
57477
|
+
}
|
|
57478
|
+
var callController = this,
|
|
57479
|
+
screenShare = callUsers["screenShare"];
|
|
57480
|
+
if(!screenShare.peers[screenShare.videoTopicName]) {
|
|
57481
|
+
// Local Video Tag
|
|
57482
|
+
if(!screenShare.htmlElements[screenShare.videoTopicName]) {
|
|
57483
|
+
callStateController.generateHTMLElements('screenShare');
|
|
57484
|
+
}
|
|
57485
|
+
setTimeout(function () {
|
|
57486
|
+
callStateController.appendUserToCallDiv('screenShare');
|
|
57487
|
+
callStateController.createTopic('screenShare', screenShare.videoTopicName, "video", direction, shareScreen);
|
|
57488
|
+
});
|
|
57489
|
+
chatEvents.fireEvent('callEvents', {
|
|
57490
|
+
type: 'CALL_DIVS',
|
|
57491
|
+
result: generateCallUIList()
|
|
57492
|
+
});
|
|
57493
|
+
} else {
|
|
57494
|
+
callStateController.removeTopic('screenShare', screenShare.videoTopicName);
|
|
57495
|
+
callStateController.createTopic('screenShare', screenShare.videoTopicName, "video", direction, shareScreen);
|
|
57496
|
+
startMedia(screenShare.htmlElements[screenShare.videoTopicName])
|
|
57497
|
+
}
|
|
57498
|
+
},
|
|
57499
|
+
removeScreenShareFromCall: function (topic) {
|
|
57500
|
+
var callController = this,
|
|
57501
|
+
screenShare = callUsers["screenShare"];
|
|
57502
|
+
if(screenShare.peers[screenShare.videoTopicName]) {
|
|
57503
|
+
// Local Video Tag
|
|
57504
|
+
|
|
57505
|
+
//removeStreamFromWebRTC(callTopics['screenShare']);
|
|
57506
|
+
callStateController.removeStreamFromWebRTC('screenShare', screenShare.videoTopicName)
|
|
57507
|
+
callStateController.removeTopic('screenShare', screenShare.videoTopicName);
|
|
57508
|
+
chatEvents.fireEvent('callEvents', {
|
|
57509
|
+
type: 'CALL_DIVS',
|
|
57510
|
+
result: generateCallUIList()
|
|
57511
|
+
});
|
|
57512
|
+
}
|
|
57513
|
+
},
|
|
57514
|
+
removeAllCallParticipants: function () {
|
|
57515
|
+
var removeAllUsersPromise = new Promise(function (resolve, reject) {
|
|
57516
|
+
for (var i in callUsers) {
|
|
57517
|
+
var user = callUsers[i];
|
|
57518
|
+
if (user) {
|
|
57519
|
+
if(user.videoTopicName && user.peers[user.videoTopicName]) {
|
|
57520
|
+
clearInterval(callUsers[i].topicMetaData[user.videoTopicName].interval);
|
|
57521
|
+
callStateController.removeConnectionQualityInterval(i, user.videoTopicName);
|
|
57522
|
+
callStateController.removeStreamFromWebRTC(i, user.videoTopicName);
|
|
57523
|
+
callUsers[i].peers[user.videoTopicName].dispose();
|
|
57524
|
+
delete callUsers[i].peers[user.videoTopicName];
|
|
57525
|
+
|
|
57526
|
+
}
|
|
57527
|
+
if(user.audioTopicName && user.peers[user.audioTopicName]) {
|
|
57528
|
+
clearInterval(callUsers[i].topicMetaData[user.audioTopicName].interval);
|
|
57529
|
+
callStateController.removeConnectionQualityInterval(i, user.audioTopicName);
|
|
57530
|
+
callStateController.removeStreamFromWebRTC(i, user.audioTopicName);
|
|
57531
|
+
|
|
57532
|
+
callUsers[i].peers[user.audioTopicName].dispose();
|
|
57533
|
+
delete callUsers[i].peers[user.audioTopicName];
|
|
57534
|
+
}
|
|
57535
|
+
setTimeout(function (){
|
|
57536
|
+
if(callUsers[i]){
|
|
57537
|
+
callUsers[i].peers = {};
|
|
57538
|
+
callUsers[i].topicMetaData = {};
|
|
57539
|
+
callUsers[i].htmlElements = {};
|
|
57540
|
+
callUsers[i] = null;
|
|
57541
|
+
}
|
|
57542
|
+
|
|
57543
|
+
resolve()
|
|
57544
|
+
}, 200);
|
|
57545
|
+
}
|
|
57546
|
+
}
|
|
57547
|
+
});
|
|
57548
|
+
|
|
57549
|
+
removeAllUsersPromise.then(function (){
|
|
57550
|
+
callUsers = {};
|
|
57551
|
+
});
|
|
57552
|
+
},
|
|
57553
|
+
removeFromCallUI: function (topic) {
|
|
57554
|
+
var videoElement = 'Vi-' + topic,
|
|
57555
|
+
audioElement = 'Vo-' + topic,
|
|
57556
|
+
userId = this.findUserIdByTopic(videoElement);
|
|
57557
|
+
|
|
57558
|
+
if (topic.length > 0 && callUsers[userId].htmlElements[videoElement]) {
|
|
57559
|
+
this.removeStreamFromWebRTC(userId,videoElement);
|
|
57560
|
+
}
|
|
57561
|
+
|
|
57562
|
+
if (topic.length > 0 && callUsers[userId].htmlElements[videoElement]) {
|
|
57563
|
+
this.removeStreamFromWebRTC(userId, audioElement);
|
|
57564
|
+
}
|
|
57565
|
+
},
|
|
57566
|
+
findUserIdByTopic: function (topic) {
|
|
57567
|
+
for(var i in callUsers) {
|
|
57568
|
+
if (callUsers[i].videoTopicName === topic || callUsers[i].audioTopicName === topic) {
|
|
57569
|
+
//peer = callUsers[i].peers[jsonMessage.topic];
|
|
57570
|
+
return i;
|
|
57571
|
+
}
|
|
57572
|
+
}
|
|
57573
|
+
},
|
|
57574
|
+
activateParticipantStream: function (userId, mediaType, direction, topicNameKey, sendTopic, mediaKey) {
|
|
57575
|
+
if(callUsers[userId]) {
|
|
57576
|
+
callUsers[userId][mediaKey] = (mediaKey !== 'mute');
|
|
57577
|
+
callUsers[userId][topicNameKey] = (mediaType === 'audio'? 'Vo-': 'Vi-') + sendTopic;
|
|
57578
|
+
|
|
57579
|
+
var user = callUsers[userId];
|
|
57580
|
+
callStateController.appendUserToCallDiv(userId, callStateController.generateHTMLElements(userId));
|
|
57581
|
+
setTimeout(function () {
|
|
57582
|
+
callStateController.createTopic(userId, user[topicNameKey], mediaType, direction);
|
|
57583
|
+
})
|
|
57584
|
+
}
|
|
57585
|
+
},
|
|
57586
|
+
deactivateParticipantStream: function (userId, topicNameKey, mediaKey) {
|
|
57587
|
+
callUsers[userId][mediaKey] = false;
|
|
57588
|
+
var user = callUsers[userId];
|
|
57589
|
+
clearInterval(callUsers[userId].topicMetaData[user[topicNameKey]].interval)
|
|
57590
|
+
callStateController.removeTopic(userId, user[topicNameKey]);
|
|
57591
|
+
callStateController.removeStreamFromWebRTC(userId, user[topicNameKey]);
|
|
57592
|
+
},
|
|
57593
|
+
setMediaBitrates: function (sdp) {
|
|
57594
|
+
return this.setMediaBitrate(this.setMediaBitrate(sdp, "video", 400), "audio", 50);
|
|
57595
|
+
},
|
|
57596
|
+
setMediaBitrate: function (sdp, media, bitrate) {
|
|
57597
|
+
var lines = sdp.split("\n");
|
|
57598
|
+
var line = -1;
|
|
57599
|
+
for (var i = 0; i < lines.length; i++) {
|
|
57600
|
+
if (lines[i].indexOf("m=" + media) === 0) {
|
|
57601
|
+
line = i;
|
|
57602
|
+
break;
|
|
57603
|
+
}
|
|
57604
|
+
}
|
|
57605
|
+
if (line === -1) {
|
|
57606
|
+
consoleLogging && console.debug("[SDK][setMediaBitrate] Could not find the m line for", media);
|
|
57607
|
+
return sdp;
|
|
57608
|
+
}
|
|
57609
|
+
consoleLogging && console.debug("[SDK][setMediaBitrate] Found the m line for", media, "at line", line);
|
|
57610
|
+
|
|
57611
|
+
// Pass the m line
|
|
57612
|
+
line++;
|
|
57613
|
+
|
|
57614
|
+
// Skip i and c lines
|
|
57615
|
+
/* while (lines[line].indexOf("i=") === 0 || lines[line].indexOf("c=") === 0) {
|
|
57616
|
+
line++;
|
|
57617
|
+
}*/
|
|
57734
57618
|
|
|
57619
|
+
// If we're on a b line, replace it
|
|
57620
|
+
if (lines[line].indexOf("b") === 0) {
|
|
57621
|
+
consoleLogging && console.debug("[SDK][setMediaBitrate] Replaced b line at line", line);
|
|
57622
|
+
lines[line] = "b=AS:" + bitrate;
|
|
57623
|
+
return lines.join("\n");
|
|
57624
|
+
}
|
|
57625
|
+
|
|
57626
|
+
// Add a new b line
|
|
57627
|
+
consoleLogging && console.debug("[SDK][setMediaBitrate] Adding new b line before line", line);
|
|
57628
|
+
var newLines = lines.slice(0, line);
|
|
57629
|
+
newLines.push("b=AS:" + bitrate + "\r");
|
|
57630
|
+
newLines = newLines.concat(lines.slice(line, lines.length));
|
|
57631
|
+
consoleLogging && console.debug("[SDK][setMediaBitrate] output: ", newLines.join("\n"));
|
|
57632
|
+
return newLines.join("\n")
|
|
57633
|
+
},
|
|
57735
57634
|
},
|
|
57736
|
-
*/
|
|
57737
57635
|
|
|
57738
57636
|
sendCallSocketError = function (message) {
|
|
57739
57637
|
chatEvents.fireEvent('callEvents', {
|
|
@@ -57813,19 +57711,19 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57813
57711
|
},
|
|
57814
57712
|
|
|
57815
57713
|
startMedia = function (media) {
|
|
57816
|
-
consoleLogging && console.log("startMedia
|
|
57714
|
+
consoleLogging && console.log("[SDK][startMedia] called with: ", media);
|
|
57817
57715
|
media.play().catch((err) => {
|
|
57818
57716
|
if (err.name === 'NotAllowedError') {
|
|
57819
57717
|
chatEvents.fireEvent('callEvents', {
|
|
57820
57718
|
type: 'CALL_ERROR',
|
|
57821
57719
|
code: 7000,
|
|
57822
|
-
message: "[
|
|
57720
|
+
message: "[startMedia] Browser doesn't allow playing media: " + err
|
|
57823
57721
|
});
|
|
57824
57722
|
} else {
|
|
57825
57723
|
chatEvents.fireEvent('callEvents', {
|
|
57826
57724
|
type: 'CALL_ERROR',
|
|
57827
57725
|
code: 7000,
|
|
57828
|
-
message: "[
|
|
57726
|
+
message: "[startMedia] Error in media.play(): " + err
|
|
57829
57727
|
});
|
|
57830
57728
|
}
|
|
57831
57729
|
});
|
|
@@ -57833,9 +57731,9 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57833
57731
|
|
|
57834
57732
|
restartMedia = function (videoTopicParam) {
|
|
57835
57733
|
if (currentCallParams && Object.keys(currentCallParams).length) {
|
|
57836
|
-
consoleLogging && console.log('Sending Key Frame ...');
|
|
57734
|
+
consoleLogging && console.log('[SDK] Sending Key Frame ...');
|
|
57837
57735
|
|
|
57838
|
-
var videoTopic = !!videoTopicParam ? videoTopicParam : callTopics['sendVideoTopic'];
|
|
57736
|
+
var videoTopic = !!videoTopicParam ? videoTopicParam : callUsers[chatMessaging.userInfo.id].videoTopicName;//callTopics['sendVideoTopic'];
|
|
57839
57737
|
let videoElement = document.getElementById(`uiRemoteVideo-${videoTopic}`);
|
|
57840
57738
|
|
|
57841
57739
|
if (videoElement) {
|
|
@@ -57889,19 +57787,20 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57889
57787
|
},
|
|
57890
57788
|
|
|
57891
57789
|
handleProcessSdpAnswer = function (jsonMessage) {
|
|
57892
|
-
|
|
57790
|
+
var userId = callStateController.findUserIdByTopic(jsonMessage.topic),
|
|
57791
|
+
peer = callUsers[userId].peers[jsonMessage.topic];
|
|
57893
57792
|
|
|
57894
|
-
if (
|
|
57793
|
+
if (peer == null) {
|
|
57895
57794
|
chatEvents.fireEvent('callEvents', {
|
|
57896
57795
|
type: 'CALL_ERROR',
|
|
57897
57796
|
code: 7000,
|
|
57898
57797
|
message: "[handleProcessSdpAnswer] Skip, no WebRTC Peer",
|
|
57899
|
-
error:
|
|
57798
|
+
error: peer
|
|
57900
57799
|
});
|
|
57901
57800
|
return;
|
|
57902
57801
|
}
|
|
57903
57802
|
|
|
57904
|
-
|
|
57803
|
+
peer.processAnswer(jsonMessage.sdpAnswer, (err) => {
|
|
57905
57804
|
if (err) {
|
|
57906
57805
|
sendCallSocketError("[handleProcessSdpAnswer] Error: " + err);
|
|
57907
57806
|
|
|
@@ -57914,26 +57813,35 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57914
57813
|
return;
|
|
57915
57814
|
}
|
|
57916
57815
|
|
|
57917
|
-
if (
|
|
57918
|
-
|
|
57816
|
+
if (callUsers[userId].topicMetaData[jsonMessage.topic].interval !== null) {
|
|
57817
|
+
callUsers[userId].topicMetaData[jsonMessage.topic].sdpAnswerReceived = true;
|
|
57818
|
+
}
|
|
57819
|
+
consoleLogging && console.log("[SDK][handleProcessSdpAnswer]", jsonMessage, jsonMessage.topic)
|
|
57820
|
+
startMedia(callUsers[userId].htmlElements[jsonMessage.topic]);
|
|
57821
|
+
if(userId === 'screenShare') {
|
|
57822
|
+
restartMediaOnKeyFrame("screenShare", 2000);
|
|
57823
|
+
restartMediaOnKeyFrame("screenShare", 4000);
|
|
57824
|
+
restartMediaOnKeyFrame("screenShare", 8000);
|
|
57825
|
+
restartMediaOnKeyFrame("screenShare", 12000);
|
|
57919
57826
|
}
|
|
57920
|
-
startMedia(uiRemoteMedias[jsonMessage.topic]);
|
|
57921
57827
|
});
|
|
57922
57828
|
},
|
|
57923
57829
|
|
|
57924
57830
|
handleAddIceCandidate = function (jsonMessage) {
|
|
57925
|
-
|
|
57926
|
-
|
|
57831
|
+
var userId = callStateController.findUserIdByTopic(jsonMessage.topic);
|
|
57832
|
+
|
|
57833
|
+
let peer = callUsers[userId].peers[jsonMessage.topic];
|
|
57834
|
+
if (peer == null) {
|
|
57927
57835
|
chatEvents.fireEvent('callEvents', {
|
|
57928
57836
|
type: 'CALL_ERROR',
|
|
57929
57837
|
code: 7000,
|
|
57930
57838
|
message: "[handleAddIceCandidate] Skip, no WebRTC Peer",
|
|
57931
|
-
error: JSON.stringify(
|
|
57839
|
+
error: JSON.stringify(peer)
|
|
57932
57840
|
});
|
|
57933
57841
|
return;
|
|
57934
57842
|
}
|
|
57935
57843
|
|
|
57936
|
-
|
|
57844
|
+
peer.addIceCandidate(jsonMessage.candidate, (err) => {
|
|
57937
57845
|
if (err) {
|
|
57938
57846
|
console.error("[handleAddIceCandidate] " + err);
|
|
57939
57847
|
|
|
@@ -57972,19 +57880,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57972
57880
|
},
|
|
57973
57881
|
|
|
57974
57882
|
callStop = function () {
|
|
57975
|
-
|
|
57976
|
-
|
|
57977
|
-
for (var media in uiRemoteMedias) {
|
|
57978
|
-
removeStreamFromWebRTC(media);
|
|
57979
|
-
}
|
|
57980
|
-
|
|
57981
|
-
for (var i in webpeers) {
|
|
57982
|
-
if (webpeers[i]) {
|
|
57983
|
-
callStateController.removeConnectionQualityInterval(i);
|
|
57984
|
-
webpeers[i].dispose();
|
|
57985
|
-
webpeers[i] = null;
|
|
57986
|
-
}
|
|
57987
|
-
}
|
|
57883
|
+
callStateController.removeAllCallParticipants();
|
|
57988
57884
|
|
|
57989
57885
|
if (callStopQueue.callStarted) {
|
|
57990
57886
|
sendCallMessage({
|
|
@@ -57993,45 +57889,56 @@ WildEmitter.mixin(WildEmitter);
|
|
|
57993
57889
|
callStopQueue.callStarted = false;
|
|
57994
57890
|
}
|
|
57995
57891
|
|
|
57892
|
+
callRequestController.cameraPaused = false;
|
|
57996
57893
|
callRequestController.callEstablishedInMySide = false;
|
|
57997
57894
|
callRequestController.callRequestReceived = false;
|
|
57998
57895
|
currentCallParams = {};
|
|
57999
57896
|
currentCallId = null;
|
|
58000
57897
|
},
|
|
58001
57898
|
|
|
58002
|
-
|
|
58003
|
-
|
|
57899
|
+
/*
|
|
57900
|
+
removeStreamFromWebRTC = function (RTCStream) {
|
|
57901
|
+
var callParentDiv = document.getElementById(callDivId);
|
|
58004
57902
|
|
|
58005
|
-
|
|
58006
|
-
|
|
58007
|
-
|
|
58008
|
-
|
|
57903
|
+
if (uiRemoteMedias.hasOwnProperty(RTCStream)) {
|
|
57904
|
+
const stream = uiRemoteMedias[RTCStream].srcObject;
|
|
57905
|
+
if (!!stream) {
|
|
57906
|
+
const tracks = stream.getTracks();
|
|
58009
57907
|
|
|
58010
|
-
|
|
58011
|
-
|
|
58012
|
-
|
|
58013
|
-
|
|
58014
|
-
|
|
57908
|
+
if (!!tracks) {
|
|
57909
|
+
tracks.forEach(function (track) {
|
|
57910
|
+
track.stop();
|
|
57911
|
+
});
|
|
57912
|
+
}
|
|
58015
57913
|
|
|
58016
|
-
|
|
58017
|
-
|
|
57914
|
+
uiRemoteMedias[RTCStream].srcObject = null;
|
|
57915
|
+
}
|
|
58018
57916
|
|
|
58019
|
-
|
|
58020
|
-
|
|
58021
|
-
|
|
58022
|
-
|
|
57917
|
+
uiRemoteMedias[RTCStream].remove();
|
|
57918
|
+
delete (uiRemoteMedias[RTCStream]);
|
|
57919
|
+
}
|
|
57920
|
+
},
|
|
58023
57921
|
|
|
58024
|
-
removeFromCallUI = function (topic) {
|
|
58025
|
-
var videoElement = 'Vi-' + topic;
|
|
58026
|
-
var audioElement = 'Vo-' + topic;
|
|
58027
57922
|
|
|
58028
|
-
|
|
58029
|
-
|
|
58030
|
-
|
|
57923
|
+
removeFromCallUI = function (topic) {
|
|
57924
|
+
var videoElement = 'Vi-' + topic;
|
|
57925
|
+
var audioElement = 'Vo-' + topic;
|
|
58031
57926
|
|
|
58032
|
-
|
|
58033
|
-
|
|
58034
|
-
|
|
57927
|
+
if (topic.length > 0 && uiRemoteMedias.hasOwnProperty(videoElement)) {
|
|
57928
|
+
removeStreamFromWebRTC(videoElement);
|
|
57929
|
+
}
|
|
57930
|
+
|
|
57931
|
+
if (topic.length > 0 && uiRemoteMedias.hasOwnProperty(audioElement)) {
|
|
57932
|
+
removeStreamFromWebRTC(audioElement);
|
|
57933
|
+
}
|
|
57934
|
+
},
|
|
57935
|
+
*/
|
|
57936
|
+
|
|
57937
|
+
restartMediaOnKeyFrame = function (userId, timeout) {
|
|
57938
|
+
setTimeout(function () {
|
|
57939
|
+
if(typeof callUsers[userId] !== "undefined" && callUsers[userId])
|
|
57940
|
+
restartMedia(callUsers[userId].videoTopicName);
|
|
57941
|
+
}, timeout);
|
|
58035
57942
|
};
|
|
58036
57943
|
|
|
58037
57944
|
this.updateToken = function (newToken) {
|
|
@@ -58057,18 +57964,38 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58057
57964
|
break;
|
|
58058
57965
|
|
|
58059
57966
|
case 'GET_KEY_FRAME':
|
|
58060
|
-
|
|
58061
|
-
|
|
57967
|
+
if(callUsers && callUsers[chatMessaging.userInfo.id] && callUsers[chatMessaging.userInfo.id].video) {
|
|
57968
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 2000);
|
|
57969
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 4000);
|
|
57970
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 8000);
|
|
57971
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 12000);
|
|
57972
|
+
}
|
|
57973
|
+
if(callUsers && callUsers['screenShare']
|
|
57974
|
+
&& callUsers['screenShare'].video
|
|
57975
|
+
&& screenShareState.started
|
|
57976
|
+
&& screenShareState.imOwner) {
|
|
57977
|
+
restartMediaOnKeyFrame('screenShare', 2000);
|
|
57978
|
+
restartMediaOnKeyFrame('screenShare', 4000);
|
|
57979
|
+
restartMediaOnKeyFrame('screenShare', 8000);
|
|
57980
|
+
restartMediaOnKeyFrame('screenShare', 12000);
|
|
57981
|
+
}
|
|
57982
|
+
|
|
57983
|
+
/* setTimeout(function () {
|
|
57984
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
57985
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
58062
57986
|
}, 2000);
|
|
58063
57987
|
setTimeout(function () {
|
|
58064
|
-
|
|
57988
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
57989
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
58065
57990
|
}, 4000);
|
|
58066
57991
|
setTimeout(function () {
|
|
58067
|
-
|
|
57992
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
57993
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
58068
57994
|
}, 8000);
|
|
58069
57995
|
setTimeout(function () {
|
|
58070
|
-
|
|
58071
|
-
|
|
57996
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
57997
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
57998
|
+
}, 12000);*/
|
|
58072
57999
|
break;
|
|
58073
58000
|
|
|
58074
58001
|
case 'FREEZED':
|
|
@@ -58108,7 +58035,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58108
58035
|
break;
|
|
58109
58036
|
|
|
58110
58037
|
default:
|
|
58111
|
-
console.warn("[onmessage] Invalid message, id: " + jsonMessage.id, jsonMessage);
|
|
58038
|
+
console.warn("[SDK][onmessage] Invalid message, id: " + jsonMessage.id, jsonMessage);
|
|
58112
58039
|
if (jsonMessage.match(/NOT CREATE SESSION/g)) {
|
|
58113
58040
|
if (currentCallParams && Object.keys(currentCallParams)) {
|
|
58114
58041
|
//handleCallSocketOpen(currentCallParams);
|
|
@@ -58120,7 +58047,11 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58120
58047
|
};
|
|
58121
58048
|
|
|
58122
58049
|
this.asyncInitialized = function (async) {
|
|
58123
|
-
asyncClient = async
|
|
58050
|
+
asyncClient = async;
|
|
58051
|
+
|
|
58052
|
+
asyncClient.on('asyncReady', function (){
|
|
58053
|
+
callStateController.maybeReconnectAllTopics();
|
|
58054
|
+
})
|
|
58124
58055
|
};
|
|
58125
58056
|
|
|
58126
58057
|
this.handleChatMessages = function(type, chatMessageVOTypes, messageContent, contentCount, threadId, uniqueId) {
|
|
@@ -58224,13 +58155,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58224
58155
|
result: messageContent
|
|
58225
58156
|
});
|
|
58226
58157
|
|
|
58227
|
-
|
|
58228
|
-
if (webpeers[peer]) {
|
|
58229
|
-
webpeers[peer].dispose();
|
|
58230
|
-
delete webpeers[peer];
|
|
58231
|
-
}
|
|
58232
|
-
}
|
|
58233
|
-
webpeers = {};
|
|
58158
|
+
//callStateController.removeAllCallParticipants();
|
|
58234
58159
|
|
|
58235
58160
|
if (typeof messageContent === 'object'
|
|
58236
58161
|
&& messageContent.hasOwnProperty('chatDataDto')
|
|
@@ -58243,8 +58168,10 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58243
58168
|
mute: messageContent.clientDTO.mute,
|
|
58244
58169
|
sendingTopic: messageContent.clientDTO.topicSend,
|
|
58245
58170
|
receiveTopic: messageContent.clientDTO.topicReceive,
|
|
58171
|
+
screenShare: messageContent.chatDataDto.screenShare,
|
|
58246
58172
|
brokerAddress: messageContent.chatDataDto.brokerAddressWeb,
|
|
58247
58173
|
turnAddress: messageContent.chatDataDto.turnAddress,
|
|
58174
|
+
clientsList: messageContent.otherClientDtoList
|
|
58248
58175
|
}, function (callDivs) {
|
|
58249
58176
|
chatEvents.fireEvent('callEvents', {
|
|
58250
58177
|
type: 'CALL_DIVS',
|
|
@@ -58331,8 +58258,9 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58331
58258
|
type: 'CALL_PARTICIPANT_CONNECTED',
|
|
58332
58259
|
result: messageContent
|
|
58333
58260
|
});
|
|
58334
|
-
|
|
58335
|
-
restartMedia(
|
|
58261
|
+
//callTopics['sendVideoTopic']
|
|
58262
|
+
//restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
58263
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
58336
58264
|
|
|
58337
58265
|
break;
|
|
58338
58266
|
|
|
@@ -58382,7 +58310,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58382
58310
|
});
|
|
58383
58311
|
|
|
58384
58312
|
if (!!messageContent[0].sendTopic) {
|
|
58385
|
-
removeFromCallUI(messageContent[0].sendTopic);
|
|
58313
|
+
//removeFromCallUI(messageContent[0].sendTopic);
|
|
58314
|
+
callStateController.removeFromCallUI(messageContent[0].sendTopic)
|
|
58386
58315
|
}
|
|
58387
58316
|
|
|
58388
58317
|
break;
|
|
@@ -58410,8 +58339,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58410
58339
|
result: messageContent
|
|
58411
58340
|
});
|
|
58412
58341
|
|
|
58413
|
-
restartMedia(callTopics['sendVideoTopic']);
|
|
58414
|
-
|
|
58342
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
58343
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
58415
58344
|
break;
|
|
58416
58345
|
|
|
58417
58346
|
/**
|
|
@@ -58453,6 +58382,24 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58453
58382
|
case chatMessageVOTypes.MUTE_CALL_PARTICIPANT:
|
|
58454
58383
|
if (chatMessaging.messagesCallbacks[uniqueId]) {
|
|
58455
58384
|
chatMessaging.messagesCallbacks[uniqueId](Utility.createReturnData(false, '', 0, messageContent, contentCount));
|
|
58385
|
+
} else {
|
|
58386
|
+
if(Array.isArray(messageContent)){
|
|
58387
|
+
for(var i in messageContent) {
|
|
58388
|
+
callStateController.deactivateParticipantStream(
|
|
58389
|
+
messageContent[i].userId,
|
|
58390
|
+
'audioTopicName',
|
|
58391
|
+
'mute'
|
|
58392
|
+
)
|
|
58393
|
+
/*if(callUsers[messageContent[i].userId]) {
|
|
58394
|
+
callUsers[messageContent[i].userId].mute = true;
|
|
58395
|
+
|
|
58396
|
+
var user = callUsers[messageContent[i].userId];
|
|
58397
|
+
clearInterval(callUsers[messageContent[i].userId].topicMetaData[user.audioTopicName].interval)
|
|
58398
|
+
callStateController.removeTopic(messageContent[i].userId, user.audioTopicName);
|
|
58399
|
+
callStateController.removeStreamFromWebRTC(messageContent[i].userId, user.audioTopicName);
|
|
58400
|
+
}*/
|
|
58401
|
+
}
|
|
58402
|
+
}
|
|
58456
58403
|
}
|
|
58457
58404
|
|
|
58458
58405
|
chatEvents.fireEvent('callEvents', {
|
|
@@ -58468,6 +58415,30 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58468
58415
|
case chatMessageVOTypes.UNMUTE_CALL_PARTICIPANT:
|
|
58469
58416
|
if (chatMessaging.messagesCallbacks[uniqueId]) {
|
|
58470
58417
|
chatMessaging.messagesCallbacks[uniqueId](Utility.createReturnData(false, '', 0, messageContent, contentCount));
|
|
58418
|
+
} else {
|
|
58419
|
+
if(Array.isArray(messageContent)) {
|
|
58420
|
+
for(var i in messageContent) {
|
|
58421
|
+
callStateController.activateParticipantStream(
|
|
58422
|
+
messageContent[i].userId,
|
|
58423
|
+
'audio',
|
|
58424
|
+
'receive',
|
|
58425
|
+
'audioTopicName',
|
|
58426
|
+
messageContent[i].sendTopic,
|
|
58427
|
+
'mute'
|
|
58428
|
+
);
|
|
58429
|
+
/*if(callUsers[messageContent[i].userId]) {
|
|
58430
|
+
callUsers[messageContent[i].userId].mute = false;
|
|
58431
|
+
callUsers[messageContent[i].userId].audioTopicName = 'Vo-' + messageContent[i].sendTopic;
|
|
58432
|
+
|
|
58433
|
+
var user = callUsers[messageContent[i].userId];
|
|
58434
|
+
callStateController.appendUserToCallDiv(messageContent[i].userId, callStateController.generateHTMLElements(messageContent[i].userId));
|
|
58435
|
+
setTimeout(function () {
|
|
58436
|
+
callStateController.createTopic(messageContent[i].userId, user.audioTopicName, 'audio', 'receive');
|
|
58437
|
+
|
|
58438
|
+
})
|
|
58439
|
+
}*/
|
|
58440
|
+
}
|
|
58441
|
+
}
|
|
58471
58442
|
}
|
|
58472
58443
|
|
|
58473
58444
|
chatEvents.fireEvent('callEvents', {
|
|
@@ -58508,8 +58479,38 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58508
58479
|
case chatMessageVOTypes.TURN_ON_VIDEO_CALL:
|
|
58509
58480
|
if (chatMessaging.messagesCallbacks[uniqueId]) {
|
|
58510
58481
|
chatMessaging.messagesCallbacks[uniqueId](Utility.createReturnData(false, '', 0, messageContent, contentCount));
|
|
58482
|
+
} else {
|
|
58483
|
+
if(Array.isArray(messageContent)) {
|
|
58484
|
+
for(var i in messageContent) {
|
|
58485
|
+
callStateController.activateParticipantStream(
|
|
58486
|
+
messageContent[i].userId,
|
|
58487
|
+
'video',
|
|
58488
|
+
'receive',
|
|
58489
|
+
'videoTopicName',
|
|
58490
|
+
messageContent[i].sendTopic,
|
|
58491
|
+
'video'
|
|
58492
|
+
);
|
|
58493
|
+
/*if(callUsers[messageContent[i].userId]) {
|
|
58494
|
+
callUsers[messageContent[i].userId].video = true;
|
|
58495
|
+
callUsers[messageContent[i].userId].videoTopicName = 'Vi-' + messageContent[i].sendTopic;
|
|
58496
|
+
|
|
58497
|
+
var user = callUsers[messageContent[i].userId];
|
|
58498
|
+
callStateController.appendUserToCallDiv(messageContent[i].userId, callStateController.generateHTMLElements(messageContent[i].userId));
|
|
58499
|
+
setTimeout(function () {
|
|
58500
|
+
callStateController.createTopic(messageContent[i].userId, user.videoTopicName, 'video', 'receive');
|
|
58501
|
+
})
|
|
58502
|
+
}*/
|
|
58503
|
+
}
|
|
58504
|
+
}
|
|
58511
58505
|
}
|
|
58512
58506
|
|
|
58507
|
+
setTimeout(function () {
|
|
58508
|
+
chatEvents.fireEvent('callEvents', {
|
|
58509
|
+
type: 'CALL_DIVS',
|
|
58510
|
+
result: generateCallUIList()
|
|
58511
|
+
});
|
|
58512
|
+
})
|
|
58513
|
+
|
|
58513
58514
|
chatEvents.fireEvent('callEvents', {
|
|
58514
58515
|
type: 'TURN_ON_VIDEO_CALL',
|
|
58515
58516
|
result: messageContent
|
|
@@ -58523,8 +58524,32 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58523
58524
|
case chatMessageVOTypes.TURN_OFF_VIDEO_CALL:
|
|
58524
58525
|
if (chatMessaging.messagesCallbacks[uniqueId]) {
|
|
58525
58526
|
chatMessaging.messagesCallbacks[uniqueId](Utility.createReturnData(false, '', 0, messageContent, contentCount));
|
|
58527
|
+
} else {
|
|
58528
|
+
if(Array.isArray(messageContent)){
|
|
58529
|
+
for(var i in messageContent) {
|
|
58530
|
+
callStateController.deactivateParticipantStream(
|
|
58531
|
+
messageContent[i].userId,
|
|
58532
|
+
'videoTopicName',
|
|
58533
|
+
'video'
|
|
58534
|
+
)
|
|
58535
|
+
/* if(callUsers[messageContent[i].userId]) {
|
|
58536
|
+
callUsers[messageContent[i].userId].video = false;
|
|
58537
|
+
var user = callUsers[messageContent[i].userId];
|
|
58538
|
+
clearInterval(callUsers[messageContent[i].userId].topicMetaData[user.videoTopicName].interval)
|
|
58539
|
+
callStateController.removeTopic(messageContent[i].userId, user.videoTopicName);
|
|
58540
|
+
callStateController.removeStreamFromWebRTC(messageContent[i].userId, user.videoTopicName);
|
|
58541
|
+
}*/
|
|
58542
|
+
}
|
|
58543
|
+
}
|
|
58526
58544
|
}
|
|
58527
58545
|
|
|
58546
|
+
setTimeout(function () {
|
|
58547
|
+
chatEvents.fireEvent('callEvents', {
|
|
58548
|
+
type: 'CALL_DIVS',
|
|
58549
|
+
result: generateCallUIList()
|
|
58550
|
+
});
|
|
58551
|
+
})
|
|
58552
|
+
|
|
58528
58553
|
chatEvents.fireEvent('callEvents', {
|
|
58529
58554
|
type: 'TURN_OFF_VIDEO_CALL',
|
|
58530
58555
|
result: messageContent
|
|
@@ -58545,8 +58570,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58545
58570
|
result: messageContent
|
|
58546
58571
|
});
|
|
58547
58572
|
|
|
58548
|
-
restartMedia(callTopics['sendVideoTopic']);
|
|
58549
|
-
|
|
58573
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
58574
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
58550
58575
|
break;
|
|
58551
58576
|
|
|
58552
58577
|
/**
|
|
@@ -58568,8 +58593,20 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58568
58593
|
* Type 123 Start Screen Share
|
|
58569
58594
|
*/
|
|
58570
58595
|
case chatMessageVOTypes.START_SCREEN_SHARE:
|
|
58596
|
+
if(!callRequestController.callEstablishedInMySide)
|
|
58597
|
+
return;
|
|
58598
|
+
|
|
58599
|
+
screenShareState.started = true;
|
|
58600
|
+
if(messageContent.screenOwner.id === chatMessaging.userInfo.id) {
|
|
58601
|
+
screenShareState.imOwner = true;
|
|
58602
|
+
} else {
|
|
58603
|
+
screenShareState.imOwner = false;
|
|
58604
|
+
}
|
|
58605
|
+
|
|
58571
58606
|
if (chatMessaging.messagesCallbacks[uniqueId]) {
|
|
58572
58607
|
chatMessaging.messagesCallbacks[uniqueId](Utility.createReturnData(false, '', 0, messageContent, contentCount));
|
|
58608
|
+
} else if(!screenShareState.imOwner) {
|
|
58609
|
+
callStateController.addScreenShareToCall("receive", false)
|
|
58573
58610
|
}
|
|
58574
58611
|
|
|
58575
58612
|
chatEvents.fireEvent('callEvents', {
|
|
@@ -58583,8 +58620,14 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58583
58620
|
* Type 124 End Screen Share
|
|
58584
58621
|
*/
|
|
58585
58622
|
case chatMessageVOTypes.END_SCREEN_SHARE:
|
|
58623
|
+
screenShareState.imOwner = false;
|
|
58624
|
+
screenShareState.started = false;
|
|
58625
|
+
|
|
58586
58626
|
if (chatMessaging.messagesCallbacks[uniqueId]) {
|
|
58587
58627
|
chatMessaging.messagesCallbacks[uniqueId](Utility.createReturnData(false, '', 0, messageContent, contentCount));
|
|
58628
|
+
} else if (!screenShareState.imOwner) {
|
|
58629
|
+
consoleLogging && console.log("[SDK][END_SCREEN_SHARE], im not owner of screen");
|
|
58630
|
+
callStateController.removeScreenShareFromCall();
|
|
58588
58631
|
}
|
|
58589
58632
|
|
|
58590
58633
|
chatEvents.fireEvent('callEvents', {
|
|
@@ -58607,6 +58650,25 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58607
58650
|
result: messageContent
|
|
58608
58651
|
});
|
|
58609
58652
|
|
|
58653
|
+
break;
|
|
58654
|
+
/**
|
|
58655
|
+
* Type 126 Destinated Record Call Request
|
|
58656
|
+
*/
|
|
58657
|
+
case chatMessageVOTypes.DESTINATED_RECORD_CALL:
|
|
58658
|
+
if(!callRequestController.callEstablishedInMySide)
|
|
58659
|
+
return;
|
|
58660
|
+
|
|
58661
|
+
if (chatMessaging.messagesCallbacks[uniqueId]) {
|
|
58662
|
+
chatMessaging.messagesCallbacks[uniqueId](Utility.createReturnData(false, '', 0, messageContent, contentCount));
|
|
58663
|
+
}
|
|
58664
|
+
|
|
58665
|
+
chatEvents.fireEvent('callEvents', {
|
|
58666
|
+
type: 'START_RECORDING_CALL',
|
|
58667
|
+
result: messageContent
|
|
58668
|
+
});
|
|
58669
|
+
|
|
58670
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
58671
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
58610
58672
|
break;
|
|
58611
58673
|
}
|
|
58612
58674
|
}
|
|
@@ -58669,6 +58731,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58669
58731
|
return;
|
|
58670
58732
|
}
|
|
58671
58733
|
|
|
58734
|
+
callRequestController.cameraPaused = (typeof params.cameraPaused === 'boolean') ? params.cameraPaused : false;
|
|
58672
58735
|
callRequestController.callRequestReceived = true;
|
|
58673
58736
|
callRequestController.callEstablishedInMySide = true;
|
|
58674
58737
|
|
|
@@ -58802,6 +58865,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58802
58865
|
|
|
58803
58866
|
content.videoCall = content.video;
|
|
58804
58867
|
|
|
58868
|
+
callRequestController.cameraPaused = (typeof params.cameraPaused === 'boolean') ? params.cameraPaused : callRequestController.cameraPaused;
|
|
58869
|
+
|
|
58805
58870
|
if (params.clientType && typeof params.clientType === 'string' && callClientTypes[params.clientType.toUpperCase()] > 0) {
|
|
58806
58871
|
content.clientType = callClientTypes[params.clientType.toUpperCase()];
|
|
58807
58872
|
} else {
|
|
@@ -58864,7 +58929,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58864
58929
|
chatMessageVOType: chatMessageVOTypes.RECORD_CALL,
|
|
58865
58930
|
typeCode: params.typeCode,
|
|
58866
58931
|
pushMsgType: 3,
|
|
58867
|
-
token: token
|
|
58932
|
+
token: token,
|
|
58933
|
+
content: {}
|
|
58868
58934
|
};
|
|
58869
58935
|
|
|
58870
58936
|
if (params) {
|
|
@@ -58877,6 +58943,13 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58877
58943
|
});
|
|
58878
58944
|
return;
|
|
58879
58945
|
}
|
|
58946
|
+
|
|
58947
|
+
if(params.destinated === true) {
|
|
58948
|
+
recordCallData.chatMessageVOType = chatMessageVOTypes.DESTINATED_RECORD_CALL;
|
|
58949
|
+
recordCallData.content.recordType = typeof +params.recordType === 'number' ? params.recordType : 1;
|
|
58950
|
+
recordCallData.content.tags = Array.isArray(params.tags) ? params.tags : null;
|
|
58951
|
+
recordCallData.content.threadId = typeof +params.threadId === 'number' ? params.threadId : null;
|
|
58952
|
+
}
|
|
58880
58953
|
} else {
|
|
58881
58954
|
chatEvents.fireEvent('error', {
|
|
58882
58955
|
code: 999,
|
|
@@ -58887,7 +58960,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58887
58960
|
|
|
58888
58961
|
return chatMessaging.sendMessage(recordCallData, {
|
|
58889
58962
|
onResult: function (result) {
|
|
58890
|
-
restartMedia(callTopics['sendVideoTopic']);
|
|
58963
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
58964
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
58891
58965
|
callback && callback(result);
|
|
58892
58966
|
}
|
|
58893
58967
|
});
|
|
@@ -58934,35 +59008,6 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58934
59008
|
token: token
|
|
58935
59009
|
};
|
|
58936
59010
|
|
|
58937
|
-
if(!webpeers[callTopics['sendVideoTopic']]) {
|
|
58938
|
-
console.log('[SDK][startScreenShare] No video send connection available');
|
|
58939
|
-
} else {
|
|
58940
|
-
callStateController.removeTopic(callTopics['sendVideoTopic']);
|
|
58941
|
-
callStateController.createTopic(callTopics['sendVideoTopic'], "video", "send", true);
|
|
58942
|
-
/*if (!displayMediaStream) {
|
|
58943
|
-
webpeers[callTopics['sendVideoTopic']].getLocalStream().getTracks()[0].enabled = false;
|
|
58944
|
-
|
|
58945
|
-
navigator.mediaDevices.getDisplayMedia().then(function (result) {
|
|
58946
|
-
console.log("webpeers[callTopics['sendVideoTopic']]", webpeers[callTopics['sendVideoTopic']].getLocalStream());
|
|
58947
|
-
/!*webpeers[callTopics['sendVideoTopic']].replaceTrack(result.getTracks()[0]).then(function (replacedPeer){
|
|
58948
|
-
});*!/
|
|
58949
|
-
uiRemoteMedias[callTopics["sendVideoTopic"]].srcObject = result;
|
|
58950
|
-
var localStream = result;
|
|
58951
|
-
webpeers[callTopics['sendVideoTopic']].getLocalStream().getTracks().forEach(track => {
|
|
58952
|
-
webpeers[callTopics['sendVideoTopic']].remove
|
|
58953
|
-
});
|
|
58954
|
-
setTimeout(function() {
|
|
58955
|
-
localStream.getTracks().forEach(function (track) {
|
|
58956
|
-
webpeers[callTopics['sendVideoTopic']].peerConnection.addTrack(track, localStream);
|
|
58957
|
-
});
|
|
58958
|
-
webpeers[callTopics['sendVideoTopic']].getLocalStream().getTracks()[0].enabled = true;
|
|
58959
|
-
restartMedia(uiRemoteMedias[callTopics["sendVideoTopic"]])
|
|
58960
|
-
}, 2000);
|
|
58961
|
-
startMedia(uiRemoteMedias[callTopics["sendVideoTopic"]]);
|
|
58962
|
-
});
|
|
58963
|
-
}*/
|
|
58964
|
-
}
|
|
58965
|
-
|
|
58966
59011
|
if (params) {
|
|
58967
59012
|
if (typeof +params.callId === 'number' && params.callId > 0) {
|
|
58968
59013
|
sendData.subjectId = +params.callId;
|
|
@@ -58981,8 +59026,26 @@ WildEmitter.mixin(WildEmitter);
|
|
|
58981
59026
|
return;
|
|
58982
59027
|
}
|
|
58983
59028
|
|
|
59029
|
+
/*if(screenShareState.started) {
|
|
59030
|
+
chatEvents.fireEvent('error', {
|
|
59031
|
+
code: 999,
|
|
59032
|
+
message: "ScreenShare has already started"
|
|
59033
|
+
});
|
|
59034
|
+
console.log("ScreenShare has already started");
|
|
59035
|
+
return
|
|
59036
|
+
}*/
|
|
59037
|
+
|
|
58984
59038
|
return chatMessaging.sendMessage(sendData, {
|
|
58985
59039
|
onResult: function (result) {
|
|
59040
|
+
consoleLogging && console.log("[sdk][startScreenShare][onResult]: ", result);
|
|
59041
|
+
if(!result.hasError) {
|
|
59042
|
+
var direction = 'send', shareScreen = true;
|
|
59043
|
+
if(screenShareState.started && !screenShareState.imOwner) {
|
|
59044
|
+
direction = 'receive';
|
|
59045
|
+
shareScreen = false;
|
|
59046
|
+
}
|
|
59047
|
+
callStateController.addScreenShareToCall(direction, shareScreen);
|
|
59048
|
+
}
|
|
58986
59049
|
callback && callback(result);
|
|
58987
59050
|
}
|
|
58988
59051
|
});
|
|
@@ -59014,35 +59077,18 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59014
59077
|
return;
|
|
59015
59078
|
}
|
|
59016
59079
|
|
|
59017
|
-
if(!
|
|
59018
|
-
|
|
59080
|
+
if(!screenShareState.imOwner) {
|
|
59081
|
+
chatEvents.fireEvent('error', {
|
|
59082
|
+
code: 999,
|
|
59083
|
+
message: 'You can not end others screen sharing!'
|
|
59084
|
+
});
|
|
59085
|
+
return;
|
|
59086
|
+
}
|
|
59087
|
+
|
|
59088
|
+
if(!callUsers['screenShare'].peers[callUsers['screenShare'].videoTopicName]) {
|
|
59089
|
+
consoleLogging && console.log('[SDK][endScreenShare] No screenShare connection available');
|
|
59019
59090
|
} else {
|
|
59020
|
-
|
|
59021
|
-
callStateController.removeTopic(callTopics['sendVideoTopic']);
|
|
59022
|
-
if(startCamera)
|
|
59023
|
-
callStateController.createTopic(callTopics['sendVideoTopic'], "video", "send");
|
|
59024
|
-
/*if (!displayMediaStream) {
|
|
59025
|
-
webpeers[callTopics['sendVideoTopic']].getLocalStream().getTracks()[0].enabled = false;
|
|
59026
|
-
|
|
59027
|
-
navigator.mediaDevices.getDisplayMedia().then(function (result) {
|
|
59028
|
-
console.log("webpeers[callTopics['sendVideoTopic']]", webpeers[callTopics['sendVideoTopic']].getLocalStream());
|
|
59029
|
-
/!*webpeers[callTopics['sendVideoTopic']].replaceTrack(result.getTracks()[0]).then(function (replacedPeer){
|
|
59030
|
-
});*!/
|
|
59031
|
-
uiRemoteMedias[callTopics["sendVideoTopic"]].srcObject = result;
|
|
59032
|
-
var localStream = result;
|
|
59033
|
-
webpeers[callTopics['sendVideoTopic']].getLocalStream().getTracks().forEach(track => {
|
|
59034
|
-
webpeers[callTopics['sendVideoTopic']].remove
|
|
59035
|
-
});
|
|
59036
|
-
setTimeout(function() {
|
|
59037
|
-
localStream.getTracks().forEach(function (track) {
|
|
59038
|
-
webpeers[callTopics['sendVideoTopic']].peerConnection.addTrack(track, localStream);
|
|
59039
|
-
});
|
|
59040
|
-
webpeers[callTopics['sendVideoTopic']].getLocalStream().getTracks()[0].enabled = true;
|
|
59041
|
-
restartMedia(uiRemoteMedias[callTopics["sendVideoTopic"]])
|
|
59042
|
-
}, 2000);
|
|
59043
|
-
startMedia(uiRemoteMedias[callTopics["sendVideoTopic"]]);
|
|
59044
|
-
});
|
|
59045
|
-
}*/
|
|
59091
|
+
callStateController.removeScreenShareFromCall();
|
|
59046
59092
|
}
|
|
59047
59093
|
|
|
59048
59094
|
return chatMessaging.sendMessage(sendData, {
|
|
@@ -59364,6 +59410,15 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59364
59410
|
sendMessageParams.content = params.userIds;
|
|
59365
59411
|
}
|
|
59366
59412
|
}
|
|
59413
|
+
callStateController.deactivateParticipantStream(
|
|
59414
|
+
chatMessaging.userInfo.id,
|
|
59415
|
+
'audioTopicName',
|
|
59416
|
+
'mute'
|
|
59417
|
+
)
|
|
59418
|
+
/*
|
|
59419
|
+
callStateController.removeTopic(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].audioTopicName)
|
|
59420
|
+
callStateController.removeStreamFromWebRTC(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].audioTopicName)
|
|
59421
|
+
*/
|
|
59367
59422
|
|
|
59368
59423
|
return chatMessaging.sendMessage(sendMessageParams, {
|
|
59369
59424
|
onResult: function (result) {
|
|
@@ -59405,6 +59460,26 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59405
59460
|
sendMessageParams.content = params.userIds;
|
|
59406
59461
|
}
|
|
59407
59462
|
}
|
|
59463
|
+
var myId = chatMessaging.userInfo.id;
|
|
59464
|
+
|
|
59465
|
+
callStateController.activateParticipantStream(
|
|
59466
|
+
myId,
|
|
59467
|
+
'audio',
|
|
59468
|
+
'send',
|
|
59469
|
+
'audioTopicName',
|
|
59470
|
+
callUsers[myId].topicSend,
|
|
59471
|
+
'mute'
|
|
59472
|
+
);
|
|
59473
|
+
/*if(callUsers[myId]) {
|
|
59474
|
+
callUsers[myId].mute = false;
|
|
59475
|
+
callUsers[myId].audioTopicName = 'Vo-' + callUsers[myId].topicSend;
|
|
59476
|
+
|
|
59477
|
+
var user = callUsers[myId];
|
|
59478
|
+
callStateController.appendUserToCallDiv(myId, callStateController.generateHTMLElements(myId));
|
|
59479
|
+
setTimeout(function () {
|
|
59480
|
+
callStateController.createTopic(myId, user.audioTopicName, 'audio', 'send');
|
|
59481
|
+
})
|
|
59482
|
+
}*/
|
|
59408
59483
|
|
|
59409
59484
|
return chatMessaging.sendMessage(sendMessageParams, {
|
|
59410
59485
|
onResult: function (result) {
|
|
@@ -59418,6 +59493,19 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59418
59493
|
// TODO : What is the result?!
|
|
59419
59494
|
var messageContent = result.result;
|
|
59420
59495
|
returnData.result = messageContent;
|
|
59496
|
+
|
|
59497
|
+
/*for(var i in result.result) {
|
|
59498
|
+
if(callUsers[result.result[i].userId]) {
|
|
59499
|
+
callUsers[result.result[i].userId].mute = false;
|
|
59500
|
+
callUsers[result.result[i].userId].audioTopicName = 'Vo-' + result.result[i].sendTopic;
|
|
59501
|
+
|
|
59502
|
+
var user = callUsers[result.result[i].userId];
|
|
59503
|
+
callStateController.appendUserToCallDiv(result.result[i].userId, callStateController.generateHTMLElements(result.result[i].userId));
|
|
59504
|
+
setTimeout(function () {
|
|
59505
|
+
callStateController.createTopic(result.result[i].userId, user.audioTopicName, 'audio', 'send');
|
|
59506
|
+
})
|
|
59507
|
+
}
|
|
59508
|
+
}*/
|
|
59421
59509
|
}
|
|
59422
59510
|
callback && callback(returnData);
|
|
59423
59511
|
}
|
|
@@ -59452,6 +59540,29 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59452
59540
|
|
|
59453
59541
|
return chatMessaging.sendMessage(turnOnVideoData, {
|
|
59454
59542
|
onResult: function (result) {
|
|
59543
|
+
if(!result.hasError && Array.isArray(result.result)) {
|
|
59544
|
+
for(var i in result.result) {
|
|
59545
|
+
callStateController.activateParticipantStream(
|
|
59546
|
+
result.result[i].userId,
|
|
59547
|
+
'video',
|
|
59548
|
+
'send',
|
|
59549
|
+
'videoTopicName',
|
|
59550
|
+
result.result[i].sendTopic,
|
|
59551
|
+
'video'
|
|
59552
|
+
);
|
|
59553
|
+
/*if(callUsers[result.result[i].userId]) {
|
|
59554
|
+
callUsers[result.result[i].userId].video = true;
|
|
59555
|
+
callUsers[result.result[i].userId].mute = result.result[i].mute;
|
|
59556
|
+
callUsers[result.result[i].userId].videoTopicName = 'Vi-' + result.result[i].sendTopic;
|
|
59557
|
+
|
|
59558
|
+
var user = callUsers[result.result[i].userId];
|
|
59559
|
+
callStateController.appendUserToCallDiv(result.result[i].userId, callStateController.generateHTMLElements(result.result[i].userId));
|
|
59560
|
+
setTimeout(function () {
|
|
59561
|
+
callStateController.createTopic(result.result[i].userId, user.videoTopicName, 'video', 'send');
|
|
59562
|
+
})
|
|
59563
|
+
}*/
|
|
59564
|
+
}
|
|
59565
|
+
}
|
|
59455
59566
|
callback && callback(result);
|
|
59456
59567
|
}
|
|
59457
59568
|
});
|
|
@@ -59483,6 +59594,16 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59483
59594
|
return;
|
|
59484
59595
|
}
|
|
59485
59596
|
|
|
59597
|
+
callStateController.deactivateParticipantStream(
|
|
59598
|
+
chatMessaging.userInfo.id,
|
|
59599
|
+
'videoTopicName',
|
|
59600
|
+
'video'
|
|
59601
|
+
)
|
|
59602
|
+
/*
|
|
59603
|
+
callStateController.removeTopic(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].videoTopicName)
|
|
59604
|
+
callStateController.removeStreamFromWebRTC(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].videoTopicName)
|
|
59605
|
+
*/
|
|
59606
|
+
|
|
59486
59607
|
return chatMessaging.sendMessage(turnOffVideoData, {
|
|
59487
59608
|
onResult: function (result) {
|
|
59488
59609
|
callback && callback(result);
|
|
@@ -59496,18 +59617,21 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59496
59617
|
* @param callback
|
|
59497
59618
|
*/
|
|
59498
59619
|
this.pauseCamera = function (params, callback) {
|
|
59499
|
-
|
|
59620
|
+
var me = callUsers[chatMessaging.userInfo.id];
|
|
59621
|
+
|
|
59622
|
+
if(!Object.keys(callUsers).length || !me.videoTopicName || !me.peers[me.videoTopicName])
|
|
59500
59623
|
return;
|
|
59501
59624
|
|
|
59502
|
-
|
|
59625
|
+
me.peers[me.videoTopicName].getLocalStream().getTracks()[0].enabled = false;
|
|
59503
59626
|
callback && callback();
|
|
59504
59627
|
};
|
|
59505
59628
|
|
|
59506
59629
|
this.resumeCamera = function (params, callback) {
|
|
59507
|
-
|
|
59630
|
+
var me = callUsers[chatMessaging.userInfo.id]
|
|
59631
|
+
if(!Object.keys(callUsers).length || !me.videoTopicName || !me.peers[me.videoTopicName])
|
|
59508
59632
|
return;
|
|
59509
59633
|
|
|
59510
|
-
|
|
59634
|
+
me.peers[me.videoTopicName].getLocalStream().getTracks()[0].enabled = true;
|
|
59511
59635
|
callback && callback();
|
|
59512
59636
|
};
|
|
59513
59637
|
|
|
@@ -59517,18 +59641,20 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59517
59641
|
* @param callback
|
|
59518
59642
|
*/
|
|
59519
59643
|
this.pauseMice = function (params, callback) {
|
|
59520
|
-
|
|
59644
|
+
var me = callUsers[chatMessaging.userInfo.id];
|
|
59645
|
+
if(!Object.keys(callUsers).length || !me.audioTopicName || !me.peers[me.audioTopicName])
|
|
59521
59646
|
return;
|
|
59522
59647
|
|
|
59523
|
-
|
|
59648
|
+
me.peers[me.audioTopicName].getLocalStream().getTracks()[0].enabled = false;
|
|
59524
59649
|
callback && callback();
|
|
59525
59650
|
};
|
|
59526
59651
|
|
|
59527
59652
|
this.resumeMice = function (params, callback) {
|
|
59528
|
-
|
|
59653
|
+
var me = callUsers[chatMessaging.userInfo.id];
|
|
59654
|
+
if(!Object.keys(callUsers).length || !me.audioTopicName || !me.peers[me.audioTopicName])
|
|
59529
59655
|
return;
|
|
59530
59656
|
|
|
59531
|
-
|
|
59657
|
+
me.peers[me.audioTopicName].getLocalStream().getTracks()[0].enabled = true;
|
|
59532
59658
|
callback && callback();
|
|
59533
59659
|
};
|
|
59534
59660
|
|
|
@@ -59542,13 +59668,19 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59542
59668
|
callVideoMinHeight = +params.height;
|
|
59543
59669
|
}
|
|
59544
59670
|
|
|
59545
|
-
|
|
59671
|
+
if(!callUsers[chatMessaging.userInfo.id]){
|
|
59672
|
+
consoleLogging && console.log("Error in resizeCallVideo(), call not started ");
|
|
59673
|
+
return;
|
|
59674
|
+
}
|
|
59675
|
+
|
|
59676
|
+
var userObject = callUsers[chatMessaging.userInfo.id]
|
|
59677
|
+
userObject.peers[userObject.videoTopicName].getLocalStream().getTracks()[0].applyConstraints({
|
|
59546
59678
|
"width": callVideoMinWidth,
|
|
59547
59679
|
"height": callVideoMinHeight
|
|
59548
59680
|
})
|
|
59549
59681
|
.then((res) => {
|
|
59550
|
-
|
|
59551
|
-
|
|
59682
|
+
userObject.htmlElements[userObject.videoTopicName].style.width = callVideoMinWidth + 'px';
|
|
59683
|
+
userObject.htmlElements[userObject.videoTopicName].style.height = callVideoMinHeight + 'px';
|
|
59552
59684
|
callback && callback();
|
|
59553
59685
|
})
|
|
59554
59686
|
.catch((e) => {
|
|
@@ -59774,6 +59906,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
59774
59906
|
START_SCREEN_SHARE: 123,
|
|
59775
59907
|
END_SCREEN_SHARE: 124,
|
|
59776
59908
|
DELETE_FROM_CALL_HISTORY: 125,
|
|
59909
|
+
DESTINATED_RECORD_CALL: 126,
|
|
59777
59910
|
MUTUAL_GROUPS: 130,
|
|
59778
59911
|
CREATE_TAG: 140,
|
|
59779
59912
|
EDIT_TAG: 141,
|
|
@@ -62538,6 +62671,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
62538
62671
|
case chatMessageVOTypes.TURN_OFF_VIDEO_CALL:
|
|
62539
62672
|
case chatMessageVOTypes.ACTIVE_CALL_PARTICIPANTS:
|
|
62540
62673
|
case chatMessageVOTypes.CALL_SESSION_CREATED:
|
|
62674
|
+
case chatMessageVOTypes.DESTINATED_RECORD_CALL:
|
|
62541
62675
|
callModule.handleChatMessages(type, chatMessageVOTypes, messageContent, contentCount, threadId, uniqueId);
|
|
62542
62676
|
break;
|
|
62543
62677
|
|
|
@@ -68727,6 +68861,8 @@ WildEmitter.mixin(WildEmitter);
|
|
|
68727
68861
|
putInChatWaitQueue(params.message, function () {
|
|
68728
68862
|
callback && callback();
|
|
68729
68863
|
});
|
|
68864
|
+
} else {
|
|
68865
|
+
callback && callback();
|
|
68730
68866
|
}
|
|
68731
68867
|
},
|
|
68732
68868
|
|
|
@@ -68899,7 +69035,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
68899
69035
|
callbacks: callbacks
|
|
68900
69036
|
}, function () {
|
|
68901
69037
|
callback && callback();
|
|
68902
|
-
});
|
|
69038
|
+
}, true);
|
|
68903
69039
|
});
|
|
68904
69040
|
break;
|
|
68905
69041
|
}
|
|
@@ -70970,7 +71106,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
70970
71106
|
callbacks: callbacks
|
|
70971
71107
|
}, function () {
|
|
70972
71108
|
chatSendQueueHandler();
|
|
70973
|
-
});
|
|
71109
|
+
}, true);
|
|
70974
71110
|
};
|
|
70975
71111
|
|
|
70976
71112
|
this.deliver = function (params) {
|
|
@@ -73536,6 +73672,7 @@ WildEmitter.mixin(WildEmitter);
|
|
|
73536
73672
|
//if (typeof (require) !== 'undefined' && typeof (exports) !== 'undefined') {} else {}
|
|
73537
73673
|
|
|
73538
73674
|
var Sentry = params.Sentry,
|
|
73675
|
+
currentModuleInstance = this,
|
|
73539
73676
|
Utility = params.Utility,
|
|
73540
73677
|
consoleLogging = params.consoleLogging,
|
|
73541
73678
|
token = params.token,
|