@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
@@ -623,6 +623,10 @@ export interface SubscriberOffer {
623
623
  * @generated from protobuf field: string sdp = 2;
624
624
  */
625
625
  sdp: string;
626
+ /**
627
+ * @generated from protobuf field: uint32 negotiation_id = 3;
628
+ */
629
+ negotiationId: number;
626
630
  }
627
631
  /**
628
632
  * @generated from protobuf message stream.video.sfu.event.PublisherAnswer
@@ -449,6 +449,10 @@ export interface ClientDetails {
449
449
  * @generated from protobuf field: stream.video.sfu.models.Device device = 4;
450
450
  */
451
451
  device?: Device;
452
+ /**
453
+ * @generated from protobuf field: string webrtc_version = 5;
454
+ */
455
+ webrtcVersion: string;
452
456
  }
453
457
  /**
454
458
  * @generated from protobuf message stream.video.sfu.models.Sdk
@@ -702,6 +706,155 @@ export interface PerformanceStats {
702
706
  */
703
707
  targetBitrate: number;
704
708
  }
709
+ /**
710
+ * ===================================================================
711
+ * BASE (shared by all RTP directions)
712
+ * ===================================================================
713
+ *
714
+ * @generated from protobuf message stream.video.sfu.models.RtpBase
715
+ */
716
+ export interface RtpBase {
717
+ /**
718
+ * @generated from protobuf field: uint32 ssrc = 1;
719
+ */
720
+ ssrc: number;
721
+ /**
722
+ * @generated from protobuf field: string kind = 2;
723
+ */
724
+ kind: string;
725
+ /**
726
+ * @generated from protobuf field: double timestamp_ms = 3;
727
+ */
728
+ timestampMs: number;
729
+ }
730
+ /**
731
+ * ===================================================================
732
+ * INBOUND (SUBSCRIBER RECEIVING MEDIA)
733
+ * ===================================================================
734
+ *
735
+ * @generated from protobuf message stream.video.sfu.models.InboundRtp
736
+ */
737
+ export interface InboundRtp {
738
+ /**
739
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
740
+ */
741
+ base?: RtpBase;
742
+ /**
743
+ * @generated from protobuf field: double jitter_seconds = 2;
744
+ */
745
+ jitterSeconds: number;
746
+ /**
747
+ * @generated from protobuf field: uint64 packets_received = 3;
748
+ */
749
+ packetsReceived: string;
750
+ /**
751
+ * @generated from protobuf field: uint64 packets_lost = 4;
752
+ */
753
+ packetsLost: string;
754
+ /**
755
+ * @generated from protobuf field: double packet_loss_percent = 5;
756
+ */
757
+ packetLossPercent: number;
758
+ /**
759
+ * -------- AUDIO METRICS --------
760
+ *
761
+ * @generated from protobuf field: uint32 concealment_events = 10;
762
+ */
763
+ concealmentEvents: number;
764
+ /**
765
+ * @generated from protobuf field: double concealment_percent = 11;
766
+ */
767
+ concealmentPercent: number;
768
+ /**
769
+ * -------- VIDEO METRICS --------
770
+ *
771
+ * @generated from protobuf field: double fps = 20;
772
+ */
773
+ fps: number;
774
+ /**
775
+ * @generated from protobuf field: double freeze_duration_seconds = 21;
776
+ */
777
+ freezeDurationSeconds: number;
778
+ /**
779
+ * @generated from protobuf field: double avg_decode_time_seconds = 22;
780
+ */
781
+ avgDecodeTimeSeconds: number;
782
+ /**
783
+ * @generated from protobuf field: uint32 min_dimension_px = 23;
784
+ */
785
+ minDimensionPx: number;
786
+ }
787
+ /**
788
+ * ===================================================================
789
+ * OUTBOUND (PUBLISHER SENDING MEDIA)
790
+ * ===================================================================
791
+ *
792
+ * @generated from protobuf message stream.video.sfu.models.OutboundRtp
793
+ */
794
+ export interface OutboundRtp {
795
+ /**
796
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
797
+ */
798
+ base?: RtpBase;
799
+ /**
800
+ * @generated from protobuf field: double fps = 10;
801
+ */
802
+ fps: number;
803
+ /**
804
+ * @generated from protobuf field: double avg_encode_time_seconds = 11;
805
+ */
806
+ avgEncodeTimeSeconds: number;
807
+ /**
808
+ * @generated from protobuf field: double bitrate_bps = 12;
809
+ */
810
+ bitrateBps: number;
811
+ /**
812
+ * @generated from protobuf field: uint32 min_dimension_px = 13;
813
+ */
814
+ minDimensionPx: number;
815
+ }
816
+ /**
817
+ * ===================================================================
818
+ * SFU FEEDBACK: REMOTE-INBOUND (Publisher receives feedback)
819
+ * ===================================================================
820
+ *
821
+ * @generated from protobuf message stream.video.sfu.models.RemoteInboundRtp
822
+ */
823
+ export interface RemoteInboundRtp {
824
+ /**
825
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
826
+ */
827
+ base?: RtpBase;
828
+ /**
829
+ * @generated from protobuf field: double jitter_seconds = 2;
830
+ */
831
+ jitterSeconds: number;
832
+ /**
833
+ * @generated from protobuf field: double round_trip_time_s = 3;
834
+ */
835
+ roundTripTimeS: number;
836
+ }
837
+ /**
838
+ * ===================================================================
839
+ * SFU FEEDBACK: REMOTE-OUTBOUND (Subscriber receives feedback)
840
+ * ===================================================================
841
+ *
842
+ * @generated from protobuf message stream.video.sfu.models.RemoteOutboundRtp
843
+ */
844
+ export interface RemoteOutboundRtp {
845
+ /**
846
+ * @generated from protobuf field: stream.video.sfu.models.RtpBase base = 1;
847
+ */
848
+ base?: RtpBase;
849
+ /**
850
+ * @generated from protobuf field: double jitter_seconds = 2;
851
+ */
852
+ jitterSeconds: number;
853
+ /**
854
+ * @generated from protobuf field: double round_trip_time_s = 3;
855
+ */
856
+ roundTripTimeS: number;
857
+ }
705
858
  /**
706
859
  * @generated from protobuf enum stream.video.sfu.models.PeerType
707
860
  */
@@ -968,7 +1121,15 @@ export declare enum SdkType {
968
1121
  /**
969
1122
  * @generated from protobuf enum value: SDK_TYPE_PLAIN_JAVASCRIPT = 9;
970
1123
  */
971
- PLAIN_JAVASCRIPT = 9
1124
+ PLAIN_JAVASCRIPT = 9,
1125
+ /**
1126
+ * @generated from protobuf enum value: SDK_TYPE_PYTHON = 10;
1127
+ */
1128
+ PYTHON = 10,
1129
+ /**
1130
+ * @generated from protobuf enum value: SDK_TYPE_VISION_AGENTS = 11;
1131
+ */
1132
+ VISION_AGENTS = 11
972
1133
  }
973
1134
  /**
974
1135
  * @generated from protobuf enum stream.video.sfu.models.TrackUnpublishReason
@@ -1172,7 +1333,13 @@ export declare enum ClientCapability {
1172
1333
  *
1173
1334
  * @generated from protobuf enum value: CLIENT_CAPABILITY_SUBSCRIBER_VIDEO_PAUSE = 1;
1174
1335
  */
1175
- SUBSCRIBER_VIDEO_PAUSE = 1
1336
+ SUBSCRIBER_VIDEO_PAUSE = 1,
1337
+ /**
1338
+ * Instructs SFU that stats will be sent to the coordinator
1339
+ *
1340
+ * @generated from protobuf enum value: CLIENT_CAPABILITY_COORDINATOR_STATS = 2;
1341
+ */
1342
+ COORDINATOR_STATS = 2
1176
1343
  }
1177
1344
  /**
1178
1345
  * DegradationPreference represents the RTCDegradationPreference from WebRTC.
@@ -1384,4 +1551,39 @@ declare class PerformanceStats$Type extends MessageType<PerformanceStats> {
1384
1551
  * @generated MessageType for protobuf message stream.video.sfu.models.PerformanceStats
1385
1552
  */
1386
1553
  export declare const PerformanceStats: PerformanceStats$Type;
1554
+ declare class RtpBase$Type extends MessageType<RtpBase> {
1555
+ constructor();
1556
+ }
1557
+ /**
1558
+ * @generated MessageType for protobuf message stream.video.sfu.models.RtpBase
1559
+ */
1560
+ export declare const RtpBase: RtpBase$Type;
1561
+ declare class InboundRtp$Type extends MessageType<InboundRtp> {
1562
+ constructor();
1563
+ }
1564
+ /**
1565
+ * @generated MessageType for protobuf message stream.video.sfu.models.InboundRtp
1566
+ */
1567
+ export declare const InboundRtp: InboundRtp$Type;
1568
+ declare class OutboundRtp$Type extends MessageType<OutboundRtp> {
1569
+ constructor();
1570
+ }
1571
+ /**
1572
+ * @generated MessageType for protobuf message stream.video.sfu.models.OutboundRtp
1573
+ */
1574
+ export declare const OutboundRtp: OutboundRtp$Type;
1575
+ declare class RemoteInboundRtp$Type extends MessageType<RemoteInboundRtp> {
1576
+ constructor();
1577
+ }
1578
+ /**
1579
+ * @generated MessageType for protobuf message stream.video.sfu.models.RemoteInboundRtp
1580
+ */
1581
+ export declare const RemoteInboundRtp: RemoteInboundRtp$Type;
1582
+ declare class RemoteOutboundRtp$Type extends MessageType<RemoteOutboundRtp> {
1583
+ constructor();
1584
+ }
1585
+ /**
1586
+ * @generated MessageType for protobuf message stream.video.sfu.models.RemoteOutboundRtp
1587
+ */
1588
+ export declare const RemoteOutboundRtp: RemoteOutboundRtp$Type;
1387
1589
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from '@protobuf-ts/runtime-rpc';
2
- import type { ICERestartRequest, ICERestartResponse, ICETrickleResponse, SendAnswerRequest, SendAnswerResponse, SendStatsRequest, SendStatsResponse, SetPublisherRequest, SetPublisherResponse, StartNoiseCancellationRequest, StartNoiseCancellationResponse, StopNoiseCancellationRequest, StopNoiseCancellationResponse, UpdateMuteStatesRequest, UpdateMuteStatesResponse, UpdateSubscriptionsRequest, UpdateSubscriptionsResponse } from './signal';
2
+ import type { ICERestartRequest, ICERestartResponse, ICETrickleResponse, SendAnswerRequest, SendAnswerResponse, SendMetricsRequest, SendMetricsResponse, SendStatsRequest, SendStatsResponse, SetPublisherRequest, SetPublisherResponse, StartNoiseCancellationRequest, StartNoiseCancellationResponse, StopNoiseCancellationRequest, StopNoiseCancellationResponse, UpdateMuteStatesRequest, UpdateMuteStatesResponse, UpdateSubscriptionsRequest, UpdateSubscriptionsResponse } from './signal';
3
3
  import type { ICETrickle } from '../models/models';
4
4
  /**
5
5
  * @generated from protobuf service stream.video.sfu.signal.SignalServer
@@ -42,6 +42,10 @@ export interface ISignalServerClient {
42
42
  * @generated from protobuf rpc: SendStats(stream.video.sfu.signal.SendStatsRequest) returns (stream.video.sfu.signal.SendStatsResponse);
43
43
  */
44
44
  sendStats(input: SendStatsRequest, options?: RpcOptions): UnaryCall<SendStatsRequest, SendStatsResponse>;
45
+ /**
46
+ * @generated from protobuf rpc: SendMetrics(stream.video.sfu.signal.SendMetricsRequest) returns (stream.video.sfu.signal.SendMetricsResponse);
47
+ */
48
+ sendMetrics(input: SendMetricsRequest, options?: RpcOptions): UnaryCall<SendMetricsRequest, SendMetricsResponse>;
45
49
  /**
46
50
  * @generated from protobuf rpc: StartNoiseCancellation(stream.video.sfu.signal.StartNoiseCancellationRequest) returns (stream.video.sfu.signal.StartNoiseCancellationResponse);
47
51
  */
@@ -99,6 +103,10 @@ export declare class SignalServerClient implements ISignalServerClient, ServiceI
99
103
  * @generated from protobuf rpc: SendStats(stream.video.sfu.signal.SendStatsRequest) returns (stream.video.sfu.signal.SendStatsResponse);
100
104
  */
101
105
  sendStats(input: SendStatsRequest, options?: RpcOptions): UnaryCall<SendStatsRequest, SendStatsResponse>;
106
+ /**
107
+ * @generated from protobuf rpc: SendMetrics(stream.video.sfu.signal.SendMetricsRequest) returns (stream.video.sfu.signal.SendMetricsResponse);
108
+ */
109
+ sendMetrics(input: SendMetricsRequest, options?: RpcOptions): UnaryCall<SendMetricsRequest, SendMetricsResponse>;
102
110
  /**
103
111
  * @generated from protobuf rpc: StartNoiseCancellation(stream.video.sfu.signal.StartNoiseCancellationRequest) returns (stream.video.sfu.signal.StartNoiseCancellationResponse);
104
112
  */
@@ -1,6 +1,20 @@
1
- import { AndroidState, AppleState, Error, InputDevices, PeerType, PerformanceStats, RTMPIngress, TrackInfo, TrackType, VideoDimension, WebsocketReconnectStrategy } from '../models/models';
2
1
  import { ServiceType } from '@protobuf-ts/runtime-rpc';
3
2
  import { MessageType } from '@protobuf-ts/runtime';
3
+ import { TrackInfo } from '../models/models';
4
+ import { VideoDimension } from '../models/models';
5
+ import { TrackType } from '../models/models';
6
+ import { PeerType } from '../models/models';
7
+ import { PerformanceStats } from '../models/models';
8
+ import { RTMPIngress } from '../models/models';
9
+ import { AppleState } from '../models/models';
10
+ import { AndroidState } from '../models/models';
11
+ import { InputDevices } from '../models/models';
12
+ import { RemoteOutboundRtp } from '../models/models';
13
+ import { RemoteInboundRtp } from '../models/models';
14
+ import { OutboundRtp } from '../models/models';
15
+ import { InboundRtp } from '../models/models';
16
+ import { WebsocketReconnectStrategy } from '../models/models';
17
+ import { Error } from '../models/models';
4
18
  /**
5
19
  * @generated from protobuf message stream.video.sfu.signal.StartNoiseCancellationRequest
6
20
  */
@@ -73,6 +87,40 @@ export interface Telemetry {
73
87
  oneofKind: undefined;
74
88
  };
75
89
  }
90
+ /**
91
+ * @generated from protobuf message stream.video.sfu.signal.SendMetricsRequest
92
+ */
93
+ export interface SendMetricsRequest {
94
+ /**
95
+ * @generated from protobuf field: string session_id = 1;
96
+ */
97
+ sessionId: string;
98
+ /**
99
+ * @generated from protobuf field: string unified_session_id = 2;
100
+ */
101
+ unifiedSessionId: string;
102
+ /**
103
+ * @generated from protobuf field: repeated stream.video.sfu.models.InboundRtp inbounds = 3;
104
+ */
105
+ inbounds: InboundRtp[];
106
+ /**
107
+ * @generated from protobuf field: repeated stream.video.sfu.models.OutboundRtp outbounds = 4;
108
+ */
109
+ outbounds: OutboundRtp[];
110
+ /**
111
+ * @generated from protobuf field: repeated stream.video.sfu.models.RemoteInboundRtp remote_inbounds = 5;
112
+ */
113
+ remoteInbounds: RemoteInboundRtp[];
114
+ /**
115
+ * @generated from protobuf field: repeated stream.video.sfu.models.RemoteOutboundRtp remote_outbounds = 6;
116
+ */
117
+ remoteOutbounds: RemoteOutboundRtp[];
118
+ }
119
+ /**
120
+ * @generated from protobuf message stream.video.sfu.signal.SendMetricsResponse
121
+ */
122
+ export interface SendMetricsResponse {
123
+ }
76
124
  /**
77
125
  * @generated from protobuf message stream.video.sfu.signal.SendStatsRequest
78
126
  */
@@ -313,6 +361,10 @@ export interface SendAnswerRequest {
313
361
  * @generated from protobuf field: string session_id = 3;
314
362
  */
315
363
  sessionId: string;
364
+ /**
365
+ * @generated from protobuf field: uint32 negotiation_id = 4;
366
+ */
367
+ negotiationId: number;
316
368
  }
317
369
  /**
318
370
  * @generated from protobuf message stream.video.sfu.signal.SendAnswerResponse
@@ -416,6 +468,20 @@ declare class Telemetry$Type extends MessageType<Telemetry> {
416
468
  * @generated MessageType for protobuf message stream.video.sfu.signal.Telemetry
417
469
  */
418
470
  export declare const Telemetry: Telemetry$Type;
471
+ declare class SendMetricsRequest$Type extends MessageType<SendMetricsRequest> {
472
+ constructor();
473
+ }
474
+ /**
475
+ * @generated MessageType for protobuf message stream.video.sfu.signal.SendMetricsRequest
476
+ */
477
+ export declare const SendMetricsRequest: SendMetricsRequest$Type;
478
+ declare class SendMetricsResponse$Type extends MessageType<SendMetricsResponse> {
479
+ constructor();
480
+ }
481
+ /**
482
+ * @generated MessageType for protobuf message stream.video.sfu.signal.SendMetricsResponse
483
+ */
484
+ export declare const SendMetricsResponse: SendMetricsResponse$Type;
419
485
  declare class SendStatsRequest$Type extends MessageType<SendStatsRequest> {
420
486
  constructor();
421
487
  }
@@ -1,4 +1,5 @@
1
1
  import { StreamVideoParticipant, VideoTrackType } from '../types';
2
+ import { TrackType } from '../gen/video/sfu/models/models';
2
3
  /**
3
4
  * Check if a participant has a video.
4
5
  *
@@ -29,6 +30,15 @@ export declare const hasScreenShareAudio: (p: StreamVideoParticipant) => boolean
29
30
  * @param p the participant.
30
31
  */
31
32
  export declare const isPinned: (p: StreamVideoParticipant) => boolean;
33
+ /**
34
+ * Check if a participant has a track that is currently interrupted: the
35
+ * participant intends to publish it (it is in `publishedTracks`) but no
36
+ * media is flowing right now (it is in `interruptedTracks`).
37
+ *
38
+ * @param p the participant to check.
39
+ * @param trackType the track type to check.
40
+ */
41
+ export declare const hasInterruptedTrack: (p: StreamVideoParticipant, trackType: TrackType) => boolean;
32
42
  /**
33
43
  * Check if a participant has a paused track of the specified type.
34
44
  *
@@ -37,7 +37,7 @@ export declare abstract class BasePeerConnection {
37
37
  /**
38
38
  * Constructs a new `BasePeerConnection` instance.
39
39
  */
40
- protected constructor(peerType: PeerType, { sfuClient, connectionConfig, state, dispatcher, onReconnectionNeeded, onIceConnected, tag, enableTracing, clientPublishOptions, iceRestartDelay, }: BasePeerConnectionOpts);
40
+ protected constructor(peerType: PeerType, { sfuClient, connectionConfig, state, dispatcher, onReconnectionNeeded, onIceConnected, tag, enableTracing, clientPublishOptions, iceRestartDelay, statsTimestampDriftThresholdMs, }: BasePeerConnectionOpts);
41
41
  private createPeerConnection;
42
42
  /**
43
43
  * Disposes the `RTCPeerConnection` instance.
@@ -48,6 +48,7 @@ export type BasePeerConnectionOpts = {
48
48
  enableTracing: boolean;
49
49
  iceRestartDelay?: number;
50
50
  clientPublishOptions?: ClientPublishOptions;
51
+ statsTimestampDriftThresholdMs?: number;
51
52
  };
52
53
  export type TrackPublishOptions = {
53
54
  audioBitrateProfile?: AudioBitrateProfile;
@@ -12,6 +12,7 @@ export declare class StatsTracer {
12
12
  private readonly pc;
13
13
  private readonly peerType;
14
14
  private readonly trackIdToTrackType;
15
+ private readonly driftThresholdMs;
15
16
  private costOverrides?;
16
17
  private previousStats;
17
18
  private frameTimeHistory;
@@ -19,7 +20,7 @@ export declare class StatsTracer {
19
20
  /**
20
21
  * Creates a new StatsTracer instance.
21
22
  */
22
- constructor(pc: RTCPeerConnection, peerType: PeerType, trackIdToTrackType: Map<string, TrackType>);
23
+ constructor(pc: RTCPeerConnection, peerType: PeerType, trackIdToTrackType: Map<string, TrackType>, statsTimestampDriftThresholdMs?: number);
23
24
  /**
24
25
  * Get the stats from the RTCPeerConnection.
25
26
  * When called, it will return the stats for the current connection.
@@ -23,6 +23,7 @@ export declare const getSdkSignature: (clientDetails: ClientDetails) => {
23
23
  os?: import("../gen/video/sfu/models/models").OS;
24
24
  browser?: import("../gen/video/sfu/models/models").Browser;
25
25
  device?: import("../gen/video/sfu/models/models").Device;
26
+ webrtcVersion: string;
26
27
  sdkName: string;
27
28
  sdkVersion: string;
28
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "1.51.0",
3
+ "version": "1.52.0",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "browser": "dist/index.browser.es.js",
@@ -36,29 +36,29 @@
36
36
  "@protobuf-ts/twirp-transport": "^2.11.1",
37
37
  "@stream-io/logger": "^2.0.0",
38
38
  "@stream-io/worker-timer": "^1.2.5",
39
- "axios": "^1.12.2",
39
+ "axios": "^1.16.1",
40
40
  "rxjs": "~7.8.2",
41
41
  "sdp-transform": "^2.15.0",
42
42
  "ua-parser-js": "^1.0.41",
43
43
  "webrtc-adapter": "^8.2.4"
44
44
  },
45
45
  "devDependencies": {
46
- "@openapitools/openapi-generator-cli": "^2.25.0",
47
- "@rollup/plugin-replace": "^6.0.2",
48
- "@rollup/plugin-typescript": "^12.1.4",
49
- "@stream-io/audio-filters-web": "^0.8.1",
50
- "@stream-io/node-sdk": "^0.7.28",
46
+ "@openapitools/openapi-generator-cli": "^2.34.0",
47
+ "@rollup/plugin-replace": "^6.0.3",
48
+ "@rollup/plugin-typescript": "^12.3.0",
49
+ "@stream-io/audio-filters-web": "^0.8.2",
50
+ "@stream-io/node-sdk": "^0.7.59",
51
51
  "@total-typescript/shoehorn": "^0.1.2",
52
52
  "@types/sdp-transform": "^2.15.0",
53
53
  "@types/ua-parser-js": "^0.7.39",
54
- "@vitest/coverage-v8": "^3.2.4",
54
+ "@vitest/coverage-v8": "^4.1.7",
55
55
  "dotenv": "^16.6.1",
56
- "happy-dom": "^20.0.2",
57
- "prettier": "^3.6.2",
58
- "rimraf": "^6.0.1",
59
- "rollup": "^4.52.4",
56
+ "happy-dom": "^20.9.0",
57
+ "prettier": "^3.8.3",
58
+ "rimraf": "^6.1.3",
59
+ "rollup": "^4.60.4",
60
60
  "typescript": "^5.9.3",
61
- "vitest": "^3.2.4",
62
- "vitest-mock-extended": "^3.1.0"
61
+ "vitest": "^4.1.7",
62
+ "vitest-mock-extended": "^4.0.0"
63
63
  }
64
64
  }
package/src/Call.ts CHANGED
@@ -1458,7 +1458,10 @@ export class Call {
1458
1458
  closePreviousInstances,
1459
1459
  unifiedSessionId,
1460
1460
  } = opts;
1461
- const { enable_rtc_stats: enableTracing } = statsOptions;
1461
+ const {
1462
+ enable_rtc_stats: enableTracing,
1463
+ reporting_interval_ms: reportingIntervalMs,
1464
+ } = statsOptions;
1462
1465
  if (closePreviousInstances && this.subscriber) {
1463
1466
  await this.subscriber.dispose();
1464
1467
  }
@@ -1469,6 +1472,7 @@ export class Call {
1469
1472
  connectionConfig,
1470
1473
  tag: sfuClient.tag,
1471
1474
  enableTracing,
1475
+ statsTimestampDriftThresholdMs: reportingIntervalMs / 2,
1472
1476
  clientPublishOptions: this.clientPublishOptions,
1473
1477
  onReconnectionNeeded: (kind, reason, peerType) => {
1474
1478
  this.reconnect(kind, reason).catch((err) => {
@@ -50,7 +50,9 @@ vi.mock('../devices.ts', () => {
50
50
  vi.mock('../../Call.ts', () => {
51
51
  console.log('MOCKING Call');
52
52
  return {
53
- Call: vi.fn(() => mockCall()),
53
+ Call: vi.fn(function () {
54
+ return mockCall();
55
+ }),
54
56
  };
55
57
  });
56
58
 
@@ -25,7 +25,9 @@ import { readPreferences } from '../devicePersistence';
25
25
  vi.mock('../../Call.ts', () => {
26
26
  console.log('MOCKING Call');
27
27
  return {
28
- Call: vi.fn(() => mockCall()),
28
+ Call: vi.fn(function () {
29
+ return mockCall();
30
+ }),
29
31
  };
30
32
  });
31
33
 
@@ -76,7 +76,9 @@ vi.mock('../../helpers/no-audio-detector.ts', () => {
76
76
  vi.mock('../../Call.ts', () => {
77
77
  console.log('MOCKING Call');
78
78
  return {
79
- Call: vi.fn(() => mockCall()),
79
+ Call: vi.fn(function () {
80
+ return mockCall();
81
+ }),
80
82
  };
81
83
  });
82
84
 
@@ -43,7 +43,9 @@ vi.mock('../devices.ts', () => {
43
43
  vi.mock('../../Call.ts', () => {
44
44
  console.log('MOCKING Call');
45
45
  return {
46
- Call: vi.fn(() => mockCall()),
46
+ Call: vi.fn(function () {
47
+ return mockCall();
48
+ }),
47
49
  };
48
50
  });
49
51
 
@@ -26,7 +26,9 @@ vi.mock('../devices.ts', () => {
26
26
  vi.mock('../../Call.ts', () => {
27
27
  console.log('MOCKING Call');
28
28
  return {
29
- Call: vi.fn(() => mockCall()),
29
+ Call: vi.fn(function () {
30
+ return mockCall();
31
+ }),
30
32
  };
31
33
  });
32
34
 
@@ -63,7 +63,9 @@ export const setupAudioContextMock = () => {
63
63
  const mockContext = createMockAudioContext();
64
64
  vi.stubGlobal(
65
65
  'AudioContext',
66
- vi.fn(() => mockContext),
66
+ vi.fn(function () {
67
+ return mockContext;
68
+ }),
67
69
  );
68
70
  return mockContext;
69
71
  };
@@ -675,6 +675,10 @@ export interface SubscriberOffer {
675
675
  * @generated from protobuf field: string sdp = 2;
676
676
  */
677
677
  sdp: string;
678
+ /**
679
+ * @generated from protobuf field: uint32 negotiation_id = 3;
680
+ */
681
+ negotiationId: number;
678
682
  }
679
683
  /**
680
684
  * @generated from protobuf message stream.video.sfu.event.PublisherAnswer
@@ -1606,6 +1610,12 @@ class SubscriberOffer$Type extends MessageType<SubscriberOffer> {
1606
1610
  super('stream.video.sfu.event.SubscriberOffer', [
1607
1611
  { no: 1, name: 'ice_restart', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
1608
1612
  { no: 2, name: 'sdp', kind: 'scalar', T: 9 /*ScalarType.STRING*/ },
1613
+ {
1614
+ no: 3,
1615
+ name: 'negotiation_id',
1616
+ kind: 'scalar',
1617
+ T: 13 /*ScalarType.UINT32*/,
1618
+ },
1609
1619
  ]);
1610
1620
  }
1611
1621
  }