@webex/web-client-media-engine 3.24.0 → 3.24.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/dist/cjs/index.js CHANGED
@@ -613,8 +613,11 @@ function createDisplayStreamWithAudio(displayStreamConstructor, systemAudioStrea
613
613
  function getDevices(deviceKind) {
614
614
  return __awaiter$2(this, void 0, void 0, function* () {
615
615
  let devices;
616
+ const deviceKinds = deviceKind
617
+ ? [deviceKind]
618
+ : [DeviceKind$1.AudioInput, DeviceKind$1.VideoInput];
616
619
  try {
617
- devices = yield ensureDevicePermissions([DeviceKind$1.AudioInput, DeviceKind$1.VideoInput], enumerateDevices);
620
+ devices = yield ensureDevicePermissions(deviceKinds, enumerateDevices);
618
621
  }
619
622
  catch (error) {
620
623
  throw new WebrtcCoreError(exports.WebrtcCoreErrorType.DEVICE_PERMISSION_DENIED, 'Failed to ensure device permissions');
@@ -7798,6 +7801,7 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7798
7801
  var trace = function (name, payload, timestamp) {
7799
7802
  logger({ timestamp: timestamp ? Math.round(timestamp) : Date.now(), name: name, payload: payload });
7800
7803
  };
7804
+ trace('rtcConfiguration', makeEvent(JSON.stringify(pc.getConfiguration())));
7801
7805
  var origPeerConnection = window.RTCPeerConnection;
7802
7806
  pc.addEventListener('icecandidate', function (e) {
7803
7807
  if (e.candidate) {
@@ -7831,7 +7835,7 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7831
7835
  pc.addEventListener('datachannel', function (event) {
7832
7836
  trace('ondatachannel', makeEvent("".concat(event.channel.id, ": ").concat(event.channel.label)));
7833
7837
  });
7834
- ['createDataChannel', 'close'].forEach(function (method) {
7838
+ ['close'].forEach(function (method) {
7835
7839
  var nativeMethod = origPeerConnection.prototype[method];
7836
7840
  if (nativeMethod) {
7837
7841
  origPeerConnection.prototype[method] = function () {
@@ -7840,6 +7844,26 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7840
7844
  };
7841
7845
  }
7842
7846
  });
7847
+ ['createDataChannel'].forEach(function (method) {
7848
+ var nativeMethod = origPeerConnection.prototype[method];
7849
+ if (nativeMethod) {
7850
+ origPeerConnection.prototype[method] = function () {
7851
+ trace("on".concat(method), makeEvent(method));
7852
+ var dataChannel = nativeMethod.apply(this, arguments);
7853
+ dataChannel.addEventListener('open', function () {
7854
+ trace("ondataChannelOpen", makeEvent("".concat(dataChannel.id, ":").concat(dataChannel.label)));
7855
+ });
7856
+ dataChannel.addEventListener('close', function () {
7857
+ trace("ondataChannelClose", makeEvent("".concat(dataChannel.id, ":").concat(dataChannel.label)));
7858
+ });
7859
+ dataChannel.addEventListener('error', function (event) {
7860
+ var error = event.error;
7861
+ trace("ondataChannelError", makeEvent("".concat(dataChannel.id, ":").concat(dataChannel.label, ": ").concat(error.errorDetail)));
7862
+ });
7863
+ return dataChannel;
7864
+ };
7865
+ }
7866
+ });
7843
7867
  ['addStream', 'removeStream'].forEach(function (method) {
7844
7868
  var nativeMethod = origPeerConnection.prototype[method];
7845
7869
  if (nativeMethod) {
@@ -7914,7 +7938,9 @@ var rtcStats = function (pc, logger, intervalTime, statsPreProcessor) {
7914
7938
  origPeerConnection.prototype[method] = function () {
7915
7939
  var _this = this;
7916
7940
  var args = arguments;
7917
- trace("on".concat(method), makeEvent(method === 'addIceCandidate' ? arguments[0] : arguments[0].sdp));
7941
+ trace("on".concat(method), makeEvent(method === 'addIceCandidate'
7942
+ ? arguments[0]
7943
+ : (arguments[0] ? arguments[0].sdp : 'undefined')));
7918
7944
  return nativeMethod.apply(this, [arguments[0]]).then(function () {
7919
7945
  var _a;
7920
7946
  trace("on".concat(method, "OnSuccess"), makeEvent('success'));