@stream-io/video-client 1.52.1-beta.0 → 1.53.0

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/index.browser.es.js +801 -123
  3. package/dist/index.browser.es.js.map +1 -1
  4. package/dist/index.cjs.js +801 -122
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.es.js +801 -123
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/src/Call.d.ts +6 -14
  9. package/dist/src/StreamVideoClient.d.ts +2 -0
  10. package/dist/src/coordinator/connection/client.d.ts +1 -0
  11. package/dist/src/errors/SfuTimeoutError.d.ts +8 -0
  12. package/dist/src/errors/index.d.ts +1 -0
  13. package/dist/src/gen/google/protobuf/struct.d.ts +1 -3
  14. package/dist/src/gen/google/protobuf/timestamp.d.ts +1 -3
  15. package/dist/src/gen/video/sfu/event/events.d.ts +1 -22
  16. package/dist/src/gen/video/sfu/models/models.d.ts +0 -4
  17. package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +2 -23
  18. package/dist/src/helpers/firstVideoFrame.d.ts +7 -0
  19. package/dist/src/reporting/ClientEventReporter.d.ts +84 -0
  20. package/dist/src/reporting/index.d.ts +1 -0
  21. package/dist/src/rtc/BasePeerConnection.d.ts +5 -2
  22. package/dist/src/rtc/Publisher.d.ts +1 -4
  23. package/dist/src/rtc/Subscriber.d.ts +0 -7
  24. package/dist/src/rtc/types.d.ts +24 -1
  25. package/dist/src/types.d.ts +5 -0
  26. package/package.json +1 -1
  27. package/src/Call.ts +185 -106
  28. package/src/StreamSfuClient.ts +3 -3
  29. package/src/StreamVideoClient.ts +18 -3
  30. package/src/__tests__/Call.autodrop.test.ts +4 -1
  31. package/src/__tests__/Call.lifecycle.test.ts +4 -1
  32. package/src/__tests__/Call.publishing.test.ts +4 -1
  33. package/src/__tests__/Call.test.ts +23 -0
  34. package/src/coordinator/connection/client.ts +5 -0
  35. package/src/devices/__tests__/CameraManager.test.ts +10 -1
  36. package/src/devices/__tests__/DeviceManager.test.ts +10 -1
  37. package/src/devices/__tests__/DeviceManagerFilters.test.ts +4 -1
  38. package/src/devices/__tests__/MicrophoneManager.test.ts +10 -1
  39. package/src/devices/__tests__/MicrophoneManagerRN.test.ts +4 -1
  40. package/src/devices/__tests__/ScreenShareManager.test.ts +4 -1
  41. package/src/devices/__tests__/SpeakerManager.test.ts +13 -4
  42. package/src/errors/SfuTimeoutError.ts +7 -0
  43. package/src/errors/index.ts +1 -0
  44. package/src/events/__tests__/call.test.ts +2 -0
  45. package/src/events/__tests__/mutes.test.ts +4 -1
  46. package/src/events/call.ts +8 -0
  47. package/src/gen/google/protobuf/struct.ts +12 -7
  48. package/src/gen/google/protobuf/timestamp.ts +7 -6
  49. package/src/gen/video/sfu/event/events.ts +25 -23
  50. package/src/gen/video/sfu/models/models.ts +1 -11
  51. package/src/gen/video/sfu/signal_rpc/signal.client.ts +29 -25
  52. package/src/gen/video/sfu/signal_rpc/signal.ts +0 -1
  53. package/src/helpers/__tests__/AudioBindingsWatchdog.test.ts +6 -3
  54. package/src/helpers/__tests__/DynascaleManager.test.ts +6 -3
  55. package/src/helpers/__tests__/ViewportTracker.test.ts +6 -3
  56. package/src/helpers/__tests__/firstVideoFrame.test.ts +91 -0
  57. package/src/helpers/client-details.ts +1 -1
  58. package/src/helpers/firstVideoFrame.ts +38 -0
  59. package/src/reporting/ClientEventReporter.ts +859 -0
  60. package/src/reporting/__tests__/ClientEventReporter.test.ts +620 -0
  61. package/src/reporting/index.ts +1 -0
  62. package/src/rtc/BasePeerConnection.ts +30 -0
  63. package/src/rtc/Publisher.ts +0 -4
  64. package/src/rtc/Subscriber.ts +2 -28
  65. package/src/rtc/__tests__/Call.reconnect.test.ts +3 -0
  66. package/src/rtc/types.ts +34 -0
  67. package/src/types.ts +6 -0
@@ -300,6 +300,29 @@ describe('muting logic', () => {
300
300
  });
301
301
  });
302
302
 
303
+ describe('client event reporting', () => {
304
+ afterEach(() => {
305
+ vi.restoreAllMocks();
306
+ });
307
+
308
+ it('reports a client-aborted event and unregisters the call on leave', async () => {
309
+ const call = client.call('default', generateUUIDv4());
310
+ await call.getOrCreate();
311
+
312
+ const reporter = call.clientEventReporter;
313
+ const abortSpy = vi.spyOn(reporter, 'abort');
314
+ const unregisterSpy = vi.spyOn(reporter, 'unregisterCall');
315
+
316
+ await call.leave();
317
+
318
+ expect(abortSpy).toHaveBeenCalledWith(call.cid, {
319
+ code: 'CLIENT_ABORTED',
320
+ reason: expect.any(String),
321
+ });
322
+ expect(unregisterSpy).toHaveBeenCalledWith(call.cid);
323
+ });
324
+ });
325
+
303
326
  afterEach(() => {
304
327
  client.disconnectUser();
305
328
  });
@@ -617,6 +617,11 @@ export class StreamClient {
617
617
  return await this.wsConnection.connect(this.defaultWSTimeout);
618
618
  };
619
619
 
620
+ getSdkVersion = (): string =>
621
+ this.options.clientAppIdentifier?.sdkVersion ||
622
+ process.env.PKG_VERSION ||
623
+ '0.0.0';
624
+
620
625
  getUserAgent = (): string => {
621
626
  if (!this.cachedUserAgent) {
622
627
  const { clientAppIdentifier = {} } = this.options;
@@ -1,5 +1,6 @@
1
1
  import { Call } from '../../Call';
2
2
  import { StreamClient } from '../../coordinator/connection/client';
3
+ import { ClientEventReporter } from '../../reporting';
3
4
  import { CallingState, StreamVideoWriteableStateStore } from '../../store';
4
5
 
5
6
  import { afterEach, beforeEach, describe, expect, it, Mock, vi } from 'vitest';
@@ -56,6 +57,12 @@ vi.mock('../../Call.ts', () => {
56
57
  };
57
58
  });
58
59
 
60
+ vi.mock('../../reporting/ClientEventReporter', () => ({
61
+ ClientEventReporter: vi.fn(function () {
62
+ return {};
63
+ }),
64
+ }));
65
+
59
66
  vi.mock('../../helpers/compatibility.ts', () => {
60
67
  console.log('MOCKING mobile device');
61
68
  return {
@@ -76,10 +83,12 @@ describe('CameraManager', () => {
76
83
 
77
84
  beforeEach(() => {
78
85
  const devicePersistence = { enabled: false, storageKey: '' };
86
+ const streamClient = new StreamClient('abc123', { devicePersistence });
79
87
  call = new Call({
80
88
  id: '',
81
89
  type: '',
82
- streamClient: new StreamClient('abc123', { devicePersistence }),
90
+ streamClient,
91
+ clientEventReporter: new ClientEventReporter({ streamClient }),
83
92
  clientStore: new StreamVideoWriteableStateStore(),
84
93
  });
85
94
  manager = new CameraManager(call, devicePersistence);
@@ -1,6 +1,7 @@
1
1
  /* @vitest-environment happy-dom */
2
2
  import { Call } from '../../Call';
3
3
  import { StreamClient } from '../../coordinator/connection/client';
4
+ import { ClientEventReporter } from '../../reporting';
4
5
  import { CallingState, StreamVideoWriteableStateStore } from '../../store';
5
6
 
6
7
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
@@ -22,6 +23,12 @@ import { TrackType } from '../../gen/video/sfu/models/models';
22
23
  import { PermissionsContext } from '../../permissions';
23
24
  import { readPreferences } from '../devicePersistence';
24
25
 
26
+ vi.mock('../../reporting/ClientEventReporter', () => ({
27
+ ClientEventReporter: vi.fn(function () {
28
+ return {};
29
+ }),
30
+ }));
31
+
25
32
  vi.mock('../../Call.ts', () => {
26
33
  console.log('MOCKING Call');
27
34
  return {
@@ -85,11 +92,13 @@ describe('Device Manager', () => {
85
92
  configurable: true,
86
93
  value: localStorageMock,
87
94
  });
95
+ const streamClient = new StreamClient('abc123');
88
96
  manager = new TestInputMediaDeviceManager(
89
97
  new Call({
90
98
  id: '',
91
99
  type: '',
92
- streamClient: new StreamClient('abc123'),
100
+ streamClient,
101
+ clientEventReporter: new ClientEventReporter({ streamClient }),
93
102
  clientStore: new StreamVideoWriteableStateStore(),
94
103
  }),
95
104
  { enabled: false, storageKey },
@@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
2
  import { of } from 'rxjs';
3
3
  import { Call } from '../../Call';
4
4
  import { StreamClient } from '../../coordinator/connection/client';
5
+ import { ClientEventReporter } from '../../reporting';
5
6
  import { StreamVideoWriteableStateStore } from '../../store';
6
7
  import { DeviceManagerState } from '../DeviceManagerState';
7
8
  import { DeviceManager } from '../DeviceManager';
@@ -45,11 +46,13 @@ describe('MediaStream Filters', () => {
45
46
  let manager: TestInputMediaDeviceManager;
46
47
 
47
48
  beforeEach(() => {
49
+ const streamClient = new StreamClient('abc123');
48
50
  manager = new TestInputMediaDeviceManager(
49
51
  new Call({
50
52
  id: '',
51
53
  type: '',
52
- streamClient: new StreamClient('abc123'),
54
+ streamClient,
55
+ clientEventReporter: new ClientEventReporter({ streamClient }),
53
56
  clientStore: new StreamVideoWriteableStateStore(),
54
57
  }),
55
58
  );
@@ -43,6 +43,7 @@ import {
43
43
  readPreferences,
44
44
  toPreferenceList,
45
45
  } from '../devicePersistence';
46
+ import { ClientEventReporter } from '../../reporting';
46
47
 
47
48
  vi.mock('../devices.ts', () => {
48
49
  console.log('MOCKING devices API');
@@ -82,6 +83,12 @@ vi.mock('../../Call.ts', () => {
82
83
  };
83
84
  });
84
85
 
86
+ vi.mock('../../reporting/ClientEventReporter', () => ({
87
+ ClientEventReporter: vi.fn(function () {
88
+ return {};
89
+ }),
90
+ }));
91
+
85
92
  describe('MicrophoneManager', () => {
86
93
  let manager: MicrophoneManager;
87
94
  let call: Call;
@@ -92,10 +99,12 @@ describe('MicrophoneManager', () => {
92
99
  of('granted'),
93
100
  );
94
101
 
102
+ const streamClient = new StreamClient('abc123');
95
103
  call = new Call({
96
104
  id: '',
97
105
  type: '',
98
- streamClient: new StreamClient('abc123'),
106
+ streamClient,
107
+ clientEventReporter: new ClientEventReporter({ streamClient }),
99
108
  clientStore: new StreamVideoWriteableStateStore(),
100
109
  });
101
110
  const devicePersistence = { enabled: false, storageKey: '' };
@@ -13,6 +13,7 @@ import { of } from 'rxjs';
13
13
  import '../../rtc/__tests__/mocks/webrtc.mocks';
14
14
  import { OwnCapability } from '../../gen/coordinator';
15
15
  import { settled, withoutConcurrency } from '../../helpers/concurrency';
16
+ import { ClientEventReporter } from '../../reporting';
16
17
 
17
18
  let speechActivityCallback:
18
19
  | ((state: { isSoundDetected: boolean }) => void)
@@ -82,12 +83,14 @@ describe('MicrophoneManager React Native', () => {
82
83
  };
83
84
 
84
85
  const devicePersistence = { enabled: false, storageKey: '' };
86
+ const streamClient = new StreamClient('abc123');
85
87
  manager = new MicrophoneManager(
86
88
  new Call({
87
89
  id: '',
88
90
  type: '',
89
- streamClient: new StreamClient('abc123'),
91
+ streamClient,
90
92
  clientStore: new StreamVideoWriteableStateStore(),
93
+ clientEventReporter: new ClientEventReporter({ streamClient }),
91
94
  }),
92
95
  devicePersistence,
93
96
  );
@@ -2,6 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
2
2
  import { ScreenShareManager } from '../ScreenShareManager';
3
3
  import { Call } from '../../Call';
4
4
  import { StreamClient } from '../../coordinator/connection/client';
5
+ import { ClientEventReporter } from '../../reporting';
5
6
  import { CallingState, StreamVideoWriteableStateStore } from '../../store';
6
7
  import * as RxUtils from '../../store/rxUtils';
7
8
  import { mockCall, mockDeviceIds$, mockScreenShareStream } from './mocks';
@@ -36,11 +37,13 @@ describe('ScreenShareManager', () => {
36
37
  let manager: ScreenShareManager;
37
38
 
38
39
  beforeEach(() => {
40
+ const streamClient = new StreamClient('abc123');
39
41
  manager = new ScreenShareManager(
40
42
  new Call({
41
43
  id: '',
42
44
  type: '',
43
- streamClient: new StreamClient('abc123'),
45
+ streamClient,
46
+ clientEventReporter: new ClientEventReporter({ streamClient }),
44
47
  clientStore: new StreamVideoWriteableStateStore(),
45
48
  }),
46
49
  );
@@ -14,6 +14,7 @@ import { SpeakerManager } from '../SpeakerManager';
14
14
  import { checkIfAudioOutputChangeSupported } from '../devices';
15
15
  import { Call } from '../../Call';
16
16
  import { StreamClient } from '../../coordinator/connection/client';
17
+ import { ClientEventReporter } from '../../reporting';
17
18
  import { StreamVideoWriteableStateStore } from '../../store';
18
19
  import { defaultDeviceId } from '../devicePersistence';
19
20
 
@@ -45,11 +46,13 @@ describe('SpeakerManager.test', () => {
45
46
  value: localStorageMock,
46
47
  });
47
48
  const devicePersistence = { enabled: false, storageKey };
49
+ const streamClient = new StreamClient('abc123');
48
50
  manager = new SpeakerManager(
49
51
  new Call({
50
52
  id: '',
51
53
  type: '',
52
- streamClient: new StreamClient('abc123'),
54
+ streamClient,
55
+ clientEventReporter: new ClientEventReporter({ streamClient }),
53
56
  clientStore: new StreamVideoWriteableStateStore(),
54
57
  }),
55
58
  devicePersistence,
@@ -129,11 +132,13 @@ describe('SpeakerManager.test', () => {
129
132
  });
130
133
 
131
134
  it('persists speaker selection when permission is granted', async () => {
135
+ const streamClient = new StreamClient('abc123');
132
136
  const persistedManager = new SpeakerManager(
133
137
  new Call({
134
138
  id: '',
135
139
  type: '',
136
- streamClient: new StreamClient('abc123'),
140
+ streamClient,
141
+ clientEventReporter: new ClientEventReporter({ streamClient }),
137
142
  clientStore: new StreamVideoWriteableStateStore(),
138
143
  }),
139
144
  { enabled: true, storageKey },
@@ -162,11 +167,13 @@ describe('SpeakerManager.test', () => {
162
167
  });
163
168
 
164
169
  it('selects the persisted speaker device', () => {
170
+ const streamClient = new StreamClient('abc123');
165
171
  const persistedManager = new SpeakerManager(
166
172
  new Call({
167
173
  id: '',
168
174
  type: '',
169
- streamClient: new StreamClient('abc123'),
175
+ streamClient,
176
+ clientEventReporter: new ClientEventReporter({ streamClient }),
170
177
  clientStore: new StreamVideoWriteableStateStore(),
171
178
  }),
172
179
  { enabled: true, storageKey },
@@ -193,11 +200,13 @@ describe('SpeakerManager.test', () => {
193
200
  });
194
201
 
195
202
  it('selects system default when persisted device is default', () => {
203
+ const streamClient = new StreamClient('abc123');
196
204
  const persistedManager = new SpeakerManager(
197
205
  new Call({
198
206
  id: '',
199
207
  type: '',
200
- streamClient: new StreamClient('abc123'),
208
+ streamClient,
209
+ clientEventReporter: new ClientEventReporter({ streamClient }),
201
210
  clientStore: new StreamVideoWriteableStateStore(),
202
211
  }),
203
212
  { enabled: true, storageKey },
@@ -0,0 +1,7 @@
1
+ /**
2
+ * An error thrown when a client-side SFU deadline (e.g., waiting for the
3
+ * signaling WS to open or for the `joinResponse` to arrive) fires before
4
+ * the awaited operation resolves. Allows consumers (e.g., the client event
5
+ * reporter) to classify timeouts without relying on message wording.
6
+ */
7
+ export class SfuTimeoutError extends Error {}
@@ -1 +1,2 @@
1
1
  export * from './SfuJoinError';
2
+ export * from './SfuTimeoutError';
@@ -16,6 +16,7 @@ import {
16
16
  } from '../../gen/coordinator';
17
17
  import { Call } from '../../Call';
18
18
  import { StreamClient } from '../../coordinator/connection/client';
19
+ import { ClientEventReporter } from '../../reporting';
19
20
  import { SfuEvent } from '../../gen/video/sfu/event/events';
20
21
  import { CallEndedReason } from '../../gen/video/sfu/models/models';
21
22
 
@@ -372,6 +373,7 @@ const fakeCall = ({ ring = true, currentUserId = 'test-user-id' } = {}) => {
372
373
  id: '12345',
373
374
  clientStore: store,
374
375
  streamClient: client,
376
+ clientEventReporter: new ClientEventReporter({ streamClient: client }),
375
377
  ringing: ring,
376
378
  });
377
379
  };
@@ -5,6 +5,7 @@ import {
5
5
  TrackUnpublishReason,
6
6
  } from '../../gen/video/sfu/models/models';
7
7
  import { StreamClient } from '../../coordinator/connection/client';
8
+ import { ClientEventReporter } from '../../reporting';
8
9
  import { handleRemoteSoftMute } from '../mutes';
9
10
  import type { CallEventListener } from '../../coordinator/connection/types';
10
11
 
@@ -15,10 +16,12 @@ describe('mutes', () => {
15
16
 
16
17
  beforeEach(() => {
17
18
  // @ts-expect-error incomplete data
19
+ const streamClient = new StreamClient('api-key');
18
20
  call = new Call({
19
21
  type: 'test',
20
22
  id: 'test',
21
- streamClient: new StreamClient('api-key'),
23
+ streamClient,
24
+ clientEventReporter: new ClientEventReporter({ streamClient }),
22
25
  });
23
26
 
24
27
  // @ts-expect-error partial data
@@ -87,6 +87,10 @@ export const watchCallEnded = (call: Call) => {
87
87
  callingState !== CallingState.IDLE &&
88
88
  callingState !== CallingState.LEFT
89
89
  ) {
90
+ call.clientEventReporter.abort(call.cid, {
91
+ code: 'BACKEND_LEAVE',
92
+ reason: 'call.ended event received',
93
+ });
90
94
  call
91
95
  .leave({ message: 'call.ended event received', reject: false })
92
96
  .catch((err) => {
@@ -116,6 +120,10 @@ export const watchSfuCallEnded = (call: Call) => {
116
120
  call.state.setEndedAt(new Date());
117
121
  const reason = CallEndedReason[e.reason];
118
122
  globalThis.streamRNVideoSDK?.callingX?.endCall(call, 'remote');
123
+ call.clientEventReporter.abort(call.cid, {
124
+ code: 'BACKEND_LEAVE',
125
+ reason: `callEnded received: ${reason}`,
126
+ });
119
127
  await call.leave({ message: `callEnded received: ${reason}` });
120
128
  } catch (err) {
121
129
  call.logger.error(
@@ -1,4 +1,10 @@
1
1
  /* eslint-disable */
2
+ import type {
3
+ JsonObject,
4
+ JsonReadOptions,
5
+ JsonValue,
6
+ JsonWriteOptions,
7
+ } from '@protobuf-ts/runtime';
2
8
  // @generated by protobuf-ts 2.10.0 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
3
9
  // @generated from protobuf file "google/protobuf/struct.proto" (package "google.protobuf", syntax proto3)
4
10
  // tslint:disable
@@ -33,13 +39,12 @@
33
39
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
40
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
41
  //
36
- import { isJsonObject } from '@protobuf-ts/runtime';
37
- import { typeofJsonValue } from '@protobuf-ts/runtime';
38
- import type { JsonValue } from '@protobuf-ts/runtime';
39
- import type { JsonReadOptions } from '@protobuf-ts/runtime';
40
- import type { JsonWriteOptions } from '@protobuf-ts/runtime';
41
- import type { JsonObject } from '@protobuf-ts/runtime';
42
- import { MessageType } from '@protobuf-ts/runtime';
42
+ import {
43
+ isJsonObject,
44
+ MessageType,
45
+ typeofJsonValue,
46
+ } from '@protobuf-ts/runtime';
47
+
43
48
  /**
44
49
  * `Struct` represents a structured data value, consisting of fields
45
50
  * which map to dynamically typed values. In some languages, `Struct`
@@ -1,4 +1,9 @@
1
1
  /* eslint-disable */
2
+ import type {
3
+ JsonReadOptions,
4
+ JsonValue,
5
+ JsonWriteOptions,
6
+ } from '@protobuf-ts/runtime';
2
7
  // @generated by protobuf-ts 2.10.0 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
3
8
  // @generated from protobuf file "google/protobuf/timestamp.proto" (package "google.protobuf", syntax proto3)
4
9
  // tslint:disable
@@ -33,12 +38,8 @@
33
38
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
39
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
40
  //
36
- import { typeofJsonValue } from '@protobuf-ts/runtime';
37
- import type { JsonValue } from '@protobuf-ts/runtime';
38
- import type { JsonReadOptions } from '@protobuf-ts/runtime';
39
- import type { JsonWriteOptions } from '@protobuf-ts/runtime';
40
- import { PbLong } from '@protobuf-ts/runtime';
41
- import { MessageType } from '@protobuf-ts/runtime';
41
+ import { MessageType, PbLong, typeofJsonValue } from '@protobuf-ts/runtime';
42
+
42
43
  /**
43
44
  * A Timestamp represents a point in time independent of any time zone or local
44
45
  * calendar, encoded as a count of seconds and fractions of seconds at
@@ -1,31 +1,33 @@
1
-
2
1
  // @generated by protobuf-ts 2.10.0 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
3
2
  // @generated from protobuf file "video/sfu/event/events.proto" (package "stream.video.sfu.event", syntax proto3)
4
3
  // tslint:disable
5
4
  import { MessageType } from '@protobuf-ts/runtime';
6
- import { CallEndedReason } from '../models/models';
7
- import { GoAwayReason } from '../models/models';
8
- import { CallGrants } from '../models/models';
9
- import { DegradationPreference } from '../models/models';
10
- import { Codec } from '../models/models';
11
- import { ConnectionQuality } from '../models/models';
12
- import { CallState } from '../models/models';
5
+ import {
6
+ CallEndedReason,
7
+ CallGrants,
8
+ CallState,
9
+ ClientCapability,
10
+ ClientDetails,
11
+ Codec,
12
+ ConnectionQuality,
13
+ DegradationPreference,
14
+ Error as Error$,
15
+ GoAwayReason,
16
+ ICETrickle as ICETrickle$,
17
+ Participant,
18
+ ParticipantCount,
19
+ ParticipantSource,
20
+ PeerType,
21
+ Pin,
22
+ PublishOption,
23
+ SubscribeOption,
24
+ TrackInfo,
25
+ TrackType,
26
+ TrackUnpublishReason,
27
+ WebsocketReconnectStrategy,
28
+ } from '../models/models';
13
29
  import { TrackSubscriptionDetails } from '../signal_rpc/signal';
14
- import { TrackInfo } from '../models/models';
15
- import { ParticipantSource } from '../models/models';
16
- import { ClientCapability } from '../models/models';
17
- import { SubscribeOption } from '../models/models';
18
- import { ClientDetails } from '../models/models';
19
- import { TrackUnpublishReason } from '../models/models';
20
- import { Participant } from '../models/models';
21
- import { TrackType } from '../models/models';
22
- import { ParticipantCount } from '../models/models';
23
- import { PeerType } from '../models/models';
24
- import { WebsocketReconnectStrategy } from '../models/models';
25
- import { Error as Error$ } from '../models/models';
26
- import { Pin } from '../models/models';
27
- import { PublishOption } from '../models/models';
28
- import { ICETrickle as ICETrickle$ } from '../models/models';
30
+
29
31
  /**
30
32
  * SFUEvent is a message that is sent from the SFU to the client.
31
33
  *
@@ -1,10 +1,10 @@
1
-
2
1
  // @generated by protobuf-ts 2.10.0 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
3
2
  // @generated from protobuf file "video/sfu/models/models.proto" (package "stream.video.sfu.models", syntax proto3)
4
3
  // tslint:disable
5
4
  import { MessageType } from '@protobuf-ts/runtime';
6
5
  import { Struct } from '../../../google/protobuf/struct';
7
6
  import { Timestamp } from '../../../google/protobuf/timestamp';
7
+
8
8
  /**
9
9
  * CallState is the current state of the call
10
10
  * as seen by an SFU.
@@ -415,10 +415,6 @@ export interface TrackInfo {
415
415
  * @generated from protobuf field: int32 publish_option_id = 12;
416
416
  */
417
417
  publishOptionId: number;
418
- /**
419
- * @generated from protobuf field: bool self_sub_audio_video = 13;
420
- */
421
- selfSubAudioVideo: boolean;
422
418
  }
423
419
  /**
424
420
  * @generated from protobuf message stream.video.sfu.models.Error
@@ -1774,12 +1770,6 @@ class TrackInfo$Type extends MessageType<TrackInfo> {
1774
1770
  kind: 'scalar',
1775
1771
  T: 5 /*ScalarType.INT32*/,
1776
1772
  },
1777
- {
1778
- no: 13,
1779
- name: 'self_sub_audio_video',
1780
- kind: 'scalar',
1781
- T: 8 /*ScalarType.BOOL*/,
1782
- },
1783
1773
  ]);
1784
1774
  }
1785
1775
  }
@@ -1,33 +1,37 @@
1
-
2
1
  // @generated by protobuf-ts 2.10.0 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
3
2
  // @generated from protobuf file "video/sfu/signal_rpc/signal.proto" (package "stream.video.sfu.signal", syntax proto3)
4
3
  // tslint:disable
5
- import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
6
- import type { ServiceInfo } from '@protobuf-ts/runtime-rpc';
4
+ import type {
5
+ RpcOptions,
6
+ RpcTransport,
7
+ ServiceInfo,
8
+ UnaryCall,
9
+ } from '@protobuf-ts/runtime-rpc';
10
+ import { stackIntercept } from '@protobuf-ts/runtime-rpc';
11
+ import type {
12
+ ICERestartRequest,
13
+ ICERestartResponse,
14
+ ICETrickleResponse,
15
+ SendAnswerRequest,
16
+ SendAnswerResponse,
17
+ SendMetricsRequest,
18
+ SendMetricsResponse,
19
+ SendStatsRequest,
20
+ SendStatsResponse,
21
+ SetPublisherRequest,
22
+ SetPublisherResponse,
23
+ StartNoiseCancellationRequest,
24
+ StartNoiseCancellationResponse,
25
+ StopNoiseCancellationRequest,
26
+ StopNoiseCancellationResponse,
27
+ UpdateMuteStatesRequest,
28
+ UpdateMuteStatesResponse,
29
+ UpdateSubscriptionsRequest,
30
+ UpdateSubscriptionsResponse,
31
+ } from './signal';
7
32
  import { SignalServer } from './signal';
8
- import type { StopNoiseCancellationResponse } from './signal';
9
- import type { StopNoiseCancellationRequest } from './signal';
10
- import type { StartNoiseCancellationResponse } from './signal';
11
- import type { StartNoiseCancellationRequest } from './signal';
12
- import type { SendMetricsResponse } from './signal';
13
- import type { SendMetricsRequest } from './signal';
14
- import type { SendStatsResponse } from './signal';
15
- import type { SendStatsRequest } from './signal';
16
- import type { ICERestartResponse } from './signal';
17
- import type { ICERestartRequest } from './signal';
18
- import type { UpdateMuteStatesResponse } from './signal';
19
- import type { UpdateMuteStatesRequest } from './signal';
20
- import type { UpdateSubscriptionsResponse } from './signal';
21
- import type { UpdateSubscriptionsRequest } from './signal';
22
- import type { ICETrickleResponse } from './signal';
23
33
  import type { ICETrickle } from '../models/models';
24
- import type { SendAnswerResponse } from './signal';
25
- import type { SendAnswerRequest } from './signal';
26
- import { stackIntercept } from '@protobuf-ts/runtime-rpc';
27
- import type { SetPublisherResponse } from './signal';
28
- import type { SetPublisherRequest } from './signal';
29
- import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
30
- import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
34
+
31
35
  /**
32
36
  * @generated from protobuf service stream.video.sfu.signal.SignalServer
33
37
  */
@@ -1,4 +1,3 @@
1
-
2
1
  // @generated by protobuf-ts 2.10.0 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
3
2
  // @generated from protobuf file "video/sfu/signal_rpc/signal.proto" (package "stream.video.sfu.signal", syntax proto3)
4
3
  // tslint:disable
@@ -8,6 +8,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
8
8
  import { AudioBindingsWatchdog } from '../AudioBindingsWatchdog';
9
9
  import { Call } from '../../Call';
10
10
  import { StreamClient } from '../../coordinator/connection/client';
11
+ import { ClientEventReporter } from '../../reporting';
11
12
  import { CallingState, StreamVideoWriteableStateStore } from '../../store';
12
13
  import { noopComparator } from '../../sorting';
13
14
  import { fromPartial } from '@total-typescript/shoehorn';
@@ -19,12 +20,14 @@ describe('AudioBindingsWatchdog', () => {
19
20
 
20
21
  beforeEach(() => {
21
22
  vi.useFakeTimers();
23
+ const streamClient = new StreamClient('api-key', {
24
+ devicePersistence: { enabled: false },
25
+ });
22
26
  call = new Call({
23
27
  id: 'id',
24
28
  type: 'default',
25
- streamClient: new StreamClient('api-key', {
26
- devicePersistence: { enabled: false },
27
- }),
29
+ streamClient,
30
+ clientEventReporter: new ClientEventReporter({ streamClient }),
28
31
  clientStore: new StreamVideoWriteableStateStore(),
29
32
  });
30
33
  call.setSortParticipantsBy(noopComparator());
@@ -17,6 +17,7 @@ import {
17
17
  import { DynascaleManager } from '../DynascaleManager';
18
18
  import { Call } from '../../Call';
19
19
  import { StreamClient } from '../../coordinator/connection/client';
20
+ import { ClientEventReporter } from '../../reporting';
20
21
  import { StreamVideoWriteableStateStore } from '../../store';
21
22
  import { getCurrentValue } from '../../store/rxUtils';
22
23
  import { VisibilityState } from '../../types';
@@ -36,12 +37,14 @@ describe('DynascaleManager', () => {
36
37
  let call: Call;
37
38
 
38
39
  beforeEach(() => {
40
+ const streamClient = new StreamClient('api-key', {
41
+ devicePersistence: { enabled: false },
42
+ });
39
43
  call = new Call({
40
44
  id: 'id',
41
45
  type: 'default',
42
- streamClient: new StreamClient('api-key', {
43
- devicePersistence: { enabled: false },
44
- }),
46
+ streamClient,
47
+ clientEventReporter: new ClientEventReporter({ streamClient }),
45
48
  clientStore: new StreamVideoWriteableStateStore(),
46
49
  });
47
50
  call.setSortParticipantsBy(noopComparator());
@@ -7,6 +7,7 @@ import '../../rtc/__tests__/mocks/webrtc.mocks';
7
7
  import { beforeEach, describe, expect, it, vi } from 'vitest';
8
8
  import { Call } from '../../Call';
9
9
  import { StreamClient } from '../../coordinator/connection/client';
10
+ import { ClientEventReporter } from '../../reporting';
10
11
  import { StreamVideoWriteableStateStore } from '../../store';
11
12
  import { noopComparator } from '../../sorting';
12
13
  import { VisibilityState } from '../../types';
@@ -17,12 +18,14 @@ describe('ViewportTracker', () => {
17
18
  let viewportTracker: ViewportTracker;
18
19
 
19
20
  beforeEach(() => {
21
+ const streamClient = new StreamClient('api-key', {
22
+ devicePersistence: { enabled: false },
23
+ });
20
24
  call = new Call({
21
25
  id: 'id',
22
26
  type: 'default',
23
- streamClient: new StreamClient('api-key', {
24
- devicePersistence: { enabled: false },
25
- }),
27
+ streamClient,
28
+ clientEventReporter: new ClientEventReporter({ streamClient }),
26
29
  clientStore: new StreamVideoWriteableStateStore(),
27
30
  });
28
31
  call.setSortParticipantsBy(noopComparator());