@stream-io/video-client 0.0.40 → 0.0.41

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
@@ -6303,7 +6303,7 @@ class Publisher {
6303
6303
  this.onIceCandidate = (e) => __awaiter(this, void 0, void 0, function* () {
6304
6304
  const { candidate } = e;
6305
6305
  if (!candidate) {
6306
- this.logger('warn', 'null ice candidate');
6306
+ this.logger('debug', 'null ice candidate');
6307
6307
  return;
6308
6308
  }
6309
6309
  yield this.sfuClient.iceTrickle({
@@ -6463,10 +6463,10 @@ class Publisher {
6463
6463
  this.logger('error', `ICE Candidate error`, errorMessage);
6464
6464
  };
6465
6465
  this.onIceConnectionStateChange = () => {
6466
- this.logger('error', `ICE Connection state changed`, this.pc.iceConnectionState);
6466
+ this.logger('debug', `ICE Connection state changed`, this.pc.iceConnectionState);
6467
6467
  };
6468
6468
  this.onIceGatheringStateChange = () => {
6469
- this.logger('error', `ICE Gathering State`, this.pc.iceGatheringState);
6469
+ this.logger('debug', `ICE Gathering State`, this.pc.iceGatheringState);
6470
6470
  };
6471
6471
  this.onSignalingStateChange = () => {
6472
6472
  this.logger('debug', `Signaling state changed`, this.pc.signalingState);
@@ -6633,7 +6633,7 @@ class Subscriber {
6633
6633
  this.onIceCandidate = (e) => __awaiter(this, void 0, void 0, function* () {
6634
6634
  const { candidate } = e;
6635
6635
  if (!candidate) {
6636
- logger$1('warn', 'null ice candidate');
6636
+ logger$1('debug', 'null ice candidate');
6637
6637
  return;
6638
6638
  }
6639
6639
  yield this.sfuClient.iceTrickle({
@@ -6942,7 +6942,7 @@ class StreamSfuClient {
6942
6942
  if (this.lastMessageTimestamp) {
6943
6943
  const timeSinceLastMessage = new Date().getTime() - this.lastMessageTimestamp.getTime();
6944
6944
  if (timeSinceLastMessage > this.unhealthyTimeoutInMs) {
6945
- this.logger('error', 'SFU connection unhealthy, closing');
6945
+ this.logger('debug', 'SFU connection unhealthy, closing');
6946
6946
  this.close(4001, `SFU connection unhealthy. Didn't receive any healthcheck messages for ${this.unhealthyTimeoutInMs}ms`);
6947
6947
  }
6948
6948
  }
@@ -8049,6 +8049,16 @@ const watchParticipantCountChanged = (dispatcher, state) => {
8049
8049
  }
8050
8050
  });
8051
8051
  };
8052
+ const watchLiveEnded = (dispatcher, call) => {
8053
+ return dispatcher.on('error', (e) => {
8054
+ if (e.eventPayload.oneofKind !== 'error' ||
8055
+ !e.eventPayload.error.error ||
8056
+ e.eventPayload.error.error.code !== ErrorCode.LIVE_ENDED)
8057
+ return;
8058
+ if (!call.permissionsContext.hasPermission(OwnCapability.JOIN_BACKSTAGE))
8059
+ call.leave();
8060
+ });
8061
+ };
8052
8062
  /**
8053
8063
  * Watches and logs the errors reported by the currently connected SFU.
8054
8064
  */
@@ -8438,6 +8448,7 @@ const registerEventHandlers = (call, state, dispatcher) => {
8438
8448
  'call.user_muted': () => console.log('call.user_muted received'),
8439
8449
  };
8440
8450
  const eventHandlers = [
8451
+ watchLiveEnded(dispatcher, call),
8441
8452
  watchSfuErrorReports(dispatcher),
8442
8453
  watchChangePublishQuality(dispatcher, call),
8443
8454
  watchConnectionQualityChanged(dispatcher, state),
@@ -8696,7 +8707,7 @@ const createStatsReporter = ({ subscriber, publisher, state, pollingIntervalInMs
8696
8707
  if (pollingIntervalInMs > 0) {
8697
8708
  const loop = () => __awaiter(void 0, void 0, void 0, function* () {
8698
8709
  yield run().catch((e) => {
8699
- logger('warn', 'Failed to collect stats', e);
8710
+ logger('debug', 'Failed to collect stats', e);
8700
8711
  });
8701
8712
  timeoutId = setTimeout(loop, pollingIntervalInMs);
8702
8713
  });
@@ -11766,7 +11777,7 @@ class StreamClient {
11766
11777
  };
11767
11778
  this.getUserAgent = () => {
11768
11779
  return (this.userAgent ||
11769
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.39"}`);
11780
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.40"}`);
11770
11781
  };
11771
11782
  this.setUserAgent = (userAgent) => {
11772
11783
  this.userAgent = userAgent;
@@ -12191,7 +12202,7 @@ class StreamVideoClient {
12191
12202
  return;
12192
12203
  const { call, members } = event;
12193
12204
  if (userToConnect.id === call.created_by.id) {
12194
- this.logger('warn', 'Received `call.ring` sent by the current user');
12205
+ this.logger('debug', 'Received `call.ring` sent by the current user so ignoring the event');
12195
12206
  return;
12196
12207
  }
12197
12208
  // The call might already be tracked by the client,