@stream-io/video-client 0.0.13 → 0.0.14

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
@@ -4250,7 +4250,7 @@ exports.DebounceType = void 0;
4250
4250
  DebounceType[DebounceType["SLOW"] = 1200] = "SLOW";
4251
4251
  })(exports.DebounceType || (exports.DebounceType = {}));
4252
4252
  const isStreamVideoLocalParticipant = (p) => {
4253
- return !!p.isLoggedInUser;
4253
+ return !!p.isLocalParticipant;
4254
4254
  };
4255
4255
 
4256
4256
  /******************************************************************************
@@ -7029,7 +7029,7 @@ class CallState {
7029
7029
  };
7030
7030
  this.participants$ = this.participantsSubject.pipe(operators.map((ps) => ps.sort(this.sortParticipantsBy)));
7031
7031
  this.localParticipant$ = this.participants$.pipe(operators.map((participants) => participants.find(isStreamVideoLocalParticipant)));
7032
- this.remoteParticipants$ = this.participants$.pipe(operators.map((participants) => participants.filter((p) => !p.isLoggedInUser)));
7032
+ this.remoteParticipants$ = this.participants$.pipe(operators.map((participants) => participants.filter((p) => !p.isLocalParticipant)));
7033
7033
  this.pinnedParticipants$ = this.participants$.pipe(operators.map((participants) => participants.filter((p) => p.pinnedAt)));
7034
7034
  this.dominantSpeaker$ = this.participants$.pipe(operators.map((participants) => participants.find((p) => p.isDominantSpeaker)));
7035
7035
  this.hasOngoingScreenShare$ = this.participants$.pipe(operators.map((participants) => {
@@ -7878,7 +7878,9 @@ const createStatsReporter = ({ subscriber, publisher, state, edgeName, pollingIn
7878
7878
  for (let participant of state.participants) {
7879
7879
  if (!sessionIds.has(participant.sessionId))
7880
7880
  continue;
7881
- const kind = participant.isLoggedInUser ? 'publisher' : 'subscriber';
7881
+ const kind = participant.isLocalParticipant
7882
+ ? 'publisher'
7883
+ : 'subscriber';
7882
7884
  try {
7883
7885
  const mergedStream = new MediaStream([
7884
7886
  ...(((_a = participant.videoStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) || []),
@@ -8471,6 +8473,9 @@ class Call {
8471
8473
  if ([exports.CallingState.JOINED, exports.CallingState.JOINING].includes(this.state.callingState)) {
8472
8474
  throw new Error(`Illegal State: Already joined.`);
8473
8475
  }
8476
+ if (this.state.callingState === exports.CallingState.LEFT) {
8477
+ throw new Error('Illegal State: Cannot join already left call. Create a new Call instance to join a call.');
8478
+ }
8474
8479
  const previousCallingState = this.state.callingState;
8475
8480
  this.state.setCallingState(exports.CallingState.JOINING);
8476
8481
  if ((data === null || data === void 0 ? void 0 : data.ring) && !this.ringing) {
@@ -8667,7 +8672,7 @@ class Call {
8667
8672
  const startedAt = (callState === null || callState === void 0 ? void 0 : callState.startedAt)
8668
8673
  ? Timestamp.toDate(callState.startedAt)
8669
8674
  : new Date();
8670
- this.state.setParticipants(currentParticipants.map((participant) => (Object.assign(Object.assign({}, participant), { isLoggedInUser: participant.sessionId === sfuClient.sessionId, viewportVisibilityState: exports.VisibilityState.UNKNOWN }))));
8675
+ this.state.setParticipants(currentParticipants.map((participant) => (Object.assign(Object.assign({}, participant), { isLocalParticipant: participant.sessionId === sfuClient.sessionId, viewportVisibilityState: exports.VisibilityState.UNKNOWN }))));
8671
8676
  this.state.setParticipantCount((participantCount === null || participantCount === void 0 ? void 0 : participantCount.total) || 0);
8672
8677
  this.state.setAnonymousParticipantCount((participantCount === null || participantCount === void 0 ? void 0 : participantCount.anonymous) || 0);
8673
8678
  this.state.setStartedAt(startedAt);
@@ -8801,7 +8806,7 @@ class Call {
8801
8806
  const subscriptions = [];
8802
8807
  participants.forEach((p) => {
8803
8808
  // we don't want to subscribe to our own tracks
8804
- if (p.isLoggedInUser)
8809
+ if (p.isLocalParticipant)
8805
8810
  return;
8806
8811
  // NOTE: audio tracks don't have to be requested explicitly
8807
8812
  // as the SFU will implicitly subscribe us to all of them,
@@ -11007,7 +11012,7 @@ class StreamClient {
11007
11012
  }
11008
11013
  getUserAgent() {
11009
11014
  return (this.userAgent ||
11010
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.12"}`);
11015
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.13"}`);
11011
11016
  }
11012
11017
  setUserAgent(userAgent) {
11013
11018
  this.userAgent = userAgent;