@stream-io/video-client 1.51.0 → 1.52.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 (40) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/index.browser.es.js +311 -14
  3. package/dist/index.browser.es.js.map +1 -1
  4. package/dist/index.cjs.js +311 -13
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.es.js +311 -14
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/src/gen/video/sfu/event/events.d.ts +4 -0
  9. package/dist/src/gen/video/sfu/models/models.d.ts +204 -2
  10. package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +9 -1
  11. package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +67 -1
  12. package/dist/src/helpers/participantUtils.d.ts +10 -0
  13. package/dist/src/rtc/BasePeerConnection.d.ts +1 -1
  14. package/dist/src/rtc/types.d.ts +1 -0
  15. package/dist/src/stats/rtc/StatsTracer.d.ts +2 -1
  16. package/dist/src/stats/utils.d.ts +1 -0
  17. package/package.json +14 -14
  18. package/src/Call.ts +5 -1
  19. package/src/devices/__tests__/CameraManager.test.ts +3 -1
  20. package/src/devices/__tests__/DeviceManager.test.ts +3 -1
  21. package/src/devices/__tests__/MicrophoneManager.test.ts +3 -1
  22. package/src/devices/__tests__/MicrophoneManagerRN.test.ts +3 -1
  23. package/src/devices/__tests__/ScreenShareManager.test.ts +3 -1
  24. package/src/devices/__tests__/web-audio.mocks.ts +3 -1
  25. package/src/gen/video/sfu/event/events.ts +10 -0
  26. package/src/gen/video/sfu/models/models.ts +338 -0
  27. package/src/gen/video/sfu/signal_rpc/signal.client.ts +28 -2
  28. package/src/gen/video/sfu/signal_rpc/signal.ts +121 -15
  29. package/src/helpers/__tests__/DynascaleManager.test.ts +8 -7
  30. package/src/helpers/__tests__/browsers.test.ts +4 -4
  31. package/src/helpers/__tests__/participantUtils.test.ts +47 -0
  32. package/src/helpers/client-details.ts +4 -1
  33. package/src/helpers/participantUtils.ts +15 -0
  34. package/src/rtc/BasePeerConnection.ts +7 -1
  35. package/src/rtc/Subscriber.ts +1 -0
  36. package/src/rtc/__tests__/Subscriber.test.ts +5 -1
  37. package/src/rtc/__tests__/mocks/webrtc.mocks.ts +16 -15
  38. package/src/rtc/types.ts +1 -0
  39. package/src/stats/rtc/StatsTracer.ts +25 -4
  40. package/src/stats/rtc/__tests__/StatsTracer.test.ts +155 -0
@@ -453,6 +453,10 @@ export interface ClientDetails {
453
453
  * @generated from protobuf field: stream.video.sfu.models.Device device = 4;
454
454
  */
455
455
  device?: Device;
456
+ /**
457
+ * @generated from protobuf field: string webrtc_version = 5;
458
+ */
459
+ webrtcVersion: string;
456
460
  }
457
461
  /**
458
462
  * @generated from protobuf message stream.video.sfu.models.Sdk
@@ -706,6 +710,155 @@ export interface PerformanceStats {
706
710
  */
707
711
  targetBitrate: number;
708
712
  }
713
+ /**
714
+ * ===================================================================
715
+ * BASE (shared by all RTP directions)
716
+ * ===================================================================
717
+ *
718
+ * @generated from protobuf message stream.video.sfu.models.RtpBase
719
+ */
720
+ export interface RtpBase {
721
+ /**
722
+ * @generated from protobuf field: uint32 ssrc = 1;
723
+ */
724
+ ssrc: number; // raw stat["ssrc"]
725
+ /**
726
+ * @generated from protobuf field: string kind = 2;
727
+ */
728
+ kind: string; // stat["kind"] ("audio","video")
729
+ /**
730
+ * @generated from protobuf field: double timestamp_ms = 3;
731
+ */
732
+ timestampMs: number; // stat["timestamp"] in milliseconds
733
+ }
734
+ /**
735
+ * ===================================================================
736
+ * INBOUND (SUBSCRIBER RECEIVING MEDIA)
737
+ * ===================================================================
738
+ *
739
+ * @generated from protobuf message stream.video.sfu.models.InboundRtp
740
+ */
741
+ export interface InboundRtp {
742
+ /**
743
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
744
+ */
745
+ base?: RtpBase;
746
+ /**
747
+ * @generated from protobuf field: double jitter_seconds = 2;
748
+ */
749
+ jitterSeconds: number; // stat["jitter"]
750
+ /**
751
+ * @generated from protobuf field: uint64 packets_received = 3;
752
+ */
753
+ packetsReceived: string; // stat["packetsReceived"]
754
+ /**
755
+ * @generated from protobuf field: uint64 packets_lost = 4;
756
+ */
757
+ packetsLost: string; // stat["packetsLost"]
758
+ /**
759
+ * @generated from protobuf field: double packet_loss_percent = 5;
760
+ */
761
+ packetLossPercent: number; // (packets_lost / (packets_received + packets_lost)) * 100;skip if denominator <= 0 or counters decreased
762
+ /**
763
+ * -------- AUDIO METRICS --------
764
+ *
765
+ * @generated from protobuf field: uint32 concealment_events = 10;
766
+ */
767
+ concealmentEvents: number; // stat["concealmentEvents"]
768
+ /**
769
+ * @generated from protobuf field: double concealment_percent = 11;
770
+ */
771
+ concealmentPercent: number; // (concealedSamples / totalSamplesReceived) * 100 when totalSamplesReceived >= 96_000 (≈2 s @ 48 kHz)
772
+ /**
773
+ * -------- VIDEO METRICS --------
774
+ *
775
+ * @generated from protobuf field: double fps = 20;
776
+ */
777
+ fps: number; // use delta(framesDecoded)/delta(time) with prev sample
778
+ /**
779
+ * @generated from protobuf field: double freeze_duration_seconds = 21;
780
+ */
781
+ freezeDurationSeconds: number; // stat["totalFreezesDuration"]
782
+ /**
783
+ * @generated from protobuf field: double avg_decode_time_seconds = 22;
784
+ */
785
+ avgDecodeTimeSeconds: number; // stat["totalDecodeTime"] / max(1, stat["framesDecoded"])
786
+ /**
787
+ * @generated from protobuf field: uint32 min_dimension_px = 23;
788
+ */
789
+ minDimensionPx: number; // min(stat["frameWidth"], stat["frameHeight"]) for video-like tracks
790
+ }
791
+ /**
792
+ * ===================================================================
793
+ * OUTBOUND (PUBLISHER SENDING MEDIA)
794
+ * ===================================================================
795
+ *
796
+ * @generated from protobuf message stream.video.sfu.models.OutboundRtp
797
+ */
798
+ export interface OutboundRtp {
799
+ /**
800
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
801
+ */
802
+ base?: RtpBase;
803
+ /**
804
+ * @generated from protobuf field: double fps = 10;
805
+ */
806
+ fps: number; // delta(framesEncoded)/delta(time) if missing
807
+ /**
808
+ * @generated from protobuf field: double avg_encode_time_seconds = 11;
809
+ */
810
+ avgEncodeTimeSeconds: number; // stat["totalEncodeTime"] / max(1, stat["framesEncoded"])
811
+ /**
812
+ * @generated from protobuf field: double bitrate_bps = 12;
813
+ */
814
+ bitrateBps: number; // delta(bytesSent)*8 / delta(timeSeconds); requires prev bytes/timestamp; ignore if delta<=0
815
+ /**
816
+ * @generated from protobuf field: uint32 min_dimension_px = 13;
817
+ */
818
+ minDimensionPx: number; // min(stat["frameWidth"], stat["frameHeight"])
819
+ }
820
+ /**
821
+ * ===================================================================
822
+ * SFU FEEDBACK: REMOTE-INBOUND (Publisher receives feedback)
823
+ * ===================================================================
824
+ *
825
+ * @generated from protobuf message stream.video.sfu.models.RemoteInboundRtp
826
+ */
827
+ export interface RemoteInboundRtp {
828
+ /**
829
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
830
+ */
831
+ base?: RtpBase;
832
+ /**
833
+ * @generated from protobuf field: double jitter_seconds = 2;
834
+ */
835
+ jitterSeconds: number; // stat["jitter"]
836
+ /**
837
+ * @generated from protobuf field: double round_trip_time_s = 3;
838
+ */
839
+ roundTripTimeS: number; // stat["roundTripTime"]
840
+ }
841
+ /**
842
+ * ===================================================================
843
+ * SFU FEEDBACK: REMOTE-OUTBOUND (Subscriber receives feedback)
844
+ * ===================================================================
845
+ *
846
+ * @generated from protobuf message stream.video.sfu.models.RemoteOutboundRtp
847
+ */
848
+ export interface RemoteOutboundRtp {
849
+ /**
850
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
851
+ */
852
+ base?: RtpBase;
853
+ /**
854
+ * @generated from protobuf field: double jitter_seconds = 2;
855
+ */
856
+ jitterSeconds: number; // stat["jitter"] if provided
857
+ /**
858
+ * @generated from protobuf field: double round_trip_time_s = 3;
859
+ */
860
+ roundTripTimeS: number; // stat["roundTripTime"]
861
+ }
709
862
  /**
710
863
  * @generated from protobuf enum stream.video.sfu.models.PeerType
711
864
  */
@@ -973,6 +1126,14 @@ export enum SdkType {
973
1126
  * @generated from protobuf enum value: SDK_TYPE_PLAIN_JAVASCRIPT = 9;
974
1127
  */
975
1128
  PLAIN_JAVASCRIPT = 9,
1129
+ /**
1130
+ * @generated from protobuf enum value: SDK_TYPE_PYTHON = 10;
1131
+ */
1132
+ PYTHON = 10,
1133
+ /**
1134
+ * @generated from protobuf enum value: SDK_TYPE_VISION_AGENTS = 11;
1135
+ */
1136
+ VISION_AGENTS = 11,
976
1137
  }
977
1138
  /**
978
1139
  * @generated from protobuf enum stream.video.sfu.models.TrackUnpublishReason
@@ -1177,6 +1338,12 @@ export enum ClientCapability {
1177
1338
  * @generated from protobuf enum value: CLIENT_CAPABILITY_SUBSCRIBER_VIDEO_PAUSE = 1;
1178
1339
  */
1179
1340
  SUBSCRIBER_VIDEO_PAUSE = 1,
1341
+ /**
1342
+ * Instructs SFU that stats will be sent to the coordinator
1343
+ *
1344
+ * @generated from protobuf enum value: CLIENT_CAPABILITY_COORDINATOR_STATS = 2;
1345
+ */
1346
+ COORDINATOR_STATS = 2,
1180
1347
  }
1181
1348
  /**
1182
1349
  * DegradationPreference represents the RTCDegradationPreference from WebRTC.
@@ -1641,6 +1808,12 @@ class ClientDetails$Type extends MessageType<ClientDetails> {
1641
1808
  { no: 2, name: 'os', kind: 'message', T: () => OS },
1642
1809
  { no: 3, name: 'browser', kind: 'message', T: () => Browser },
1643
1810
  { no: 4, name: 'device', kind: 'message', T: () => Device },
1811
+ {
1812
+ no: 5,
1813
+ name: 'webrtc_version',
1814
+ kind: 'scalar',
1815
+ T: 9 /*ScalarType.STRING*/,
1816
+ },
1644
1817
  ]);
1645
1818
  }
1646
1819
  }
@@ -1913,3 +2086,168 @@ class PerformanceStats$Type extends MessageType<PerformanceStats> {
1913
2086
  * @generated MessageType for protobuf message stream.video.sfu.models.PerformanceStats
1914
2087
  */
1915
2088
  export const PerformanceStats = new PerformanceStats$Type();
2089
+ // @generated message type with reflection information, may provide speed optimized methods
2090
+ class RtpBase$Type extends MessageType<RtpBase> {
2091
+ constructor() {
2092
+ super('stream.video.sfu.models.RtpBase', [
2093
+ { no: 1, name: 'ssrc', kind: 'scalar', T: 13 /*ScalarType.UINT32*/ },
2094
+ { no: 2, name: 'kind', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
2095
+ {
2096
+ no: 3,
2097
+ name: 'timestamp_ms',
2098
+ kind: 'scalar',
2099
+ T: 1 /*ScalarType.DOUBLE*/,
2100
+ },
2101
+ ]);
2102
+ }
2103
+ }
2104
+ /**
2105
+ * @generated MessageType for protobuf message stream.video.sfu.models.RtpBase
2106
+ */
2107
+ export const RtpBase = new RtpBase$Type();
2108
+ // @generated message type with reflection information, may provide speed optimized methods
2109
+ class InboundRtp$Type extends MessageType<InboundRtp> {
2110
+ constructor() {
2111
+ super('stream.video.sfu.models.InboundRtp', [
2112
+ { no: 1, name: 'base', kind: 'message', T: () => RtpBase },
2113
+ {
2114
+ no: 2,
2115
+ name: 'jitter_seconds',
2116
+ kind: 'scalar',
2117
+ T: 1 /*ScalarType.DOUBLE*/,
2118
+ },
2119
+ {
2120
+ no: 3,
2121
+ name: 'packets_received',
2122
+ kind: 'scalar',
2123
+ T: 4 /*ScalarType.UINT64*/,
2124
+ },
2125
+ {
2126
+ no: 4,
2127
+ name: 'packets_lost',
2128
+ kind: 'scalar',
2129
+ T: 4 /*ScalarType.UINT64*/,
2130
+ },
2131
+ {
2132
+ no: 5,
2133
+ name: 'packet_loss_percent',
2134
+ kind: 'scalar',
2135
+ T: 1 /*ScalarType.DOUBLE*/,
2136
+ },
2137
+ {
2138
+ no: 10,
2139
+ name: 'concealment_events',
2140
+ kind: 'scalar',
2141
+ T: 13 /*ScalarType.UINT32*/,
2142
+ },
2143
+ {
2144
+ no: 11,
2145
+ name: 'concealment_percent',
2146
+ kind: 'scalar',
2147
+ T: 1 /*ScalarType.DOUBLE*/,
2148
+ },
2149
+ { no: 20, name: 'fps', kind: 'scalar', T: 1 /*ScalarType.DOUBLE*/ },
2150
+ {
2151
+ no: 21,
2152
+ name: 'freeze_duration_seconds',
2153
+ kind: 'scalar',
2154
+ T: 1 /*ScalarType.DOUBLE*/,
2155
+ },
2156
+ {
2157
+ no: 22,
2158
+ name: 'avg_decode_time_seconds',
2159
+ kind: 'scalar',
2160
+ T: 1 /*ScalarType.DOUBLE*/,
2161
+ },
2162
+ {
2163
+ no: 23,
2164
+ name: 'min_dimension_px',
2165
+ kind: 'scalar',
2166
+ T: 13 /*ScalarType.UINT32*/,
2167
+ },
2168
+ ]);
2169
+ }
2170
+ }
2171
+ /**
2172
+ * @generated MessageType for protobuf message stream.video.sfu.models.InboundRtp
2173
+ */
2174
+ export const InboundRtp = new InboundRtp$Type();
2175
+ // @generated message type with reflection information, may provide speed optimized methods
2176
+ class OutboundRtp$Type extends MessageType<OutboundRtp> {
2177
+ constructor() {
2178
+ super('stream.video.sfu.models.OutboundRtp', [
2179
+ { no: 1, name: 'base', kind: 'message', T: () => RtpBase },
2180
+ { no: 10, name: 'fps', kind: 'scalar', T: 1 /*ScalarType.DOUBLE*/ },
2181
+ {
2182
+ no: 11,
2183
+ name: 'avg_encode_time_seconds',
2184
+ kind: 'scalar',
2185
+ T: 1 /*ScalarType.DOUBLE*/,
2186
+ },
2187
+ {
2188
+ no: 12,
2189
+ name: 'bitrate_bps',
2190
+ kind: 'scalar',
2191
+ T: 1 /*ScalarType.DOUBLE*/,
2192
+ },
2193
+ {
2194
+ no: 13,
2195
+ name: 'min_dimension_px',
2196
+ kind: 'scalar',
2197
+ T: 13 /*ScalarType.UINT32*/,
2198
+ },
2199
+ ]);
2200
+ }
2201
+ }
2202
+ /**
2203
+ * @generated MessageType for protobuf message stream.video.sfu.models.OutboundRtp
2204
+ */
2205
+ export const OutboundRtp = new OutboundRtp$Type();
2206
+ // @generated message type with reflection information, may provide speed optimized methods
2207
+ class RemoteInboundRtp$Type extends MessageType<RemoteInboundRtp> {
2208
+ constructor() {
2209
+ super('stream.video.sfu.models.RemoteInboundRtp', [
2210
+ { no: 1, name: 'base', kind: 'message', T: () => RtpBase },
2211
+ {
2212
+ no: 2,
2213
+ name: 'jitter_seconds',
2214
+ kind: 'scalar',
2215
+ T: 1 /*ScalarType.DOUBLE*/,
2216
+ },
2217
+ {
2218
+ no: 3,
2219
+ name: 'round_trip_time_s',
2220
+ kind: 'scalar',
2221
+ T: 1 /*ScalarType.DOUBLE*/,
2222
+ },
2223
+ ]);
2224
+ }
2225
+ }
2226
+ /**
2227
+ * @generated MessageType for protobuf message stream.video.sfu.models.RemoteInboundRtp
2228
+ */
2229
+ export const RemoteInboundRtp = new RemoteInboundRtp$Type();
2230
+ // @generated message type with reflection information, may provide speed optimized methods
2231
+ class RemoteOutboundRtp$Type extends MessageType<RemoteOutboundRtp> {
2232
+ constructor() {
2233
+ super('stream.video.sfu.models.RemoteOutboundRtp', [
2234
+ { no: 1, name: 'base', kind: 'message', T: () => RtpBase },
2235
+ {
2236
+ no: 2,
2237
+ name: 'jitter_seconds',
2238
+ kind: 'scalar',
2239
+ T: 1 /*ScalarType.DOUBLE*/,
2240
+ },
2241
+ {
2242
+ no: 3,
2243
+ name: 'round_trip_time_s',
2244
+ kind: 'scalar',
2245
+ T: 1 /*ScalarType.DOUBLE*/,
2246
+ },
2247
+ ]);
2248
+ }
2249
+ }
2250
+ /**
2251
+ * @generated MessageType for protobuf message stream.video.sfu.models.RemoteOutboundRtp
2252
+ */
2253
+ export const RemoteOutboundRtp = new RemoteOutboundRtp$Type();
@@ -14,6 +14,8 @@ import type {
14
14
  ICETrickleResponse,
15
15
  SendAnswerRequest,
16
16
  SendAnswerResponse,
17
+ SendMetricsRequest,
18
+ SendMetricsResponse,
17
19
  SendStatsRequest,
18
20
  SendStatsResponse,
19
21
  SetPublisherRequest,
@@ -92,6 +94,13 @@ export interface ISignalServerClient {
92
94
  input: SendStatsRequest,
93
95
  options?: RpcOptions,
94
96
  ): UnaryCall<SendStatsRequest, SendStatsResponse>;
97
+ /**
98
+ * @generated from protobuf rpc: SendMetrics(stream.video.sfu.signal.SendMetricsRequest) returns (stream.video.sfu.signal.SendMetricsResponse);
99
+ */
100
+ sendMetrics(
101
+ input: SendMetricsRequest,
102
+ options?: RpcOptions,
103
+ ): UnaryCall<SendMetricsRequest, SendMetricsResponse>;
95
104
  /**
96
105
  * @generated from protobuf rpc: StartNoiseCancellation(stream.video.sfu.signal.StartNoiseCancellationRequest) returns (stream.video.sfu.signal.StartNoiseCancellationResponse);
97
106
  */
@@ -240,6 +249,23 @@ export class SignalServerClient implements ISignalServerClient, ServiceInfo {
240
249
  input,
241
250
  );
242
251
  }
252
+ /**
253
+ * @generated from protobuf rpc: SendMetrics(stream.video.sfu.signal.SendMetricsRequest) returns (stream.video.sfu.signal.SendMetricsResponse);
254
+ */
255
+ sendMetrics(
256
+ input: SendMetricsRequest,
257
+ options?: RpcOptions,
258
+ ): UnaryCall<SendMetricsRequest, SendMetricsResponse> {
259
+ const method = this.methods[7],
260
+ opt = this._transport.mergeOptions(options);
261
+ return stackIntercept<SendMetricsRequest, SendMetricsResponse>(
262
+ 'unary',
263
+ this._transport,
264
+ method,
265
+ opt,
266
+ input,
267
+ );
268
+ }
243
269
  /**
244
270
  * @generated from protobuf rpc: StartNoiseCancellation(stream.video.sfu.signal.StartNoiseCancellationRequest) returns (stream.video.sfu.signal.StartNoiseCancellationResponse);
245
271
  */
@@ -247,7 +273,7 @@ export class SignalServerClient implements ISignalServerClient, ServiceInfo {
247
273
  input: StartNoiseCancellationRequest,
248
274
  options?: RpcOptions,
249
275
  ): UnaryCall<StartNoiseCancellationRequest, StartNoiseCancellationResponse> {
250
- const method = this.methods[7],
276
+ const method = this.methods[8],
251
277
  opt = this._transport.mergeOptions(options);
252
278
  return stackIntercept<
253
279
  StartNoiseCancellationRequest,
@@ -261,7 +287,7 @@ export class SignalServerClient implements ISignalServerClient, ServiceInfo {
261
287
  input: StopNoiseCancellationRequest,
262
288
  options?: RpcOptions,
263
289
  ): UnaryCall<StopNoiseCancellationRequest, StopNoiseCancellationResponse> {
264
- const method = this.methods[8],
290
+ const method = this.methods[9],
265
291
  opt = this._transport.mergeOptions(options);
266
292
  return stackIntercept<
267
293
  StopNoiseCancellationRequest,
@@ -1,23 +1,24 @@
1
1
  // @generated by protobuf-ts 2.10.0 with parameter long_type_string,client_generic,server_none,eslint_disable,optimize_code_size
2
2
  // @generated from protobuf file "video/sfu/signal_rpc/signal.proto" (package "stream.video.sfu.signal", syntax proto3)
3
3
  // tslint:disable
4
- import {
5
- AndroidState,
6
- AppleState,
7
- Error,
8
- ICETrickle,
9
- InputDevices,
10
- PeerType,
11
- PerformanceStats,
12
- RTMPIngress,
13
- TrackInfo,
14
- TrackType,
15
- VideoDimension,
16
- WebsocketReconnectStrategy,
17
- } from '../models/models';
4
+ import { ICETrickle } from '../models/models';
18
5
  import { ServiceType } from '@protobuf-ts/runtime-rpc';
19
6
  import { MessageType } from '@protobuf-ts/runtime';
20
-
7
+ import { TrackInfo } from '../models/models';
8
+ import { VideoDimension } from '../models/models';
9
+ import { TrackType } from '../models/models';
10
+ import { PeerType } from '../models/models';
11
+ import { PerformanceStats } from '../models/models';
12
+ import { RTMPIngress } from '../models/models';
13
+ import { AppleState } from '../models/models';
14
+ import { AndroidState } from '../models/models';
15
+ import { InputDevices } from '../models/models';
16
+ import { RemoteOutboundRtp } from '../models/models';
17
+ import { RemoteInboundRtp } from '../models/models';
18
+ import { OutboundRtp } from '../models/models';
19
+ import { InboundRtp } from '../models/models';
20
+ import { WebsocketReconnectStrategy } from '../models/models';
21
+ import { Error } from '../models/models';
21
22
  /**
22
23
  * @generated from protobuf message stream.video.sfu.signal.StartNoiseCancellationRequest
23
24
  */
@@ -93,6 +94,39 @@ export interface Telemetry {
93
94
  oneofKind: undefined;
94
95
  };
95
96
  }
97
+ /**
98
+ * @generated from protobuf message stream.video.sfu.signal.SendMetricsRequest
99
+ */
100
+ export interface SendMetricsRequest {
101
+ /**
102
+ * @generated from protobuf field: string session_id = 1;
103
+ */
104
+ sessionId: string;
105
+ /**
106
+ * @generated from protobuf field: string unified_session_id = 2;
107
+ */
108
+ unifiedSessionId: string;
109
+ /**
110
+ * @generated from protobuf field: repeated stream.video.sfu.models.InboundRtp inbounds = 3;
111
+ */
112
+ inbounds: InboundRtp[];
113
+ /**
114
+ * @generated from protobuf field: repeated stream.video.sfu.models.OutboundRtp outbounds = 4;
115
+ */
116
+ outbounds: OutboundRtp[];
117
+ /**
118
+ * @generated from protobuf field: repeated stream.video.sfu.models.RemoteInboundRtp remote_inbounds = 5;
119
+ */
120
+ remoteInbounds: RemoteInboundRtp[];
121
+ /**
122
+ * @generated from protobuf field: repeated stream.video.sfu.models.RemoteOutboundRtp remote_outbounds = 6;
123
+ */
124
+ remoteOutbounds: RemoteOutboundRtp[];
125
+ }
126
+ /**
127
+ * @generated from protobuf message stream.video.sfu.signal.SendMetricsResponse
128
+ */
129
+ export interface SendMetricsResponse {}
96
130
  /**
97
131
  * @generated from protobuf message stream.video.sfu.signal.SendStatsRequest
98
132
  */
@@ -336,6 +370,10 @@ export interface SendAnswerRequest {
336
370
  * @generated from protobuf field: string session_id = 3;
337
371
  */
338
372
  sessionId: string;
373
+ /**
374
+ * @generated from protobuf field: uint32 negotiation_id = 4;
375
+ */
376
+ negotiationId: number;
339
377
  }
340
378
  /**
341
379
  * @generated from protobuf message stream.video.sfu.signal.SendAnswerResponse
@@ -502,6 +540,62 @@ class Telemetry$Type extends MessageType<Telemetry> {
502
540
  */
503
541
  export const Telemetry = new Telemetry$Type();
504
542
  // @generated message type with reflection information, may provide speed optimized methods
543
+ class SendMetricsRequest$Type extends MessageType<SendMetricsRequest> {
544
+ constructor() {
545
+ super('stream.video.sfu.signal.SendMetricsRequest', [
546
+ { no: 1, name: 'session_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
547
+ {
548
+ no: 2,
549
+ name: 'unified_session_id',
550
+ kind: 'scalar',
551
+ T: 9 /*ScalarType.STRING*/,
552
+ },
553
+ {
554
+ no: 3,
555
+ name: 'inbounds',
556
+ kind: 'message',
557
+ repeat: 2 /*RepeatType.UNPACKED*/,
558
+ T: () => InboundRtp,
559
+ },
560
+ {
561
+ no: 4,
562
+ name: 'outbounds',
563
+ kind: 'message',
564
+ repeat: 2 /*RepeatType.UNPACKED*/,
565
+ T: () => OutboundRtp,
566
+ },
567
+ {
568
+ no: 5,
569
+ name: 'remote_inbounds',
570
+ kind: 'message',
571
+ repeat: 2 /*RepeatType.UNPACKED*/,
572
+ T: () => RemoteInboundRtp,
573
+ },
574
+ {
575
+ no: 6,
576
+ name: 'remote_outbounds',
577
+ kind: 'message',
578
+ repeat: 2 /*RepeatType.UNPACKED*/,
579
+ T: () => RemoteOutboundRtp,
580
+ },
581
+ ]);
582
+ }
583
+ }
584
+ /**
585
+ * @generated MessageType for protobuf message stream.video.sfu.signal.SendMetricsRequest
586
+ */
587
+ export const SendMetricsRequest = new SendMetricsRequest$Type();
588
+ // @generated message type with reflection information, may provide speed optimized methods
589
+ class SendMetricsResponse$Type extends MessageType<SendMetricsResponse> {
590
+ constructor() {
591
+ super('stream.video.sfu.signal.SendMetricsResponse', []);
592
+ }
593
+ }
594
+ /**
595
+ * @generated MessageType for protobuf message stream.video.sfu.signal.SendMetricsResponse
596
+ */
597
+ export const SendMetricsResponse = new SendMetricsResponse$Type();
598
+ // @generated message type with reflection information, may provide speed optimized methods
505
599
  class SendStatsRequest$Type extends MessageType<SendStatsRequest> {
506
600
  constructor() {
507
601
  super('stream.video.sfu.signal.SendStatsRequest', [
@@ -776,6 +870,12 @@ class SendAnswerRequest$Type extends MessageType<SendAnswerRequest> {
776
870
  },
777
871
  { no: 2, name: 'sdp', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
778
872
  { no: 3, name: 'session_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
873
+ {
874
+ no: 4,
875
+ name: 'negotiation_id',
876
+ kind: 'scalar',
877
+ T: 13 /*ScalarType.UINT32*/,
878
+ },
779
879
  ]);
780
880
  }
781
881
  }
@@ -885,6 +985,12 @@ export const SignalServer = new ServiceType(
885
985
  I: SendStatsRequest,
886
986
  O: SendStatsResponse,
887
987
  },
988
+ {
989
+ name: 'SendMetrics',
990
+ options: {},
991
+ I: SendMetricsRequest,
992
+ O: SendMetricsResponse,
993
+ },
888
994
  {
889
995
  name: 'StartNoiseCancellation',
890
996
  options: {},
@@ -23,6 +23,14 @@ import { VisibilityState } from '../../types';
23
23
  import { noopComparator } from '../../sorting';
24
24
  import { TrackType } from '../../gen/video/sfu/models/models';
25
25
 
26
+ vi.mock(import('../browsers'), async (importOriginal) => {
27
+ const module = await importOriginal();
28
+ return {
29
+ ...module,
30
+ isSafari: () => globalThis._isSafari ?? false,
31
+ };
32
+ });
33
+
26
34
  describe('DynascaleManager', () => {
27
35
  let dynascaleManager: DynascaleManager;
28
36
  let call: Call;
@@ -50,13 +58,6 @@ describe('DynascaleManager', () => {
50
58
  beforeEach(() => {
51
59
  // Mock global isSafari to false for testing
52
60
  globalThis._isSafari = false;
53
- vi.mock(import('../browsers'), async (importOriginal) => {
54
- const module = await importOriginal();
55
- return {
56
- ...module,
57
- isSafari: () => globalThis._isSafari ?? false,
58
- };
59
- });
60
61
 
61
62
  dynascaleManager.setUseWebAudio(false);
62
63
 
@@ -9,6 +9,10 @@ import {
9
9
  import { getClientDetails } from '../client-details';
10
10
  import { ClientDetails } from '../../gen/video/sfu/models/models';
11
11
 
12
+ vi.mock('../client-details', () => ({
13
+ getClientDetails: vi.fn(),
14
+ }));
15
+
12
16
  describe('browsers', () => {
13
17
  beforeEach(() => {
14
18
  Object.defineProperty(globalThis, 'navigator', {
@@ -156,10 +160,6 @@ describe('browsers', () => {
156
160
  });
157
161
 
158
162
  describe('isSupportedBrowser', () => {
159
- vi.mock('../client-details', () => ({
160
- getClientDetails: vi.fn(),
161
- }));
162
-
163
163
  it('should return false if browser is undefined', async () => {
164
164
  vi.mocked(getClientDetails).mockResolvedValue({
165
165
  browser: undefined,