@stream-io/video-client 0.3.24 → 0.3.25

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
@@ -7912,6 +7912,18 @@ const ifInvisibleBy = conditional((a, b) => {
7912
7912
  return ((_a = a.viewportVisibilityState) === null || _a === void 0 ? void 0 : _a.videoTrack) === exports.VisibilityState.INVISIBLE ||
7913
7913
  ((_b = b.viewportVisibilityState) === null || _b === void 0 ? void 0 : _b.videoTrack) === exports.VisibilityState.INVISIBLE;
7914
7914
  });
7915
+ /**
7916
+ * A comparator that applies the decorated comparator when a participant is
7917
+ * either invisible or its visibility state isn't known.
7918
+ * For visible participants, it ensures stable sorting.
7919
+ */
7920
+ const ifInvisibleOrUnknownBy = conditional((a, b) => {
7921
+ var _a, _b, _c, _d;
7922
+ return ((_a = a.viewportVisibilityState) === null || _a === void 0 ? void 0 : _a.videoTrack) === exports.VisibilityState.INVISIBLE ||
7923
+ ((_b = a.viewportVisibilityState) === null || _b === void 0 ? void 0 : _b.videoTrack) === exports.VisibilityState.UNKNOWN ||
7924
+ ((_c = b.viewportVisibilityState) === null || _c === void 0 ? void 0 : _c.videoTrack) === exports.VisibilityState.INVISIBLE ||
7925
+ ((_d = b.viewportVisibilityState) === null || _d === void 0 ? void 0 : _d.videoTrack) === exports.VisibilityState.UNKNOWN;
7926
+ });
7915
7927
  /**
7916
7928
  * The default sorting preset.
7917
7929
  */
@@ -7920,6 +7932,11 @@ const defaultSortPreset = combineComparators(pinned, screenSharing, ifInvisibleB
7920
7932
  * The sorting preset for speaker layout.
7921
7933
  */
7922
7934
  const speakerLayoutSortPreset = combineComparators(pinned, screenSharing, dominantSpeaker, ifInvisibleBy(speaking), ifInvisibleBy(reactionType('raised-hand')), ifInvisibleBy(publishingVideo), ifInvisibleBy(publishingAudio));
7935
+ /**
7936
+ * The sorting preset for layouts that don't render all participants but
7937
+ * instead, render them in pages.
7938
+ */
7939
+ const paginatedLayoutSortPreset = combineComparators(pinned, screenSharing, dominantSpeaker, ifInvisibleOrUnknownBy(speaking), ifInvisibleOrUnknownBy(reactionType('raised-hand')), ifInvisibleOrUnknownBy(publishingVideo), ifInvisibleOrUnknownBy(publishingAudio));
7923
7940
  /**
7924
7941
  * The sorting preset for livestreams and audio rooms.
7925
7942
  */
@@ -13187,7 +13204,7 @@ class WSConnectionFallback {
13187
13204
  }
13188
13205
  }
13189
13206
 
13190
- const version = '0.3.24';
13207
+ const version = '0.3.25';
13191
13208
 
13192
13209
  const logger = getLogger(['location']);
13193
13210
  const HINT_URL = `https://hint.stream-io-video.com/`;
@@ -14232,6 +14249,7 @@ exports.logLevels = logLevels;
14232
14249
  exports.logToConsole = logToConsole;
14233
14250
  exports.name = name;
14234
14251
  exports.noopComparator = noopComparator;
14252
+ exports.paginatedLayoutSortPreset = paginatedLayoutSortPreset;
14235
14253
  exports.pinned = pinned;
14236
14254
  exports.publishingAudio = publishingAudio;
14237
14255
  exports.publishingVideo = publishingVideo;