podchat-browser 11.3.1 → 11.3.4
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/dist/{podchat-11.2.1.js → podchat-11.3.2.js} +2638 -778
- package/dist/{podchat-11.2.3.js → podchat-11.3.3.js} +56842 -56708
- package/dist/{podchat-11.2.2.js → podchat-11.3.4.js} +56893 -56748
- package/examples/index.html +88 -3
- package/package.json +3 -3
- package/src/call.module.js +241 -107
- package/src/chat.js +2 -1
- 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
package/src/call.module.js
CHANGED
|
@@ -681,29 +681,6 @@
|
|
|
681
681
|
};
|
|
682
682
|
},
|
|
683
683
|
|
|
684
|
-
/*handleCallSocketOpen = function (params) {
|
|
685
|
-
currentCallParams = params;
|
|
686
|
-
|
|
687
|
-
sendCallMessage({
|
|
688
|
-
id: 'CREATE_SESSION',
|
|
689
|
-
brokerAddress: params.brokerAddress,
|
|
690
|
-
turnAddress: params.turnAddress.split(',')[0]
|
|
691
|
-
}, function (res) {
|
|
692
|
-
if (res.done === 'TRUE') {
|
|
693
|
-
callStopQueue.callStarted = true;
|
|
694
|
-
generateAndSendSdpOffers(params, [callTopics['sendVideoTopic'], callTopics['receiveVideoTopic'], callTopics['sendAudioTopic'], callTopics['receiveAudioTopic']]);
|
|
695
|
-
} else if (res.done === 'SKIP') {
|
|
696
|
-
callStopQueue.callStarted = true;
|
|
697
|
-
generateAndSendSdpOffers(params, [callTopics['sendVideoTopic'], callTopics['receiveVideoTopic'], callTopics['sendAudioTopic'], callTopics['receiveAudioTopic']]);
|
|
698
|
-
} else {
|
|
699
|
-
consoleLogging && console.log('CREATE_SESSION faced a problem', res);
|
|
700
|
-
endCall({
|
|
701
|
-
callId: currentCallId
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
},*/
|
|
706
|
-
|
|
707
684
|
callStateController = {
|
|
708
685
|
createSessionInChat: function (params) {
|
|
709
686
|
currentCallParams = params;
|
|
@@ -739,12 +716,18 @@
|
|
|
739
716
|
if(i === 'screenShare')
|
|
740
717
|
continue;
|
|
741
718
|
|
|
742
|
-
if
|
|
719
|
+
if(callUsers[i].video) {
|
|
743
720
|
callController.startParticipantVideo(i);
|
|
744
721
|
}
|
|
745
|
-
if(
|
|
722
|
+
if(!callUsers[i].mute) {
|
|
746
723
|
callController.startParticipantAudio(i);
|
|
747
724
|
}
|
|
725
|
+
/*if (params.callVideo) {
|
|
726
|
+
callController.startParticipantVideo(i);
|
|
727
|
+
}*/
|
|
728
|
+
/*if(params.callAudio) {
|
|
729
|
+
callController.startParticipantAudio(i);
|
|
730
|
+
}*/
|
|
748
731
|
}
|
|
749
732
|
},
|
|
750
733
|
setupCallParticipant: function (participant) {
|
|
@@ -915,8 +898,8 @@
|
|
|
915
898
|
},
|
|
916
899
|
removeTopic: function (userId, topic) {
|
|
917
900
|
if(callUsers[userId].peers[topic]) {
|
|
918
|
-
callUsers[userId].peers[topic].dispose();
|
|
919
901
|
this.removeConnectionQualityInterval(userId, topic);
|
|
902
|
+
callUsers[userId].peers[topic].dispose();
|
|
920
903
|
callUsers[userId].peers[topic] = null;
|
|
921
904
|
}
|
|
922
905
|
},
|
|
@@ -1138,12 +1121,12 @@
|
|
|
1138
1121
|
errorInfo: user.peers[topic]
|
|
1139
1122
|
});
|
|
1140
1123
|
// setTimeout(function () {
|
|
1141
|
-
if(chatMessaging.chatState) {
|
|
1142
|
-
callController.shouldReconnectTopic(userId, topic, mediaType, direction);
|
|
1143
|
-
}
|
|
1144
|
-
// }, 7000);
|
|
1145
1124
|
|
|
1146
|
-
|
|
1125
|
+
if(chatMessaging.chatState) {
|
|
1126
|
+
callController.shouldReconnectTopic(userId, topic, mediaType, direction);
|
|
1127
|
+
}
|
|
1128
|
+
// }, 7000);
|
|
1129
|
+
//callController.removeConnectionQualityInterval(userId, topic);
|
|
1147
1130
|
}
|
|
1148
1131
|
|
|
1149
1132
|
if(user.peers[topic].peerConnection.connectionState === 'connected') {
|
|
@@ -1181,6 +1164,7 @@
|
|
|
1181
1164
|
});
|
|
1182
1165
|
if(chatMessaging.chatState) {
|
|
1183
1166
|
callController.shouldReconnectTopic(userId, topic, mediaType, direction);
|
|
1167
|
+
//callController.removeConnectionQualityInterval(userId, topic);
|
|
1184
1168
|
}
|
|
1185
1169
|
// } else {
|
|
1186
1170
|
// setTimeout(function () {
|
|
@@ -1220,9 +1204,11 @@
|
|
|
1220
1204
|
topic: topic
|
|
1221
1205
|
}, function (result) {
|
|
1222
1206
|
if (result.done === 'TRUE') {
|
|
1207
|
+
clearInterval(callUsers[userId].topicMetaData[topic].interval)
|
|
1223
1208
|
callController.removeTopic(userId, topic);
|
|
1224
1209
|
callController.createTopic(userId, topic, mediaType, direction, userId === 'screenShare');
|
|
1225
1210
|
} else if (result.done === 'SKIP') {
|
|
1211
|
+
clearInterval(callUsers[userId].topicMetaData[topic].interval)
|
|
1226
1212
|
callController.removeTopic(userId, topic);
|
|
1227
1213
|
callController.createTopic(userId, topic, mediaType, direction, userId === 'screenShare');
|
|
1228
1214
|
//generateAndSendSdpOffers(currentCallParams, [topicName]);
|
|
@@ -1246,7 +1232,7 @@
|
|
|
1246
1232
|
if(callUsers[i] && callUsers[i].peers[videoTopic] && callUsers[i].peers[videoTopic].peerConnection.connectionState === 'failed'){
|
|
1247
1233
|
this.shouldReconnectTopic(i, videoTopic, 'video', callUsers[i].direction)
|
|
1248
1234
|
}
|
|
1249
|
-
if(callUsers[i] && callUsers[i].peers[audioTopic] && callUsers[i].peers[
|
|
1235
|
+
if(callUsers[i] && callUsers[i].peers[audioTopic] && callUsers[i].peers[audioTopic].peerConnection.connectionState === 'failed'){
|
|
1250
1236
|
this.shouldReconnectTopic(i, audioTopic, 'audio', callUsers[i].direction)
|
|
1251
1237
|
}
|
|
1252
1238
|
}
|
|
@@ -1315,33 +1301,43 @@
|
|
|
1315
1301
|
}
|
|
1316
1302
|
},
|
|
1317
1303
|
removeAllCallParticipants: function () {
|
|
1318
|
-
|
|
1319
|
-
var
|
|
1320
|
-
|
|
1321
|
-
if(user
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1304
|
+
var removeAllUsersPromise = new Promise(function (resolve, reject) {
|
|
1305
|
+
for (var i in callUsers) {
|
|
1306
|
+
var user = callUsers[i];
|
|
1307
|
+
if (user) {
|
|
1308
|
+
if(user.videoTopicName && user.peers[user.videoTopicName]) {
|
|
1309
|
+
clearInterval(callUsers[i].topicMetaData[user.videoTopicName].interval);
|
|
1310
|
+
callStateController.removeConnectionQualityInterval(i, user.videoTopicName);
|
|
1311
|
+
callStateController.removeStreamFromWebRTC(i, user.videoTopicName);
|
|
1312
|
+
callUsers[i].peers[user.videoTopicName].dispose();
|
|
1313
|
+
delete callUsers[i].peers[user.videoTopicName];
|
|
1326
1314
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1315
|
+
}
|
|
1316
|
+
if(user.audioTopicName && user.peers[user.audioTopicName]) {
|
|
1317
|
+
clearInterval(callUsers[i].topicMetaData[user.audioTopicName].interval);
|
|
1318
|
+
callStateController.removeConnectionQualityInterval(i, user.audioTopicName);
|
|
1319
|
+
callStateController.removeStreamFromWebRTC(i, user.audioTopicName);
|
|
1331
1320
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
}
|
|
1335
|
-
setTimeout(function (){
|
|
1336
|
-
if(callUsers[i]){
|
|
1337
|
-
callUsers[i].peers = {};
|
|
1338
|
-
callUsers[i].topicMetaData = {};
|
|
1339
|
-
callUsers[i].htmlElements = {};
|
|
1340
|
-
callUsers[i] = null;
|
|
1321
|
+
callUsers[i].peers[user.audioTopicName].dispose();
|
|
1322
|
+
delete callUsers[i].peers[user.audioTopicName];
|
|
1341
1323
|
}
|
|
1342
|
-
|
|
1324
|
+
setTimeout(function (){
|
|
1325
|
+
if(callUsers[i]){
|
|
1326
|
+
callUsers[i].peers = {};
|
|
1327
|
+
callUsers[i].topicMetaData = {};
|
|
1328
|
+
callUsers[i].htmlElements = {};
|
|
1329
|
+
callUsers[i] = null;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
resolve()
|
|
1333
|
+
}, 200);
|
|
1334
|
+
}
|
|
1343
1335
|
}
|
|
1344
|
-
}
|
|
1336
|
+
});
|
|
1337
|
+
|
|
1338
|
+
removeAllUsersPromise.then(function (){
|
|
1339
|
+
callUsers = {};
|
|
1340
|
+
});
|
|
1345
1341
|
},
|
|
1346
1342
|
removeFromCallUI: function (topic) {
|
|
1347
1343
|
var videoElement = 'Vi-' + topic,
|
|
@@ -1364,7 +1360,25 @@
|
|
|
1364
1360
|
}
|
|
1365
1361
|
}
|
|
1366
1362
|
},
|
|
1363
|
+
activateParticipantStream: function (userId, mediaType, direction, topicNameKey, sendTopic, mediaKey) {
|
|
1364
|
+
if(callUsers[userId]) {
|
|
1365
|
+
callUsers[userId][mediaKey] = (mediaKey !== 'mute');
|
|
1366
|
+
callUsers[userId][topicNameKey] = (mediaType === 'audio'? 'Vo-': 'Vi-') + sendTopic;
|
|
1367
1367
|
|
|
1368
|
+
var user = callUsers[userId];
|
|
1369
|
+
callStateController.appendUserToCallDiv(userId, callStateController.generateHTMLElements(userId));
|
|
1370
|
+
setTimeout(function () {
|
|
1371
|
+
callStateController.createTopic(userId, user[topicNameKey], mediaType, direction);
|
|
1372
|
+
})
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
1375
|
+
deactivateParticipantStream: function (userId, topicNameKey, mediaKey) {
|
|
1376
|
+
callUsers[userId][mediaKey] = false;
|
|
1377
|
+
var user = callUsers[userId];
|
|
1378
|
+
clearInterval(callUsers[userId].topicMetaData[user[topicNameKey]].interval)
|
|
1379
|
+
callStateController.removeTopic(userId, user[topicNameKey]);
|
|
1380
|
+
callStateController.removeStreamFromWebRTC(userId, user[topicNameKey]);
|
|
1381
|
+
},
|
|
1368
1382
|
setMediaBitrates: function (sdp) {
|
|
1369
1383
|
return this.setMediaBitrate(this.setMediaBitrate(sdp, "video", 400), "audio", 50);
|
|
1370
1384
|
},
|
|
@@ -1405,7 +1419,7 @@
|
|
|
1405
1419
|
newLines = newLines.concat(lines.slice(line, lines.length));
|
|
1406
1420
|
consoleLogging && console.debug("[SDK][setMediaBitrate] output: ", newLines.join("\n"));
|
|
1407
1421
|
return newLines.join("\n")
|
|
1408
|
-
}
|
|
1422
|
+
},
|
|
1409
1423
|
},
|
|
1410
1424
|
|
|
1411
1425
|
sendCallSocketError = function (message) {
|
|
@@ -1593,6 +1607,12 @@
|
|
|
1593
1607
|
}
|
|
1594
1608
|
consoleLogging && console.log("[SDK][handleProcessSdpAnswer]", jsonMessage, jsonMessage.topic)
|
|
1595
1609
|
startMedia(callUsers[userId].htmlElements[jsonMessage.topic]);
|
|
1610
|
+
if(userId === 'screenShare') {
|
|
1611
|
+
restartMediaOnKeyFrame("screenShare", 2000);
|
|
1612
|
+
restartMediaOnKeyFrame("screenShare", 4000);
|
|
1613
|
+
restartMediaOnKeyFrame("screenShare", 8000);
|
|
1614
|
+
restartMediaOnKeyFrame("screenShare", 12000);
|
|
1615
|
+
}
|
|
1596
1616
|
});
|
|
1597
1617
|
},
|
|
1598
1618
|
|
|
@@ -1665,39 +1685,49 @@
|
|
|
1665
1685
|
currentCallId = null;
|
|
1666
1686
|
},
|
|
1667
1687
|
|
|
1668
|
-
|
|
1669
|
-
|
|
1688
|
+
/*
|
|
1689
|
+
removeStreamFromWebRTC = function (RTCStream) {
|
|
1690
|
+
var callParentDiv = document.getElementById(callDivId);
|
|
1691
|
+
|
|
1692
|
+
if (uiRemoteMedias.hasOwnProperty(RTCStream)) {
|
|
1693
|
+
const stream = uiRemoteMedias[RTCStream].srcObject;
|
|
1694
|
+
if (!!stream) {
|
|
1695
|
+
const tracks = stream.getTracks();
|
|
1670
1696
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1697
|
+
if (!!tracks) {
|
|
1698
|
+
tracks.forEach(function (track) {
|
|
1699
|
+
track.stop();
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1675
1702
|
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
track.stop();
|
|
1679
|
-
});
|
|
1680
|
-
}
|
|
1703
|
+
uiRemoteMedias[RTCStream].srcObject = null;
|
|
1704
|
+
}
|
|
1681
1705
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1706
|
+
uiRemoteMedias[RTCStream].remove();
|
|
1707
|
+
delete (uiRemoteMedias[RTCStream]);
|
|
1708
|
+
}
|
|
1709
|
+
},
|
|
1684
1710
|
|
|
1685
|
-
uiRemoteMedias[RTCStream].remove();
|
|
1686
|
-
delete (uiRemoteMedias[RTCStream]);
|
|
1687
|
-
}
|
|
1688
|
-
},
|
|
1689
1711
|
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1712
|
+
removeFromCallUI = function (topic) {
|
|
1713
|
+
var videoElement = 'Vi-' + topic;
|
|
1714
|
+
var audioElement = 'Vo-' + topic;
|
|
1693
1715
|
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1716
|
+
if (topic.length > 0 && uiRemoteMedias.hasOwnProperty(videoElement)) {
|
|
1717
|
+
removeStreamFromWebRTC(videoElement);
|
|
1718
|
+
}
|
|
1697
1719
|
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1720
|
+
if (topic.length > 0 && uiRemoteMedias.hasOwnProperty(audioElement)) {
|
|
1721
|
+
removeStreamFromWebRTC(audioElement);
|
|
1722
|
+
}
|
|
1723
|
+
},
|
|
1724
|
+
*/
|
|
1725
|
+
|
|
1726
|
+
restartMediaOnKeyFrame = function (userId, timeout) {
|
|
1727
|
+
setTimeout(function () {
|
|
1728
|
+
if(typeof callUsers[userId] !== "undefined" && callUsers[userId])
|
|
1729
|
+
restartMedia(callUsers[userId].videoTopicName);
|
|
1730
|
+
}, timeout);
|
|
1701
1731
|
};
|
|
1702
1732
|
|
|
1703
1733
|
this.updateToken = function (newToken) {
|
|
@@ -1723,18 +1753,38 @@
|
|
|
1723
1753
|
break;
|
|
1724
1754
|
|
|
1725
1755
|
case 'GET_KEY_FRAME':
|
|
1726
|
-
|
|
1727
|
-
|
|
1756
|
+
if(callUsers && callUsers[chatMessaging.userInfo.id] && callUsers[chatMessaging.userInfo.id].video) {
|
|
1757
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 2000);
|
|
1758
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 4000);
|
|
1759
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 8000);
|
|
1760
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 12000);
|
|
1761
|
+
}
|
|
1762
|
+
if(callUsers && callUsers['screenShare']
|
|
1763
|
+
&& callUsers['screenShare'].video
|
|
1764
|
+
&& screenShareState.started
|
|
1765
|
+
&& screenShareState.imOwner) {
|
|
1766
|
+
restartMediaOnKeyFrame('screenShare', 2000);
|
|
1767
|
+
restartMediaOnKeyFrame('screenShare', 4000);
|
|
1768
|
+
restartMediaOnKeyFrame('screenShare', 8000);
|
|
1769
|
+
restartMediaOnKeyFrame('screenShare', 12000);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
/* setTimeout(function () {
|
|
1773
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
1774
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
1728
1775
|
}, 2000);
|
|
1729
1776
|
setTimeout(function () {
|
|
1730
|
-
|
|
1777
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
1778
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
1731
1779
|
}, 4000);
|
|
1732
1780
|
setTimeout(function () {
|
|
1733
|
-
|
|
1781
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
1782
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
1734
1783
|
}, 8000);
|
|
1735
1784
|
setTimeout(function () {
|
|
1736
|
-
|
|
1737
|
-
|
|
1785
|
+
if(typeof callUsers[chatMessaging.userInfo.id] === "undefined" || !callUsers[chatMessaging.userInfo.id])
|
|
1786
|
+
restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
1787
|
+
}, 12000);*/
|
|
1738
1788
|
break;
|
|
1739
1789
|
|
|
1740
1790
|
case 'FREEZED':
|
|
@@ -1997,8 +2047,9 @@
|
|
|
1997
2047
|
type: 'CALL_PARTICIPANT_CONNECTED',
|
|
1998
2048
|
result: messageContent
|
|
1999
2049
|
});
|
|
2000
|
-
|
|
2001
|
-
restartMedia(
|
|
2050
|
+
//callTopics['sendVideoTopic']
|
|
2051
|
+
//restartMedia(callUsers[chatMessaging.userInfo.id].videoTopicName);
|
|
2052
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
2002
2053
|
|
|
2003
2054
|
break;
|
|
2004
2055
|
|
|
@@ -2077,8 +2128,8 @@
|
|
|
2077
2128
|
result: messageContent
|
|
2078
2129
|
});
|
|
2079
2130
|
|
|
2080
|
-
restartMedia(callTopics['sendVideoTopic']);
|
|
2081
|
-
|
|
2131
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
2132
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
2082
2133
|
break;
|
|
2083
2134
|
|
|
2084
2135
|
/**
|
|
@@ -2123,14 +2174,19 @@
|
|
|
2123
2174
|
} else {
|
|
2124
2175
|
if(Array.isArray(messageContent)){
|
|
2125
2176
|
for(var i in messageContent) {
|
|
2126
|
-
|
|
2177
|
+
callStateController.deactivateParticipantStream(
|
|
2178
|
+
messageContent[i].userId,
|
|
2179
|
+
'audioTopicName',
|
|
2180
|
+
'mute'
|
|
2181
|
+
)
|
|
2182
|
+
/*if(callUsers[messageContent[i].userId]) {
|
|
2127
2183
|
callUsers[messageContent[i].userId].mute = true;
|
|
2128
2184
|
|
|
2129
2185
|
var user = callUsers[messageContent[i].userId];
|
|
2130
2186
|
clearInterval(callUsers[messageContent[i].userId].topicMetaData[user.audioTopicName].interval)
|
|
2131
2187
|
callStateController.removeTopic(messageContent[i].userId, user.audioTopicName);
|
|
2132
2188
|
callStateController.removeStreamFromWebRTC(messageContent[i].userId, user.audioTopicName);
|
|
2133
|
-
}
|
|
2189
|
+
}*/
|
|
2134
2190
|
}
|
|
2135
2191
|
}
|
|
2136
2192
|
}
|
|
@@ -2151,7 +2207,15 @@
|
|
|
2151
2207
|
} else {
|
|
2152
2208
|
if(Array.isArray(messageContent)) {
|
|
2153
2209
|
for(var i in messageContent) {
|
|
2154
|
-
|
|
2210
|
+
callStateController.activateParticipantStream(
|
|
2211
|
+
messageContent[i].userId,
|
|
2212
|
+
'audio',
|
|
2213
|
+
'receive',
|
|
2214
|
+
'audioTopicName',
|
|
2215
|
+
messageContent[i].sendTopic,
|
|
2216
|
+
'mute'
|
|
2217
|
+
);
|
|
2218
|
+
/*if(callUsers[messageContent[i].userId]) {
|
|
2155
2219
|
callUsers[messageContent[i].userId].mute = false;
|
|
2156
2220
|
callUsers[messageContent[i].userId].audioTopicName = 'Vo-' + messageContent[i].sendTopic;
|
|
2157
2221
|
|
|
@@ -2161,7 +2225,7 @@
|
|
|
2161
2225
|
callStateController.createTopic(messageContent[i].userId, user.audioTopicName, 'audio', 'receive');
|
|
2162
2226
|
|
|
2163
2227
|
})
|
|
2164
|
-
}
|
|
2228
|
+
}*/
|
|
2165
2229
|
}
|
|
2166
2230
|
}
|
|
2167
2231
|
}
|
|
@@ -2207,7 +2271,15 @@
|
|
|
2207
2271
|
} else {
|
|
2208
2272
|
if(Array.isArray(messageContent)) {
|
|
2209
2273
|
for(var i in messageContent) {
|
|
2210
|
-
|
|
2274
|
+
callStateController.activateParticipantStream(
|
|
2275
|
+
messageContent[i].userId,
|
|
2276
|
+
'video',
|
|
2277
|
+
'receive',
|
|
2278
|
+
'videoTopicName',
|
|
2279
|
+
messageContent[i].sendTopic,
|
|
2280
|
+
'video'
|
|
2281
|
+
);
|
|
2282
|
+
/*if(callUsers[messageContent[i].userId]) {
|
|
2211
2283
|
callUsers[messageContent[i].userId].video = true;
|
|
2212
2284
|
callUsers[messageContent[i].userId].videoTopicName = 'Vi-' + messageContent[i].sendTopic;
|
|
2213
2285
|
|
|
@@ -2216,7 +2288,7 @@
|
|
|
2216
2288
|
setTimeout(function () {
|
|
2217
2289
|
callStateController.createTopic(messageContent[i].userId, user.videoTopicName, 'video', 'receive');
|
|
2218
2290
|
})
|
|
2219
|
-
}
|
|
2291
|
+
}*/
|
|
2220
2292
|
}
|
|
2221
2293
|
}
|
|
2222
2294
|
}
|
|
@@ -2244,13 +2316,18 @@
|
|
|
2244
2316
|
} else {
|
|
2245
2317
|
if(Array.isArray(messageContent)){
|
|
2246
2318
|
for(var i in messageContent) {
|
|
2247
|
-
|
|
2319
|
+
callStateController.deactivateParticipantStream(
|
|
2320
|
+
messageContent[i].userId,
|
|
2321
|
+
'videoTopicName',
|
|
2322
|
+
'video'
|
|
2323
|
+
)
|
|
2324
|
+
/* if(callUsers[messageContent[i].userId]) {
|
|
2248
2325
|
callUsers[messageContent[i].userId].video = false;
|
|
2249
2326
|
var user = callUsers[messageContent[i].userId];
|
|
2250
2327
|
clearInterval(callUsers[messageContent[i].userId].topicMetaData[user.videoTopicName].interval)
|
|
2251
2328
|
callStateController.removeTopic(messageContent[i].userId, user.videoTopicName);
|
|
2252
2329
|
callStateController.removeStreamFromWebRTC(messageContent[i].userId, user.videoTopicName);
|
|
2253
|
-
}
|
|
2330
|
+
}*/
|
|
2254
2331
|
}
|
|
2255
2332
|
}
|
|
2256
2333
|
}
|
|
@@ -2282,8 +2359,8 @@
|
|
|
2282
2359
|
result: messageContent
|
|
2283
2360
|
});
|
|
2284
2361
|
|
|
2285
|
-
restartMedia(callTopics['sendVideoTopic']);
|
|
2286
|
-
|
|
2362
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
2363
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
2287
2364
|
break;
|
|
2288
2365
|
|
|
2289
2366
|
/**
|
|
@@ -2379,8 +2456,8 @@
|
|
|
2379
2456
|
result: messageContent
|
|
2380
2457
|
});
|
|
2381
2458
|
|
|
2382
|
-
restartMedia(callTopics['sendVideoTopic']);
|
|
2383
|
-
|
|
2459
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
2460
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
2384
2461
|
break;
|
|
2385
2462
|
}
|
|
2386
2463
|
}
|
|
@@ -2672,7 +2749,8 @@
|
|
|
2672
2749
|
|
|
2673
2750
|
return chatMessaging.sendMessage(recordCallData, {
|
|
2674
2751
|
onResult: function (result) {
|
|
2675
|
-
restartMedia(callTopics['sendVideoTopic']);
|
|
2752
|
+
//restartMedia(callTopics['sendVideoTopic']);
|
|
2753
|
+
restartMediaOnKeyFrame(chatMessaging.userInfo.id, 100)
|
|
2676
2754
|
callback && callback(result);
|
|
2677
2755
|
}
|
|
2678
2756
|
});
|
|
@@ -3121,8 +3199,15 @@
|
|
|
3121
3199
|
sendMessageParams.content = params.userIds;
|
|
3122
3200
|
}
|
|
3123
3201
|
}
|
|
3202
|
+
callStateController.deactivateParticipantStream(
|
|
3203
|
+
chatMessaging.userInfo.id,
|
|
3204
|
+
'audioTopicName',
|
|
3205
|
+
'mute'
|
|
3206
|
+
)
|
|
3207
|
+
/*
|
|
3124
3208
|
callStateController.removeTopic(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].audioTopicName)
|
|
3125
3209
|
callStateController.removeStreamFromWebRTC(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].audioTopicName)
|
|
3210
|
+
*/
|
|
3126
3211
|
|
|
3127
3212
|
return chatMessaging.sendMessage(sendMessageParams, {
|
|
3128
3213
|
onResult: function (result) {
|
|
@@ -3164,6 +3249,26 @@
|
|
|
3164
3249
|
sendMessageParams.content = params.userIds;
|
|
3165
3250
|
}
|
|
3166
3251
|
}
|
|
3252
|
+
var myId = chatMessaging.userInfo.id;
|
|
3253
|
+
|
|
3254
|
+
callStateController.activateParticipantStream(
|
|
3255
|
+
myId,
|
|
3256
|
+
'audio',
|
|
3257
|
+
'send',
|
|
3258
|
+
'audioTopicName',
|
|
3259
|
+
callUsers[myId].topicSend,
|
|
3260
|
+
'mute'
|
|
3261
|
+
);
|
|
3262
|
+
/*if(callUsers[myId]) {
|
|
3263
|
+
callUsers[myId].mute = false;
|
|
3264
|
+
callUsers[myId].audioTopicName = 'Vo-' + callUsers[myId].topicSend;
|
|
3265
|
+
|
|
3266
|
+
var user = callUsers[myId];
|
|
3267
|
+
callStateController.appendUserToCallDiv(myId, callStateController.generateHTMLElements(myId));
|
|
3268
|
+
setTimeout(function () {
|
|
3269
|
+
callStateController.createTopic(myId, user.audioTopicName, 'audio', 'send');
|
|
3270
|
+
})
|
|
3271
|
+
}*/
|
|
3167
3272
|
|
|
3168
3273
|
return chatMessaging.sendMessage(sendMessageParams, {
|
|
3169
3274
|
onResult: function (result) {
|
|
@@ -3177,6 +3282,19 @@
|
|
|
3177
3282
|
// TODO : What is the result?!
|
|
3178
3283
|
var messageContent = result.result;
|
|
3179
3284
|
returnData.result = messageContent;
|
|
3285
|
+
|
|
3286
|
+
/*for(var i in result.result) {
|
|
3287
|
+
if(callUsers[result.result[i].userId]) {
|
|
3288
|
+
callUsers[result.result[i].userId].mute = false;
|
|
3289
|
+
callUsers[result.result[i].userId].audioTopicName = 'Vo-' + result.result[i].sendTopic;
|
|
3290
|
+
|
|
3291
|
+
var user = callUsers[result.result[i].userId];
|
|
3292
|
+
callStateController.appendUserToCallDiv(result.result[i].userId, callStateController.generateHTMLElements(result.result[i].userId));
|
|
3293
|
+
setTimeout(function () {
|
|
3294
|
+
callStateController.createTopic(result.result[i].userId, user.audioTopicName, 'audio', 'send');
|
|
3295
|
+
})
|
|
3296
|
+
}
|
|
3297
|
+
}*/
|
|
3180
3298
|
}
|
|
3181
3299
|
callback && callback(returnData);
|
|
3182
3300
|
}
|
|
@@ -3213,7 +3331,15 @@
|
|
|
3213
3331
|
onResult: function (result) {
|
|
3214
3332
|
if(!result.hasError && Array.isArray(result.result)) {
|
|
3215
3333
|
for(var i in result.result) {
|
|
3216
|
-
|
|
3334
|
+
callStateController.activateParticipantStream(
|
|
3335
|
+
result.result[i].userId,
|
|
3336
|
+
'video',
|
|
3337
|
+
'send',
|
|
3338
|
+
'videoTopicName',
|
|
3339
|
+
result.result[i].sendTopic,
|
|
3340
|
+
'video'
|
|
3341
|
+
);
|
|
3342
|
+
/*if(callUsers[result.result[i].userId]) {
|
|
3217
3343
|
callUsers[result.result[i].userId].video = true;
|
|
3218
3344
|
callUsers[result.result[i].userId].mute = result.result[i].mute;
|
|
3219
3345
|
callUsers[result.result[i].userId].videoTopicName = 'Vi-' + result.result[i].sendTopic;
|
|
@@ -3223,7 +3349,7 @@
|
|
|
3223
3349
|
setTimeout(function () {
|
|
3224
3350
|
callStateController.createTopic(result.result[i].userId, user.videoTopicName, 'video', 'send');
|
|
3225
3351
|
})
|
|
3226
|
-
}
|
|
3352
|
+
}*/
|
|
3227
3353
|
}
|
|
3228
3354
|
}
|
|
3229
3355
|
callback && callback(result);
|
|
@@ -3256,8 +3382,16 @@
|
|
|
3256
3382
|
});
|
|
3257
3383
|
return;
|
|
3258
3384
|
}
|
|
3385
|
+
|
|
3386
|
+
callStateController.deactivateParticipantStream(
|
|
3387
|
+
chatMessaging.userInfo.id,
|
|
3388
|
+
'videoTopicName',
|
|
3389
|
+
'video'
|
|
3390
|
+
)
|
|
3391
|
+
/*
|
|
3259
3392
|
callStateController.removeTopic(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].videoTopicName)
|
|
3260
3393
|
callStateController.removeStreamFromWebRTC(chatMessaging.userInfo.id, callUsers[chatMessaging.userInfo.id].videoTopicName)
|
|
3394
|
+
*/
|
|
3261
3395
|
|
|
3262
3396
|
return chatMessaging.sendMessage(turnOffVideoData, {
|
|
3263
3397
|
onResult: function (result) {
|
package/src/chat.js
CHANGED
|
@@ -2955,6 +2955,7 @@
|
|
|
2955
2955
|
case chatMessageVOTypes.TURN_OFF_VIDEO_CALL:
|
|
2956
2956
|
case chatMessageVOTypes.ACTIVE_CALL_PARTICIPANTS:
|
|
2957
2957
|
case chatMessageVOTypes.CALL_SESSION_CREATED:
|
|
2958
|
+
case chatMessageVOTypes.DESTINATED_RECORD_CALL:
|
|
2958
2959
|
callModule.handleChatMessages(type, chatMessageVOTypes, messageContent, contentCount, threadId, uniqueId);
|
|
2959
2960
|
break;
|
|
2960
2961
|
|
|
@@ -11389,7 +11390,7 @@
|
|
|
11389
11390
|
callbacks: callbacks
|
|
11390
11391
|
}, function () {
|
|
11391
11392
|
chatSendQueueHandler();
|
|
11392
|
-
});
|
|
11393
|
+
}, true);
|
|
11393
11394
|
};
|
|
11394
11395
|
|
|
11395
11396
|
this.deliver = function (params) {
|