@webex/web-client-media-engine 3.24.0 → 3.24.1

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/esm/index.js CHANGED
@@ -7794,6 +7794,7 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7794
7794
  var trace = function (name, payload, timestamp) {
7795
7795
  logger({ timestamp: timestamp ? Math.round(timestamp) : Date.now(), name: name, payload: payload });
7796
7796
  };
7797
+ trace('rtcConfiguration', makeEvent(JSON.stringify(pc.getConfiguration())));
7797
7798
  var origPeerConnection = window.RTCPeerConnection;
7798
7799
  pc.addEventListener('icecandidate', function (e) {
7799
7800
  if (e.candidate) {
@@ -7827,7 +7828,7 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7827
7828
  pc.addEventListener('datachannel', function (event) {
7828
7829
  trace('ondatachannel', makeEvent("".concat(event.channel.id, ": ").concat(event.channel.label)));
7829
7830
  });
7830
- ['createDataChannel', 'close'].forEach(function (method) {
7831
+ ['close'].forEach(function (method) {
7831
7832
  var nativeMethod = origPeerConnection.prototype[method];
7832
7833
  if (nativeMethod) {
7833
7834
  origPeerConnection.prototype[method] = function () {
@@ -7836,6 +7837,26 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7836
7837
  };
7837
7838
  }
7838
7839
  });
7840
+ ['createDataChannel'].forEach(function (method) {
7841
+ var nativeMethod = origPeerConnection.prototype[method];
7842
+ if (nativeMethod) {
7843
+ origPeerConnection.prototype[method] = function () {
7844
+ trace("on".concat(method), makeEvent(method));
7845
+ var dataChannel = nativeMethod.apply(this, arguments);
7846
+ dataChannel.addEventListener('open', function () {
7847
+ trace("ondataChannelOpen", makeEvent("".concat(dataChannel.id, ":").concat(dataChannel.label)));
7848
+ });
7849
+ dataChannel.addEventListener('close', function () {
7850
+ trace("ondataChannelClose", makeEvent("".concat(dataChannel.id, ":").concat(dataChannel.label)));
7851
+ });
7852
+ dataChannel.addEventListener('error', function (event) {
7853
+ var error = event.error;
7854
+ trace("ondataChannelError", makeEvent("".concat(dataChannel.id, ":").concat(dataChannel.label, ": ").concat(error.errorDetail)));
7855
+ });
7856
+ return dataChannel;
7857
+ };
7858
+ }
7859
+ });
7839
7860
  ['addStream', 'removeStream'].forEach(function (method) {
7840
7861
  var nativeMethod = origPeerConnection.prototype[method];
7841
7862
  if (nativeMethod) {
@@ -7910,7 +7931,9 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7910
7931
  origPeerConnection.prototype[method] = function () {
7911
7932
  var _this = this;
7912
7933
  var args = arguments;
7913
- trace("on".concat(method), makeEvent(method === 'addIceCandidate' ? arguments[0] : arguments[0].sdp));
7934
+ trace("on".concat(method), makeEvent(method === 'addIceCandidate'
7935
+ ? arguments[0]
7936
+ : (arguments[0] ? arguments[0].sdp : 'undefined')));
7914
7937
  return nativeMethod.apply(this, [arguments[0]]).then(function () {
7915
7938
  var _a;
7916
7939
  trace("on".concat(method, "OnSuccess"), makeEvent('success'));