@stream-io/video-client 1.51.0 → 1.52.1-beta.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.
- package/CHANGELOG.md +13 -0
- package/dist/index.browser.es.js +382 -18
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +382 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +382 -18
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +13 -1
- package/dist/src/gen/google/protobuf/struct.d.ts +3 -1
- package/dist/src/gen/google/protobuf/timestamp.d.ts +3 -1
- package/dist/src/gen/video/sfu/event/events.d.ts +26 -1
- package/dist/src/gen/video/sfu/models/models.d.ts +208 -2
- package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +31 -2
- package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +67 -1
- package/dist/src/helpers/participantUtils.d.ts +10 -0
- package/dist/src/rtc/BasePeerConnection.d.ts +1 -1
- package/dist/src/rtc/Publisher.d.ts +4 -1
- package/dist/src/rtc/Subscriber.d.ts +7 -0
- package/dist/src/rtc/types.d.ts +1 -0
- package/dist/src/stats/rtc/StatsTracer.d.ts +2 -1
- package/dist/src/stats/utils.d.ts +1 -0
- package/package.json +14 -14
- package/src/Call.ts +51 -2
- package/src/devices/__tests__/CameraManager.test.ts +3 -1
- package/src/devices/__tests__/DeviceManager.test.ts +3 -1
- package/src/devices/__tests__/MicrophoneManager.test.ts +3 -1
- package/src/devices/__tests__/MicrophoneManagerRN.test.ts +3 -1
- package/src/devices/__tests__/ScreenShareManager.test.ts +3 -1
- package/src/devices/__tests__/web-audio.mocks.ts +3 -1
- package/src/gen/google/protobuf/struct.ts +7 -12
- package/src/gen/google/protobuf/timestamp.ts +6 -7
- package/src/gen/video/sfu/event/events.ts +33 -25
- package/src/gen/video/sfu/models/models.ts +349 -1
- package/src/gen/video/sfu/signal_rpc/signal.client.ts +51 -29
- package/src/gen/video/sfu/signal_rpc/signal.ts +122 -15
- package/src/helpers/__tests__/DynascaleManager.test.ts +8 -7
- package/src/helpers/__tests__/browsers.test.ts +4 -4
- package/src/helpers/__tests__/participantUtils.test.ts +47 -0
- package/src/helpers/client-details.ts +4 -1
- package/src/helpers/participantUtils.ts +15 -0
- package/src/rtc/BasePeerConnection.ts +7 -1
- package/src/rtc/Publisher.ts +4 -0
- package/src/rtc/Subscriber.ts +29 -1
- package/src/rtc/__tests__/Subscriber.test.ts +5 -1
- package/src/rtc/__tests__/mocks/webrtc.mocks.ts +16 -15
- package/src/rtc/types.ts +1 -0
- package/src/stats/rtc/StatsTracer.ts +25 -4
- package/src/stats/rtc/__tests__/StatsTracer.test.ts +155 -0
package/dist/src/Call.d.ts
CHANGED
|
@@ -127,6 +127,7 @@ export declare class Call {
|
|
|
127
127
|
private joinResponseTimeout?;
|
|
128
128
|
private rpcRequestTimeout?;
|
|
129
129
|
private joinCallData?;
|
|
130
|
+
private selfSubEnabled;
|
|
130
131
|
private hasJoinedOnce;
|
|
131
132
|
private deviceSettingsAppliedOnce;
|
|
132
133
|
private credentials?;
|
|
@@ -190,6 +191,16 @@ export declare class Call {
|
|
|
190
191
|
* Retrieves the current user ID.
|
|
191
192
|
*/
|
|
192
193
|
get currentUserId(): string | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* A flag indicating whether self-subscription is enabled for the call.
|
|
196
|
+
*/
|
|
197
|
+
get isSelfSubEnabled(): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* The largest video publish dimension across the current publish options.
|
|
200
|
+
*
|
|
201
|
+
* @internal
|
|
202
|
+
*/
|
|
203
|
+
getMaxVideoPublishDimension: () => VideoDimension | undefined;
|
|
193
204
|
/**
|
|
194
205
|
* A flag indicating whether the call was created by the current user.
|
|
195
206
|
*/
|
|
@@ -262,10 +273,11 @@ export declare class Call {
|
|
|
262
273
|
*
|
|
263
274
|
* @returns a promise which resolves once the call join-flow has finished.
|
|
264
275
|
*/
|
|
265
|
-
join: ({ maxJoinRetries, joinResponseTimeout, rpcRequestTimeout, ...data }?: JoinCallData & {
|
|
276
|
+
join: ({ maxJoinRetries, joinResponseTimeout, rpcRequestTimeout, selfSubEnabled, ...data }?: JoinCallData & {
|
|
266
277
|
maxJoinRetries?: number;
|
|
267
278
|
joinResponseTimeout?: number;
|
|
268
279
|
rpcRequestTimeout?: number;
|
|
280
|
+
selfSubEnabled?: boolean;
|
|
269
281
|
}) => Promise<void>;
|
|
270
282
|
/**
|
|
271
283
|
* Will make a single attempt to watch for call related WebSocket events
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JsonValue } from '@protobuf-ts/runtime';
|
|
2
|
+
import type { JsonReadOptions } from '@protobuf-ts/runtime';
|
|
3
|
+
import type { JsonWriteOptions } from '@protobuf-ts/runtime';
|
|
2
4
|
import { MessageType } from '@protobuf-ts/runtime';
|
|
3
5
|
/**
|
|
4
6
|
* `Struct` represents a structured data value, consisting of fields
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JsonValue } from '@protobuf-ts/runtime';
|
|
2
|
+
import type { JsonReadOptions } from '@protobuf-ts/runtime';
|
|
3
|
+
import type { JsonWriteOptions } from '@protobuf-ts/runtime';
|
|
2
4
|
import { MessageType } from '@protobuf-ts/runtime';
|
|
3
5
|
/**
|
|
4
6
|
* A Timestamp represents a point in time independent of any time zone or local
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { MessageType } from '@protobuf-ts/runtime';
|
|
2
|
-
import { CallEndedReason
|
|
2
|
+
import { CallEndedReason } from '../models/models';
|
|
3
|
+
import { GoAwayReason } from '../models/models';
|
|
4
|
+
import { CallGrants } from '../models/models';
|
|
5
|
+
import { DegradationPreference } from '../models/models';
|
|
6
|
+
import { Codec } from '../models/models';
|
|
7
|
+
import { ConnectionQuality } from '../models/models';
|
|
8
|
+
import { CallState } from '../models/models';
|
|
3
9
|
import { TrackSubscriptionDetails } from '../signal_rpc/signal';
|
|
10
|
+
import { TrackInfo } from '../models/models';
|
|
11
|
+
import { ParticipantSource } from '../models/models';
|
|
12
|
+
import { ClientCapability } from '../models/models';
|
|
13
|
+
import { SubscribeOption } from '../models/models';
|
|
14
|
+
import { ClientDetails } from '../models/models';
|
|
15
|
+
import { TrackUnpublishReason } from '../models/models';
|
|
16
|
+
import { Participant } from '../models/models';
|
|
17
|
+
import { TrackType } from '../models/models';
|
|
18
|
+
import { ParticipantCount } from '../models/models';
|
|
19
|
+
import { PeerType } from '../models/models';
|
|
20
|
+
import { WebsocketReconnectStrategy } from '../models/models';
|
|
21
|
+
import { Error as Error$ } from '../models/models';
|
|
22
|
+
import { Pin } from '../models/models';
|
|
23
|
+
import { PublishOption } from '../models/models';
|
|
24
|
+
import { ICETrickle as ICETrickle$ } from '../models/models';
|
|
4
25
|
/**
|
|
5
26
|
* SFUEvent is a message that is sent from the SFU to the client.
|
|
6
27
|
*
|
|
@@ -623,6 +644,10 @@ export interface SubscriberOffer {
|
|
|
623
644
|
* @generated from protobuf field: string sdp = 2;
|
|
624
645
|
*/
|
|
625
646
|
sdp: string;
|
|
647
|
+
/**
|
|
648
|
+
* @generated from protobuf field: uint32 negotiation_id = 3;
|
|
649
|
+
*/
|
|
650
|
+
negotiationId: number;
|
|
626
651
|
}
|
|
627
652
|
/**
|
|
628
653
|
* @generated from protobuf message stream.video.sfu.event.PublisherAnswer
|
|
@@ -411,6 +411,10 @@ export interface TrackInfo {
|
|
|
411
411
|
* @generated from protobuf field: int32 publish_option_id = 12;
|
|
412
412
|
*/
|
|
413
413
|
publishOptionId: number;
|
|
414
|
+
/**
|
|
415
|
+
* @generated from protobuf field: bool self_sub_audio_video = 13;
|
|
416
|
+
*/
|
|
417
|
+
selfSubAudioVideo: boolean;
|
|
414
418
|
}
|
|
415
419
|
/**
|
|
416
420
|
* @generated from protobuf message stream.video.sfu.models.Error
|
|
@@ -449,6 +453,10 @@ export interface ClientDetails {
|
|
|
449
453
|
* @generated from protobuf field: stream.video.sfu.models.Device device = 4;
|
|
450
454
|
*/
|
|
451
455
|
device?: Device;
|
|
456
|
+
/**
|
|
457
|
+
* @generated from protobuf field: string webrtc_version = 5;
|
|
458
|
+
*/
|
|
459
|
+
webrtcVersion: string;
|
|
452
460
|
}
|
|
453
461
|
/**
|
|
454
462
|
* @generated from protobuf message stream.video.sfu.models.Sdk
|
|
@@ -702,6 +710,155 @@ export interface PerformanceStats {
|
|
|
702
710
|
*/
|
|
703
711
|
targetBitrate: number;
|
|
704
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;
|
|
725
|
+
/**
|
|
726
|
+
* @generated from protobuf field: string kind = 2;
|
|
727
|
+
*/
|
|
728
|
+
kind: string;
|
|
729
|
+
/**
|
|
730
|
+
* @generated from protobuf field: double timestamp_ms = 3;
|
|
731
|
+
*/
|
|
732
|
+
timestampMs: number;
|
|
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;
|
|
750
|
+
/**
|
|
751
|
+
* @generated from protobuf field: uint64 packets_received = 3;
|
|
752
|
+
*/
|
|
753
|
+
packetsReceived: string;
|
|
754
|
+
/**
|
|
755
|
+
* @generated from protobuf field: uint64 packets_lost = 4;
|
|
756
|
+
*/
|
|
757
|
+
packetsLost: string;
|
|
758
|
+
/**
|
|
759
|
+
* @generated from protobuf field: double packet_loss_percent = 5;
|
|
760
|
+
*/
|
|
761
|
+
packetLossPercent: number;
|
|
762
|
+
/**
|
|
763
|
+
* -------- AUDIO METRICS --------
|
|
764
|
+
*
|
|
765
|
+
* @generated from protobuf field: uint32 concealment_events = 10;
|
|
766
|
+
*/
|
|
767
|
+
concealmentEvents: number;
|
|
768
|
+
/**
|
|
769
|
+
* @generated from protobuf field: double concealment_percent = 11;
|
|
770
|
+
*/
|
|
771
|
+
concealmentPercent: number;
|
|
772
|
+
/**
|
|
773
|
+
* -------- VIDEO METRICS --------
|
|
774
|
+
*
|
|
775
|
+
* @generated from protobuf field: double fps = 20;
|
|
776
|
+
*/
|
|
777
|
+
fps: number;
|
|
778
|
+
/**
|
|
779
|
+
* @generated from protobuf field: double freeze_duration_seconds = 21;
|
|
780
|
+
*/
|
|
781
|
+
freezeDurationSeconds: number;
|
|
782
|
+
/**
|
|
783
|
+
* @generated from protobuf field: double avg_decode_time_seconds = 22;
|
|
784
|
+
*/
|
|
785
|
+
avgDecodeTimeSeconds: number;
|
|
786
|
+
/**
|
|
787
|
+
* @generated from protobuf field: uint32 min_dimension_px = 23;
|
|
788
|
+
*/
|
|
789
|
+
minDimensionPx: number;
|
|
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;
|
|
807
|
+
/**
|
|
808
|
+
* @generated from protobuf field: double avg_encode_time_seconds = 11;
|
|
809
|
+
*/
|
|
810
|
+
avgEncodeTimeSeconds: number;
|
|
811
|
+
/**
|
|
812
|
+
* @generated from protobuf field: double bitrate_bps = 12;
|
|
813
|
+
*/
|
|
814
|
+
bitrateBps: number;
|
|
815
|
+
/**
|
|
816
|
+
* @generated from protobuf field: uint32 min_dimension_px = 13;
|
|
817
|
+
*/
|
|
818
|
+
minDimensionPx: number;
|
|
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;
|
|
836
|
+
/**
|
|
837
|
+
* @generated from protobuf field: double round_trip_time_s = 3;
|
|
838
|
+
*/
|
|
839
|
+
roundTripTimeS: number;
|
|
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;
|
|
857
|
+
/**
|
|
858
|
+
* @generated from protobuf field: double round_trip_time_s = 3;
|
|
859
|
+
*/
|
|
860
|
+
roundTripTimeS: number;
|
|
861
|
+
}
|
|
705
862
|
/**
|
|
706
863
|
* @generated from protobuf enum stream.video.sfu.models.PeerType
|
|
707
864
|
*/
|
|
@@ -968,7 +1125,15 @@ export declare enum SdkType {
|
|
|
968
1125
|
/**
|
|
969
1126
|
* @generated from protobuf enum value: SDK_TYPE_PLAIN_JAVASCRIPT = 9;
|
|
970
1127
|
*/
|
|
971
|
-
PLAIN_JAVASCRIPT = 9
|
|
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
|
|
972
1137
|
}
|
|
973
1138
|
/**
|
|
974
1139
|
* @generated from protobuf enum stream.video.sfu.models.TrackUnpublishReason
|
|
@@ -1172,7 +1337,13 @@ export declare enum ClientCapability {
|
|
|
1172
1337
|
*
|
|
1173
1338
|
* @generated from protobuf enum value: CLIENT_CAPABILITY_SUBSCRIBER_VIDEO_PAUSE = 1;
|
|
1174
1339
|
*/
|
|
1175
|
-
SUBSCRIBER_VIDEO_PAUSE = 1
|
|
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
|
|
1176
1347
|
}
|
|
1177
1348
|
/**
|
|
1178
1349
|
* DegradationPreference represents the RTCDegradationPreference from WebRTC.
|
|
@@ -1384,4 +1555,39 @@ declare class PerformanceStats$Type extends MessageType<PerformanceStats> {
|
|
|
1384
1555
|
* @generated MessageType for protobuf message stream.video.sfu.models.PerformanceStats
|
|
1385
1556
|
*/
|
|
1386
1557
|
export declare const PerformanceStats: PerformanceStats$Type;
|
|
1558
|
+
declare class RtpBase$Type extends MessageType<RtpBase> {
|
|
1559
|
+
constructor();
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* @generated MessageType for protobuf message stream.video.sfu.models.RtpBase
|
|
1563
|
+
*/
|
|
1564
|
+
export declare const RtpBase: RtpBase$Type;
|
|
1565
|
+
declare class InboundRtp$Type extends MessageType<InboundRtp> {
|
|
1566
|
+
constructor();
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* @generated MessageType for protobuf message stream.video.sfu.models.InboundRtp
|
|
1570
|
+
*/
|
|
1571
|
+
export declare const InboundRtp: InboundRtp$Type;
|
|
1572
|
+
declare class OutboundRtp$Type extends MessageType<OutboundRtp> {
|
|
1573
|
+
constructor();
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* @generated MessageType for protobuf message stream.video.sfu.models.OutboundRtp
|
|
1577
|
+
*/
|
|
1578
|
+
export declare const OutboundRtp: OutboundRtp$Type;
|
|
1579
|
+
declare class RemoteInboundRtp$Type extends MessageType<RemoteInboundRtp> {
|
|
1580
|
+
constructor();
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* @generated MessageType for protobuf message stream.video.sfu.models.RemoteInboundRtp
|
|
1584
|
+
*/
|
|
1585
|
+
export declare const RemoteInboundRtp: RemoteInboundRtp$Type;
|
|
1586
|
+
declare class RemoteOutboundRtp$Type extends MessageType<RemoteOutboundRtp> {
|
|
1587
|
+
constructor();
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* @generated MessageType for protobuf message stream.video.sfu.models.RemoteOutboundRtp
|
|
1591
|
+
*/
|
|
1592
|
+
export declare const RemoteOutboundRtp: RemoteOutboundRtp$Type;
|
|
1387
1593
|
export {};
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
|
|
2
|
+
import type { ServiceInfo } from '@protobuf-ts/runtime-rpc';
|
|
3
|
+
import type { StopNoiseCancellationResponse } from './signal';
|
|
4
|
+
import type { StopNoiseCancellationRequest } from './signal';
|
|
5
|
+
import type { StartNoiseCancellationResponse } from './signal';
|
|
6
|
+
import type { StartNoiseCancellationRequest } from './signal';
|
|
7
|
+
import type { SendMetricsResponse } from './signal';
|
|
8
|
+
import type { SendMetricsRequest } from './signal';
|
|
9
|
+
import type { SendStatsResponse } from './signal';
|
|
10
|
+
import type { SendStatsRequest } from './signal';
|
|
11
|
+
import type { ICERestartResponse } from './signal';
|
|
12
|
+
import type { ICERestartRequest } from './signal';
|
|
13
|
+
import type { UpdateMuteStatesResponse } from './signal';
|
|
14
|
+
import type { UpdateMuteStatesRequest } from './signal';
|
|
15
|
+
import type { UpdateSubscriptionsResponse } from './signal';
|
|
16
|
+
import type { UpdateSubscriptionsRequest } from './signal';
|
|
17
|
+
import type { ICETrickleResponse } from './signal';
|
|
3
18
|
import type { ICETrickle } from '../models/models';
|
|
19
|
+
import type { SendAnswerResponse } from './signal';
|
|
20
|
+
import type { SendAnswerRequest } from './signal';
|
|
21
|
+
import type { SetPublisherResponse } from './signal';
|
|
22
|
+
import type { SetPublisherRequest } from './signal';
|
|
23
|
+
import type { UnaryCall } from '@protobuf-ts/runtime-rpc';
|
|
24
|
+
import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
|
|
4
25
|
/**
|
|
5
26
|
* @generated from protobuf service stream.video.sfu.signal.SignalServer
|
|
6
27
|
*/
|
|
@@ -42,6 +63,10 @@ export interface ISignalServerClient {
|
|
|
42
63
|
* @generated from protobuf rpc: SendStats(stream.video.sfu.signal.SendStatsRequest) returns (stream.video.sfu.signal.SendStatsResponse);
|
|
43
64
|
*/
|
|
44
65
|
sendStats(input: SendStatsRequest, options?: RpcOptions): UnaryCall<SendStatsRequest, SendStatsResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* @generated from protobuf rpc: SendMetrics(stream.video.sfu.signal.SendMetricsRequest) returns (stream.video.sfu.signal.SendMetricsResponse);
|
|
68
|
+
*/
|
|
69
|
+
sendMetrics(input: SendMetricsRequest, options?: RpcOptions): UnaryCall<SendMetricsRequest, SendMetricsResponse>;
|
|
45
70
|
/**
|
|
46
71
|
* @generated from protobuf rpc: StartNoiseCancellation(stream.video.sfu.signal.StartNoiseCancellationRequest) returns (stream.video.sfu.signal.StartNoiseCancellationResponse);
|
|
47
72
|
*/
|
|
@@ -99,6 +124,10 @@ export declare class SignalServerClient implements ISignalServerClient, ServiceI
|
|
|
99
124
|
* @generated from protobuf rpc: SendStats(stream.video.sfu.signal.SendStatsRequest) returns (stream.video.sfu.signal.SendStatsResponse);
|
|
100
125
|
*/
|
|
101
126
|
sendStats(input: SendStatsRequest, options?: RpcOptions): UnaryCall<SendStatsRequest, SendStatsResponse>;
|
|
127
|
+
/**
|
|
128
|
+
* @generated from protobuf rpc: SendMetrics(stream.video.sfu.signal.SendMetricsRequest) returns (stream.video.sfu.signal.SendMetricsResponse);
|
|
129
|
+
*/
|
|
130
|
+
sendMetrics(input: SendMetricsRequest, options?: RpcOptions): UnaryCall<SendMetricsRequest, SendMetricsResponse>;
|
|
102
131
|
/**
|
|
103
132
|
* @generated from protobuf rpc: StartNoiseCancellation(stream.video.sfu.signal.StartNoiseCancellationRequest) returns (stream.video.sfu.signal.StartNoiseCancellationResponse);
|
|
104
133
|
*/
|
|
@@ -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.
|
|
@@ -10,10 +10,13 @@ export declare class Publisher extends BasePeerConnection {
|
|
|
10
10
|
private readonly transceiverCache;
|
|
11
11
|
private readonly clonedTracks;
|
|
12
12
|
private publishOptions;
|
|
13
|
+
private readonly selfSubEnabled;
|
|
13
14
|
/**
|
|
14
15
|
* Constructs a new `Publisher` instance.
|
|
15
16
|
*/
|
|
16
|
-
constructor(baseOptions: BasePeerConnectionOpts, publishOptions: PublishOption[]
|
|
17
|
+
constructor(baseOptions: BasePeerConnectionOpts, publishOptions: PublishOption[], opts?: {
|
|
18
|
+
selfSubEnabled?: boolean;
|
|
19
|
+
});
|
|
17
20
|
/**
|
|
18
21
|
* Disposes this Publisher instance.
|
|
19
22
|
*/
|
|
@@ -7,6 +7,13 @@ import { BasePeerConnectionOpts } from './types';
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export declare class Subscriber extends BasePeerConnection {
|
|
10
|
+
/**
|
|
11
|
+
* Remote streams received from the SFU. For a self-sub case
|
|
12
|
+
* we need to be able to distinguish between the local capture stream.
|
|
13
|
+
* The map will never contain local streams so we can safely use it to
|
|
14
|
+
* check if the stream is remote and dispose it when needed.
|
|
15
|
+
*/
|
|
16
|
+
private trackedStreams;
|
|
10
17
|
/**
|
|
11
18
|
* Constructs a new `Subscriber` instance.
|
|
12
19
|
*/
|
package/dist/src/rtc/types.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "1.52.1-beta.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.
|
|
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.
|
|
47
|
-
"@rollup/plugin-replace": "^6.0.
|
|
48
|
-
"@rollup/plugin-typescript": "^12.
|
|
49
|
-
"@stream-io/audio-filters-web": "^0.8.
|
|
50
|
-
"@stream-io/node-sdk": "^0.7.
|
|
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": "^
|
|
54
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
55
55
|
"dotenv": "^16.6.1",
|
|
56
|
-
"happy-dom": "^20.0
|
|
57
|
-
"prettier": "^3.
|
|
58
|
-
"rimraf": "^6.
|
|
59
|
-
"rollup": "^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": "^
|
|
62
|
-
"vitest-mock-extended": "^
|
|
61
|
+
"vitest": "^4.1.7",
|
|
62
|
+
"vitest-mock-extended": "^4.0.0"
|
|
63
63
|
}
|
|
64
64
|
}
|