@flashphoner/websdk 2.0.235 → 2.0.236

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.
@@ -2259,7 +2259,6 @@ SDPUtils.parseRtpMap = function (line) {
2259
2259
  var parsed = {
2260
2260
  payloadType: parseInt(parts.shift(), 10) // was: id
2261
2261
  };
2262
-
2263
2262
  parts = parts[0].split('/');
2264
2263
  parsed.name = parts[0];
2265
2264
  parsed.clockRate = parseInt(parts[1], 10); // was: clockrate
@@ -2822,7 +2821,6 @@ SDPUtils.getDirection = function (mediaSection, sessionpart) {
2822
2821
  // FIXME: What should happen here?
2823
2822
  }
2824
2823
  }
2825
-
2826
2824
  if (sessionpart) {
2827
2825
  return SDPUtils.getDirection(sessionpart);
2828
2826
  }
@@ -2871,7 +2869,6 @@ SDPUtils.isValidSDP = function (blob) {
2871
2869
  }
2872
2870
  // TODO: check the modifier a bit more.
2873
2871
  }
2874
-
2875
2872
  return true;
2876
2873
  };
2877
2874
 
@@ -4104,7 +4101,6 @@ function shimGetSendersWithDtmf(window) {
4104
4101
  this._senders = this._senders || [];
4105
4102
  return this._senders.slice(); // return a copy of the internal state.
4106
4103
  };
4107
-
4108
4104
  var origAddTrack = window.RTCPeerConnection.prototype.addTrack;
4109
4105
  window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) {
4110
4106
  var sender = origAddTrack.apply(this, arguments);
@@ -4841,7 +4837,6 @@ function shimGetUserMedia(window, browserDetails) {
4841
4837
  if (!dev && devices.length && matches.includes('back')) {
4842
4838
  dev = devices[devices.length - 1]; // more likely the back cam
4843
4839
  }
4844
-
4845
4840
  if (dev) {
4846
4841
  constraints.video.deviceId = face.exact ? {
4847
4842
  exact: dev.deviceId
@@ -5646,7 +5641,6 @@ function shimPeerConnection(window, browserDetails) {
5646
5641
  if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !(window.RTCPeerConnection || window.mozRTCPeerConnection)) {
5647
5642
  return; // probably media.peerconnection.enabled=false in about:config
5648
5643
  }
5649
-
5650
5644
  if (!window.RTCPeerConnection && window.mozRTCPeerConnection) {
5651
5645
  // very basic support for old versions.
5652
5646
  window.RTCPeerConnection = window.mozRTCPeerConnection;
@@ -10437,8 +10431,7 @@ var processRtcStatsReport = function processRtcStatsReport(browser, report) {
10437
10431
  };
10438
10432
  var Browser = {
10439
10433
  isIE: function isIE() {
10440
- return (/*@cc_on!@*/false || !!document.documentMode
10441
- );
10434
+ return /*@cc_on!@*/false || !!document.documentMode;
10442
10435
  },
10443
10436
  isFirefox: function isFirefox() {
10444
10437
  return typeof InstallTrigger !== 'undefined';
@@ -11227,18 +11220,18 @@ var createConnection = function createConnection(options) {
11227
11220
  if (stat) {
11228
11221
  stat.forEach(function (report) {
11229
11222
  if (!report.isRemote) {
11223
+ var mediaType = "";
11230
11224
  if (report.type == 'outbound-rtp') {
11231
- fillStatObject(result.outboundStream, report);
11232
- if (report.mediaType == 'video' && localVideo != undefined && localVideo != null) {
11233
- var vSettings = localVideo.srcObject.getVideoTracks()[0].getSettings();
11234
- result.outboundStream[report.mediaType].height = vSettings.height;
11235
- result.outboundStream[report.mediaType].width = vSettings.width;
11225
+ mediaType = getReportMediaType(report);
11226
+ fillStatObject(result.outboundStream, report, mediaType);
11227
+ if (mediaType == 'video') {
11228
+ getVideoSize(result.outboundStream[mediaType], report);
11236
11229
  }
11237
11230
  } else if (report.type == 'inbound-rtp') {
11238
- fillStatObject(result.inboundStream, report);
11239
- if (report.mediaType == 'video' && remoteVideo != undefined && remoteVideo != null) {
11240
- result.inboundStream[report.mediaType].height = remoteVideo.videoHeight;
11241
- result.inboundStream[report.mediaType].width = remoteVideo.videoWidth;
11231
+ mediaType = getReportMediaType(report);
11232
+ fillStatObject(result.inboundStream, report, mediaType);
11233
+ if (mediaType == 'video') {
11234
+ getVideoSize(result.inboundStream[mediaType], report);
11242
11235
  }
11243
11236
  }
11244
11237
  }
@@ -11249,8 +11242,40 @@ var createConnection = function createConnection(options) {
11249
11242
  }
11250
11243
  }
11251
11244
  };
11252
- function fillStatObject(obj, report) {
11253
- var mediaType = report.mediaType;
11245
+ var getReportMediaType = function getReportMediaType(report) {
11246
+ // Since Safari 17 report.mediaType is undefined #WCS-3922
11247
+ if (report.mediaType !== undefined) {
11248
+ return report.mediaType;
11249
+ } else if (report.kind !== undefined) {
11250
+ return report.kind;
11251
+ }
11252
+ logger.warn(LOG_PREFIX, "No media type provided in WebRTC statistics");
11253
+ return "media";
11254
+ };
11255
+ var getVideoSize = function getVideoSize(obj, report) {
11256
+ var videoSize = {};
11257
+ if (report.type == 'outbound-rtp') {
11258
+ if (localVideo !== undefined && localVideo != null) {
11259
+ videoSize = localVideo.srcObject.getVideoTracks()[0].getSettings();
11260
+ }
11261
+ } else if (report.type == 'inbound-rtp') {
11262
+ if (remoteVideo !== undefined && remoteVideo != null) {
11263
+ videoSize.width = remoteVideo.videoWidth;
11264
+ videoSize.height = remoteVideo.videoHeight;
11265
+ }
11266
+ }
11267
+ if (report.frameWidth !== undefined) {
11268
+ obj.width = report.frameWidth;
11269
+ } else if (videoSize.width !== undefined) {
11270
+ obj.width = videoSize.width;
11271
+ }
11272
+ if (report.frameHeight !== undefined) {
11273
+ obj.height = report.frameHeight;
11274
+ } else if (videoSize.height !== undefined) {
11275
+ obj.height = videoSize.height;
11276
+ }
11277
+ };
11278
+ var fillStatObject = function fillStatObject(obj, report, mediaType) {
11254
11279
  obj[mediaType] = {};
11255
11280
  //WCS-1922, currentRemoteDescription - browser compatibilitySection: Chrome 70, FF 57, Safari 11
11256
11281
  var description = connection.currentRemoteDescription != undefined ? connection.currentRemoteDescription : connection.remoteDescription;
@@ -11266,11 +11291,11 @@ var createConnection = function createConnection(options) {
11266
11291
  obj[mediaType]["codecRate"] = codec.sampleRate;
11267
11292
  Object.keys(report).forEach(function (key) {
11268
11293
  // Add audioLevel parameter parsing #WCS-3290
11269
- if (key.startsWith("bytes") || key.startsWith("packets") || key.indexOf("Count") != -1 || key.indexOf("audioLevel") != -1) {
11294
+ if (key.startsWith("bytes") || key.startsWith("packets") || key.indexOf("Count") != -1 || key.indexOf("audioLevel") != -1 || key == "framesPerSecond") {
11270
11295
  obj[mediaType][key] = report[key];
11271
11296
  }
11272
11297
  });
11273
- }
11298
+ };
11274
11299
  var fullScreen = function fullScreen() {
11275
11300
  var video = document.getElementById(id);
11276
11301
  if (video) {