@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.cjs.js CHANGED
@@ -5852,6 +5852,11 @@ const logToConsole = (logLevel, message, ...args) => {
5852
5852
  let logMethod;
5853
5853
  switch (logLevel) {
5854
5854
  case 'error':
5855
+ if (isReactNative()) {
5856
+ message = `ERROR: ${message}`;
5857
+ logMethod = console.info;
5858
+ break;
5859
+ }
5855
5860
  logMethod = console.error;
5856
5861
  break;
5857
5862
  case 'warn':
@@ -5896,11 +5901,11 @@ const getLogger = (withTags) => {
5896
5901
 
5897
5902
  const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
5898
5903
  const logger = getLogger(['codecs']);
5899
- if (!('getCapabilities' in RTCRtpSender)) {
5900
- logger?.('warn', 'RTCRtpSender.getCapabilities is not supported');
5904
+ if (!('getCapabilities' in RTCRtpReceiver)) {
5905
+ logger('warn', 'RTCRtpReceiver.getCapabilities is not supported');
5901
5906
  return;
5902
5907
  }
5903
- const cap = RTCRtpSender.getCapabilities(kind);
5908
+ const cap = RTCRtpReceiver.getCapabilities(kind);
5904
5909
  if (!cap)
5905
5910
  return;
5906
5911
  const matched = [];
@@ -5908,7 +5913,7 @@ const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
5908
5913
  const unmatched = [];
5909
5914
  cap.codecs.forEach((c) => {
5910
5915
  const codec = c.mimeType.toLowerCase();
5911
- logger?.('debug', `Found supported codec: ${codec}`);
5916
+ logger('debug', `Found supported codec: ${codec}`);
5912
5917
  const shouldRemoveCodec = codecToRemove && codec === `${kind}/${codecToRemove.toLowerCase()}`;
5913
5918
  if (shouldRemoveCodec)
5914
5919
  return;
@@ -5930,9 +5935,7 @@ const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
5930
5935
  }
5931
5936
  matched.push(c);
5932
5937
  });
5933
- const result = [...matched, ...partialMatched, ...unmatched];
5934
- logger?.('info', `Preffered codecs: `, result);
5935
- return result;
5938
+ return [...matched, ...partialMatched, ...unmatched];
5936
5939
  };
5937
5940
  const getGenericSdp = async (direction) => {
5938
5941
  const tempPc = new RTCPeerConnection();
@@ -7733,7 +7736,12 @@ class Publisher {
7733
7736
  this.publishOptionsPerTrackType.set(trackType, opts);
7734
7737
  if ('setCodecPreferences' in transceiver && codecPreferences) {
7735
7738
  logger$3('info', `Setting ${TrackType[trackType]} codec preferences`, codecPreferences);
7736
- transceiver.setCodecPreferences(codecPreferences);
7739
+ try {
7740
+ transceiver.setCodecPreferences(codecPreferences);
7741
+ }
7742
+ catch (err) {
7743
+ logger$3('warn', `Couldn't set codec preferences`, err);
7744
+ }
7737
7745
  }
7738
7746
  }
7739
7747
  else {
@@ -14480,7 +14488,7 @@ class StreamClient {
14480
14488
  });
14481
14489
  };
14482
14490
  this.getUserAgent = () => {
14483
- const version = "0.7.2" ;
14491
+ const version = "0.7.3" ;
14484
14492
  return (this.userAgent ||
14485
14493
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14486
14494
  };