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