@stream-io/video-client 1.11.5 → 1.11.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.11.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.11.5...@stream-io/video-client-1.11.6) (2024-11-22)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * force single codec preference in the SDP ([#1588](https://github.com/GetStream/stream-video-js/issues/1588)) ([4afff09](https://github.com/GetStream/stream-video-js/commit/4afff09a778f8567176d22bcc22d36001dca7cd3)), closes [#1581](https://github.com/GetStream/stream-video-js/issues/1581)
11
+
5
12
  ## [1.11.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.11.4...@stream-io/video-client-1.11.5) (2024-11-22)
6
13
 
7
14
 
@@ -3328,7 +3328,7 @@ const retryable = async (rpc, signal) => {
3328
3328
  return result;
3329
3329
  };
3330
3330
 
3331
- const version = "1.11.5";
3331
+ const version = "1.11.6";
3332
3332
  const [major, minor, patch] = version.split('.');
3333
3333
  let sdkInfo = {
3334
3334
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -3432,11 +3432,13 @@ var browsers = /*#__PURE__*/Object.freeze({
3432
3432
  * @param kind the kind of codec to get.
3433
3433
  * @param preferredCodec the codec to prioritize (vp8, h264, vp9, av1...).
3434
3434
  * @param codecToRemove the codec to exclude from the list.
3435
+ * @param codecPreferencesSource the source of the codec preferences.
3435
3436
  */
3436
- const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
3437
- if (!('getCapabilities' in RTCRtpReceiver))
3437
+ const getPreferredCodecs = (kind, preferredCodec, codecToRemove, codecPreferencesSource = 'receiver') => {
3438
+ const source = codecPreferencesSource === 'receiver' ? RTCRtpReceiver : RTCRtpSender;
3439
+ if (!('getCapabilities' in source))
3438
3440
  return;
3439
- const capabilities = RTCRtpReceiver.getCapabilities(kind);
3441
+ const capabilities = source.getCapabilities(kind);
3440
3442
  if (!capabilities)
3441
3443
  return;
3442
3444
  const preferred = [];
@@ -5874,9 +5876,9 @@ class Publisher {
5874
5876
  this.getStats = (selector) => {
5875
5877
  return this.pc.getStats(selector);
5876
5878
  };
5877
- this.getCodecPreferences = (trackType, preferredCodec) => {
5879
+ this.getCodecPreferences = (trackType, preferredCodec, codecPreferencesSource) => {
5878
5880
  if (trackType === TrackType.VIDEO) {
5879
- return getPreferredCodecs('video', preferredCodec || 'vp8');
5881
+ return getPreferredCodecs('video', preferredCodec || 'vp8', codecPreferencesSource);
5880
5882
  }
5881
5883
  if (trackType === TrackType.AUDIO) {
5882
5884
  const defaultAudioCodec = this.isRedEnabled ? 'red' : 'opus';
@@ -6108,8 +6110,8 @@ class Publisher {
6108
6110
  const opts = this.publishOptsForTrack.get(trackType);
6109
6111
  if (!opts || !opts.forceSingleCodec)
6110
6112
  return sdp;
6111
- const codec = opts.forceCodec || opts.preferredCodec;
6112
- const orderedCodecs = this.getCodecPreferences(trackType, codec);
6113
+ const codec = opts.forceCodec || getOptimalVideoCodec(opts.preferredCodec);
6114
+ const orderedCodecs = this.getCodecPreferences(trackType, codec, 'sender');
6113
6115
  if (!orderedCodecs || orderedCodecs.length === 0)
6114
6116
  return sdp;
6115
6117
  const transceiver = this.transceiverCache.get(trackType);
@@ -13063,7 +13065,7 @@ class StreamClient {
13063
13065
  });
13064
13066
  };
13065
13067
  this.getUserAgent = () => {
13066
- const version = "1.11.5";
13068
+ const version = "1.11.6";
13067
13069
  return (this.userAgent ||
13068
13070
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
13069
13071
  };