podchat-browser 12.1.0 → 12.1.1-snapshot.3

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 CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented here.
4
4
  to see complete list of changelog please visit [ChangeLog](https://github.com/masoudmanson/pod-chat/blob/master/changelog.md)
5
5
 
6
+ ## [12.1.0] - 2021-12-25
7
+ ### Added
8
+ - Browsers default "stop sharing" button event handler
9
+ - Sample to admin a user in a thread
10
+
11
+ ### Fixed
12
+ - rejectCall in p2p calls
13
+ - exportChat result headers not readable
14
+
15
+ ## [11.4.3] - 2021-12-13
16
+ ### Added
17
+ - Poor Connection metadata
18
+
19
+
6
20
  ## [11.4.2] - 2021-12-13
7
21
  ### Added
8
22
  - Call metadata
@@ -30,7 +30,7 @@
30
30
  <script type="text/javascript">
31
31
  // Developement
32
32
  var PodChat = window.POD.Chat;
33
- var env = 'sandbox'; // main | sandbox | integration
33
+ var env = 'main'; // main | sandbox | integration
34
34
 
35
35
  var params = {
36
36
  appId: new Date().getTime(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podchat-browser",
3
- "version": "12.1.0",
3
+ "version": "12.1.1-snapshot.3",
4
4
  "description": "Javascript SDK to use POD's Chat Service - Browser Only",
5
5
  "main": "./src/chat.js",
6
6
  "scripts": {
@@ -156,6 +156,7 @@
156
156
  'VIDEO': 0x1
157
157
  },
158
158
  callOptions = params.callOptions,
159
+ useInternalTurnAddress = !!(params.callOptions && params.callOptions.useInternalTurnAddress),
159
160
  callTurnIp = (params.callOptions
160
161
  && params.callOptions.hasOwnProperty('callTurnIp')
161
162
  && typeof params.callOptions.callTurnIp === 'string')
@@ -217,7 +218,6 @@
217
218
  },
218
219
  cameraPaused: true
219
220
  },
220
- uiRemoteMedias = {},
221
221
  callStopQueue = {
222
222
  callStarted: false,
223
223
  },
@@ -839,7 +839,6 @@
839
839
  })
840
840
  options.videoStream = stream;
841
841
  options.sendSource = 'screen';
842
- // options[(direction === 'send' ? 'localVideo' : 'remoteVideo')] = uiRemoteMedias[topic];
843
842
  resolve(options);
844
843
  }).catch(function (error) {
845
844
  console.error("[SDK][navigator.mediaDevices.getDisplayMedia]", error);
@@ -853,9 +852,12 @@
853
852
  });
854
853
  },
855
854
  getTurnServer: function (params) {
856
- if (!!params.turnAddress && params.turnAddress.length > 0) {
857
- var serversTemp = params.turnAddress.split(',');
858
855
 
856
+ if (!!params.turnAddress && params.turnAddress.length > 0
857
+ || (useInternalTurnAddress && !!params.internalTurnAddress && params.turnAddress.length > 0 )) {
858
+
859
+ var serversTemp = useInternalTurnAddress ? params.internalTurnAddress.split(',') : params.turnAddress.split(',');
860
+ console.log({useInternalTurnAddress}, params.internalTurnAddress.split(','))
859
861
  return [
860
862
  {
861
863
  "urls": "turn:" + serversTemp[0],
@@ -1040,11 +1042,21 @@
1040
1042
  }
1041
1043
 
1042
1044
  if(user.peers[topic].peerConnection.connectionState === 'connected') {
1043
- if(mediaType === 'video' && direction === 'send') {
1044
- user.topicMetaData[topic].connectionQualityInterval = setInterval(function() {
1045
- callController.checkConnectionQuality(userId, topic, mediaType, direction)
1046
- }, 1000);
1045
+ if(mediaType === 'video') {
1046
+ if(direction === 'send') {
1047
+ user.topicMetaData[topic].connectionQualityInterval = setInterval(function() {
1048
+ callController.checkConnectionQuality(userId, topic, mediaType, direction)
1049
+ }, 1000);
1050
+ }
1051
+
1052
+ if(direction === 'receive') {
1053
+ chatEvents.fireEvent("callEvents", {
1054
+ type: "RECEIVE_VIDEO_CONNECTION_ESTABLISHED",
1055
+ userId: userId
1056
+ })
1057
+ }
1047
1058
  }
1059
+
1048
1060
  }
1049
1061
  }
1050
1062
 
@@ -1598,43 +1610,6 @@
1598
1610
  currentCallId = null;
1599
1611
  },
1600
1612
 
1601
- /*
1602
- removeStreamFromWebRTC = function (RTCStream) {
1603
- var callParentDiv = document.getElementById(callDivId);
1604
-
1605
- if (uiRemoteMedias.hasOwnProperty(RTCStream)) {
1606
- const stream = uiRemoteMedias[RTCStream].srcObject;
1607
- if (!!stream) {
1608
- const tracks = stream.getTracks();
1609
-
1610
- if (!!tracks) {
1611
- tracks.forEach(function (track) {
1612
- track.stop();
1613
- });
1614
- }
1615
-
1616
- uiRemoteMedias[RTCStream].srcObject = null;
1617
- }
1618
-
1619
- uiRemoteMedias[RTCStream].remove();
1620
- delete (uiRemoteMedias[RTCStream]);
1621
- }
1622
- },
1623
-
1624
-
1625
- removeFromCallUI = function (topic) {
1626
- var videoElement = 'Vi-' + topic;
1627
- var audioElement = 'Vo-' + topic;
1628
-
1629
- if (topic.length > 0 && uiRemoteMedias.hasOwnProperty(videoElement)) {
1630
- removeStreamFromWebRTC(videoElement);
1631
- }
1632
-
1633
- if (topic.length > 0 && uiRemoteMedias.hasOwnProperty(audioElement)) {
1634
- removeStreamFromWebRTC(audioElement);
1635
- }
1636
- },
1637
- */
1638
1613
 
1639
1614
  restartMediaOnKeyFrame = function (userId, timeout) {
1640
1615
  setTimeout(function () {
@@ -1708,6 +1683,14 @@
1708
1683
 
1709
1684
  asyncRequestTimeouts[uniqueId] && clearTimeout(asyncRequestTimeouts[uniqueId]);
1710
1685
 
1686
+ if(jsonMessage.done === 'FALSE') {
1687
+ chatEvents.fireEvent('callEvents', {
1688
+ type: 'CALL_ERROR',
1689
+ code: 7000,
1690
+ message: "Kurento error: " + (jsonMessage.desc ? jsonMessage.desc : jsonMessage.message)
1691
+ });
1692
+ }
1693
+
1711
1694
  switch (jsonMessage.id) {
1712
1695
  case 'PROCESS_SDP_ANSWER':
1713
1696
  handleProcessSdpAnswer(jsonMessage);
@@ -1923,6 +1906,7 @@
1923
1906
  screenShare: messageContent.chatDataDto.screenShare,
1924
1907
  brokerAddress: messageContent.chatDataDto.brokerAddressWeb,
1925
1908
  turnAddress: messageContent.chatDataDto.turnAddress,
1909
+ internalTurnAddress: messageContent.chatDataDto.internalTurnAddress,
1926
1910
  selfData: messageContent.clientDTO,
1927
1911
  clientsList: messageContent.otherClientDtoList
1928
1912
  }, function (callDivs) {
package/src/chat.js CHANGED
@@ -13601,7 +13601,7 @@
13601
13601
  requestExportChat(stackArr, wantedCount, stepCount, offset, sendData).then(function (result) {
13602
13602
  consoleLogging && console.log("[SDK][exportChat] Export done..., Now converting...");
13603
13603
 
13604
- var exportedFilename = 'export-' + params.threadId + '.csv',
13604
+ var exportedFilename = (params.fileName || 'export-' + params.threadId) + '.csv',
13605
13605
  responseType = params.responseType !== null ? params.responseType : "blob",
13606
13606
  autoStartDownload = params.autoStartDownload !== null ? params.autoStartDownload : true
13607
13607