@stream-io/video-client 0.7.2 → 0.7.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/dist/index.es.js CHANGED
@@ -5832,6 +5832,11 @@ const logToConsole = (logLevel, message, ...args) => {
5832
5832
  let logMethod;
5833
5833
  switch (logLevel) {
5834
5834
  case 'error':
5835
+ if (isReactNative()) {
5836
+ message = `ERROR: ${message}`;
5837
+ logMethod = console.info;
5838
+ break;
5839
+ }
5835
5840
  logMethod = console.error;
5836
5841
  break;
5837
5842
  case 'warn':
@@ -5876,11 +5881,11 @@ const getLogger = (withTags) => {
5876
5881
 
5877
5882
  const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
5878
5883
  const logger = getLogger(['codecs']);
5879
- if (!('getCapabilities' in RTCRtpSender)) {
5880
- logger?.('warn', 'RTCRtpSender.getCapabilities is not supported');
5884
+ if (!('getCapabilities' in RTCRtpReceiver)) {
5885
+ logger('warn', 'RTCRtpReceiver.getCapabilities is not supported');
5881
5886
  return;
5882
5887
  }
5883
- const cap = RTCRtpSender.getCapabilities(kind);
5888
+ const cap = RTCRtpReceiver.getCapabilities(kind);
5884
5889
  if (!cap)
5885
5890
  return;
5886
5891
  const matched = [];
@@ -5888,7 +5893,7 @@ const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
5888
5893
  const unmatched = [];
5889
5894
  cap.codecs.forEach((c) => {
5890
5895
  const codec = c.mimeType.toLowerCase();
5891
- logger?.('debug', `Found supported codec: ${codec}`);
5896
+ logger('debug', `Found supported codec: ${codec}`);
5892
5897
  const shouldRemoveCodec = codecToRemove && codec === `${kind}/${codecToRemove.toLowerCase()}`;
5893
5898
  if (shouldRemoveCodec)
5894
5899
  return;
@@ -5910,9 +5915,7 @@ const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
5910
5915
  }
5911
5916
  matched.push(c);
5912
5917
  });
5913
- const result = [...matched, ...partialMatched, ...unmatched];
5914
- logger?.('info', `Preffered codecs: `, result);
5915
- return result;
5918
+ return [...matched, ...partialMatched, ...unmatched];
5916
5919
  };
5917
5920
  const getGenericSdp = async (direction) => {
5918
5921
  const tempPc = new RTCPeerConnection();
@@ -7713,7 +7716,12 @@ class Publisher {
7713
7716
  this.publishOptionsPerTrackType.set(trackType, opts);
7714
7717
  if ('setCodecPreferences' in transceiver && codecPreferences) {
7715
7718
  logger$3('info', `Setting ${TrackType[trackType]} codec preferences`, codecPreferences);
7716
- transceiver.setCodecPreferences(codecPreferences);
7719
+ try {
7720
+ transceiver.setCodecPreferences(codecPreferences);
7721
+ }
7722
+ catch (err) {
7723
+ logger$3('warn', `Couldn't set codec preferences`, err);
7724
+ }
7717
7725
  }
7718
7726
  }
7719
7727
  else {
@@ -14460,7 +14468,7 @@ class StreamClient {
14460
14468
  });
14461
14469
  };
14462
14470
  this.getUserAgent = () => {
14463
- const version = "0.7.2" ;
14471
+ const version = "0.7.3" ;
14464
14472
  return (this.userAgent ||
14465
14473
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14466
14474
  };