@stream-io/video-client 1.37.0 → 1.37.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/index.es.js CHANGED
@@ -4991,6 +4991,17 @@ class CallState {
4991
4991
  this.setAnonymousParticipantCount = (count) => {
4992
4992
  return this.setCurrentValue(this.anonymousParticipantCountSubject, count);
4993
4993
  };
4994
+ /**
4995
+ * Returns the current participants array directly from the BehaviorSubject.
4996
+ * This bypasses the observable pipeline and is guaranteed to be synchronous.
4997
+ * Use this when you need the absolute latest value without any potential
4998
+ * timing issues from shareReplay/refCount.
4999
+ *
5000
+ * @internal
5001
+ */
5002
+ this.getParticipantsSnapshot = () => {
5003
+ return this.participantsSubject.getValue();
5004
+ };
4994
5005
  /**
4995
5006
  * Sets the list of participants in the current call.
4996
5007
  *
@@ -5970,7 +5981,7 @@ const getSdkVersion = (sdk) => {
5970
5981
  return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
5971
5982
  };
5972
5983
 
5973
- const version = "1.37.0";
5984
+ const version = "1.37.1";
5974
5985
  const [major, minor, patch] = version.split('.');
5975
5986
  let sdkInfo = {
5976
5987
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -9447,13 +9458,19 @@ class DynascaleManager {
9447
9458
  }
9448
9459
  get trackSubscriptions() {
9449
9460
  const subscriptions = [];
9450
- for (const p of this.callState.remoteParticipants) {
9461
+ // Use getParticipantsSnapshot() to bypass the observable pipeline
9462
+ // and avoid stale data caused by shareReplay with no active subscribers
9463
+ const participants = this.callState.getParticipantsSnapshot();
9464
+ const videoTrackSubscriptionOverrides = this.videoTrackSubscriptionOverridesSubject.getValue();
9465
+ for (const p of participants) {
9466
+ if (p.isLocalParticipant)
9467
+ continue;
9451
9468
  // NOTE: audio tracks don't have to be requested explicitly
9452
9469
  // as the SFU will implicitly subscribe us to all of them,
9453
9470
  // once they become available.
9454
9471
  if (p.videoDimension && hasVideo(p)) {
9455
- const override = this.videoTrackSubscriptionOverrides[p.sessionId] ??
9456
- this.videoTrackSubscriptionOverrides[globalOverrideKey];
9472
+ const override = videoTrackSubscriptionOverrides[p.sessionId] ??
9473
+ videoTrackSubscriptionOverrides[globalOverrideKey];
9457
9474
  if (override?.enabled !== false) {
9458
9475
  subscriptions.push({
9459
9476
  userId: p.userId,
@@ -14872,7 +14889,7 @@ class StreamClient {
14872
14889
  this.getUserAgent = () => {
14873
14890
  if (!this.cachedUserAgent) {
14874
14891
  const { clientAppIdentifier = {} } = this.options;
14875
- const { sdkName = 'js', sdkVersion = "1.37.0", ...extras } = clientAppIdentifier;
14892
+ const { sdkName = 'js', sdkVersion = "1.37.1", ...extras } = clientAppIdentifier;
14876
14893
  this.cachedUserAgent = [
14877
14894
  `stream-video-${sdkName}-v${sdkVersion}`,
14878
14895
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),