@stream-io/video-client 1.18.9 → 1.19.1
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 +16 -7
- package/dist/index.browser.es.js +2612 -2301
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +2612 -2300
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +2612 -2301
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +3 -0
- package/dist/src/StreamSfuClient.d.ts +9 -2
- package/dist/src/gen/coordinator/index.d.ts +266 -5
- package/dist/src/gen/google/protobuf/struct.d.ts +1 -3
- package/dist/src/gen/google/protobuf/timestamp.d.ts +1 -3
- package/dist/src/gen/video/sfu/event/events.d.ts +6 -0
- package/dist/src/gen/video/sfu/models/models.d.ts +46 -0
- package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +13 -1
- package/dist/src/rpc/createClient.d.ts +2 -0
- package/dist/src/rtc/BasePeerConnection.d.ts +10 -3
- package/dist/src/stats/index.d.ts +2 -0
- package/dist/src/stats/rtc/Tracer.d.ts +15 -0
- package/dist/src/stats/rtc/index.d.ts +2 -0
- package/dist/src/stats/rtc/mediaDevices.d.ts +2 -0
- package/dist/src/stats/rtc/pc.d.ts +2 -0
- package/dist/src/stats/rtc/types.d.ts +8 -0
- package/index.ts +4 -0
- package/package.json +1 -1
- package/src/Call.ts +54 -29
- package/src/StreamSfuClient.ts +22 -9
- package/src/devices/MicrophoneManager.ts +5 -2
- package/src/devices/__tests__/MicrophoneManager.test.ts +9 -6
- package/src/devices/__tests__/MicrophoneManagerRN.test.ts +9 -6
- package/src/gen/coordinator/index.ts +262 -5
- package/src/gen/google/protobuf/struct.ts +13 -8
- package/src/gen/google/protobuf/timestamp.ts +10 -8
- package/src/gen/video/sfu/event/events.ts +8 -1
- package/src/gen/video/sfu/models/models.ts +63 -1
- package/src/gen/video/sfu/signal_rpc/signal.client.ts +1 -1
- package/src/gen/video/sfu/signal_rpc/signal.ts +27 -1
- package/src/rpc/__tests__/createClient.test.ts +38 -0
- package/src/rpc/createClient.ts +30 -0
- package/src/rtc/BasePeerConnection.ts +22 -4
- package/src/rtc/Publisher.ts +3 -2
- package/src/rtc/Subscriber.ts +0 -2
- package/src/rtc/__tests__/Subscriber.test.ts +1 -0
- package/src/rtc/helpers/__tests__/rtcConfiguration.test.ts +1 -0
- package/src/rtc/helpers/rtcConfiguration.ts +1 -0
- package/src/stats/SfuStatsReporter.ts +36 -12
- package/src/stats/index.ts +2 -0
- package/src/stats/rtc/Tracer.ts +42 -0
- package/src/stats/rtc/index.ts +5 -0
- package/src/stats/rtc/mediaDevices.ts +42 -0
- package/src/stats/rtc/pc.ts +130 -0
- package/src/stats/rtc/types.ts +26 -0
- package/src/store/CallState.ts +10 -0
package/dist/src/Call.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export declare class Call {
|
|
|
81
81
|
private readonly reconnectConcurrencyTag;
|
|
82
82
|
private reconnectAttempts;
|
|
83
83
|
private reconnectStrategy;
|
|
84
|
+
private reconnectReason;
|
|
84
85
|
private fastReconnectDeadlineSeconds;
|
|
85
86
|
private disconnectionTimeoutSeconds;
|
|
86
87
|
private lastOfflineTimestamp;
|
|
@@ -265,6 +266,7 @@ export declare class Call {
|
|
|
265
266
|
*
|
|
266
267
|
* @internal
|
|
267
268
|
* @param sfuClient the SFU client instance that was closed.
|
|
269
|
+
* @param reason the reason for the closure.
|
|
268
270
|
*/
|
|
269
271
|
private handleSfuSignalClose;
|
|
270
272
|
/**
|
|
@@ -273,6 +275,7 @@ export declare class Call {
|
|
|
273
275
|
* @internal
|
|
274
276
|
*
|
|
275
277
|
* @param strategy the reconnection strategy to use.
|
|
278
|
+
* @param reason the reason for the reconnection.
|
|
276
279
|
*/
|
|
277
280
|
private reconnect;
|
|
278
281
|
/**
|
|
@@ -4,6 +4,7 @@ import { ICERestartRequest, SendAnswerRequest, SendStatsRequest, SetPublisherReq
|
|
|
4
4
|
import { ICETrickle } from './gen/video/sfu/models/models';
|
|
5
5
|
import { StreamClient } from './coordinator/connection/client';
|
|
6
6
|
import { Credentials } from './gen/coordinator';
|
|
7
|
+
import { TraceSlice } from './stats';
|
|
7
8
|
export type StreamSfuClientConstructor = {
|
|
8
9
|
/**
|
|
9
10
|
* The event dispatcher instance to use.
|
|
@@ -29,11 +30,15 @@ export type StreamSfuClientConstructor = {
|
|
|
29
30
|
/**
|
|
30
31
|
* Callback for when the WebSocket connection is closed.
|
|
31
32
|
*/
|
|
32
|
-
onSignalClose?: () => void;
|
|
33
|
+
onSignalClose?: (reason: string) => void;
|
|
33
34
|
/**
|
|
34
35
|
* The StreamClient instance to use for the connection.
|
|
35
36
|
*/
|
|
36
37
|
streamClient: StreamClient;
|
|
38
|
+
/**
|
|
39
|
+
* Flag to enable tracing.
|
|
40
|
+
*/
|
|
41
|
+
enableTracing: boolean;
|
|
37
42
|
};
|
|
38
43
|
/**
|
|
39
44
|
* The client used for exchanging information with the SFU.
|
|
@@ -72,6 +77,7 @@ export declare class StreamSfuClient {
|
|
|
72
77
|
private pingIntervalInMs;
|
|
73
78
|
private unhealthyTimeoutInMs;
|
|
74
79
|
private lastMessageTimestamp?;
|
|
80
|
+
private readonly tracer?;
|
|
75
81
|
private readonly unsubscribeIceTrickle;
|
|
76
82
|
private readonly unsubscribeNetworkChanged;
|
|
77
83
|
private readonly onSignalClose;
|
|
@@ -115,7 +121,7 @@ export declare class StreamSfuClient {
|
|
|
115
121
|
/**
|
|
116
122
|
* Constructs a new SFU client.
|
|
117
123
|
*/
|
|
118
|
-
constructor({ dispatcher, credentials, sessionId, logTag, joinResponseTimeout, onSignalClose, streamClient, }: StreamSfuClientConstructor);
|
|
124
|
+
constructor({ dispatcher, credentials, sessionId, logTag, joinResponseTimeout, onSignalClose, streamClient, enableTracing, }: StreamSfuClientConstructor);
|
|
119
125
|
private createWebSocket;
|
|
120
126
|
private cleanUpWebSocket;
|
|
121
127
|
get isHealthy(): boolean;
|
|
@@ -123,6 +129,7 @@ export declare class StreamSfuClient {
|
|
|
123
129
|
private handleWebSocketClose;
|
|
124
130
|
close: (code?: number, reason?: string) => void;
|
|
125
131
|
private dispose;
|
|
132
|
+
getTrace: () => TraceSlice | undefined;
|
|
126
133
|
leaveAndClose: (reason: string) => Promise<void>;
|
|
127
134
|
updateSubscriptions: (tracks: TrackSubscriptionDetails[]) => Promise<import("@protobuf-ts/runtime-rpc").FinishedUnaryCall<import("./gen/video/sfu/signal_rpc/signal").UpdateSubscriptionsRequest, import("./gen/video/sfu/signal_rpc/signal").UpdateSubscriptionsResponse>>;
|
|
128
135
|
setPublisher: (data: Omit<SetPublisherRequest, "sessionId">) => Promise<import("@protobuf-ts/runtime-rpc").FinishedUnaryCall<SetPublisherRequest, import("./gen/video/sfu/signal_rpc/signal").SetPublisherResponse>>;
|
|
@@ -720,6 +720,180 @@ export interface CallEvent {
|
|
|
720
720
|
*/
|
|
721
721
|
type: string;
|
|
722
722
|
}
|
|
723
|
+
/**
|
|
724
|
+
* This event is sent when frame recording has failed
|
|
725
|
+
* @export
|
|
726
|
+
* @interface CallFrameRecordingFailedEvent
|
|
727
|
+
*/
|
|
728
|
+
export interface CallFrameRecordingFailedEvent {
|
|
729
|
+
/**
|
|
730
|
+
*
|
|
731
|
+
* @type {CallResponse}
|
|
732
|
+
* @memberof CallFrameRecordingFailedEvent
|
|
733
|
+
*/
|
|
734
|
+
call: CallResponse;
|
|
735
|
+
/**
|
|
736
|
+
*
|
|
737
|
+
* @type {string}
|
|
738
|
+
* @memberof CallFrameRecordingFailedEvent
|
|
739
|
+
*/
|
|
740
|
+
call_cid: string;
|
|
741
|
+
/**
|
|
742
|
+
*
|
|
743
|
+
* @type {string}
|
|
744
|
+
* @memberof CallFrameRecordingFailedEvent
|
|
745
|
+
*/
|
|
746
|
+
created_at: string;
|
|
747
|
+
/**
|
|
748
|
+
*
|
|
749
|
+
* @type {string}
|
|
750
|
+
* @memberof CallFrameRecordingFailedEvent
|
|
751
|
+
*/
|
|
752
|
+
egress_id: string;
|
|
753
|
+
/**
|
|
754
|
+
* The type of event: "call.frame_recording_failed" in this case
|
|
755
|
+
* @type {string}
|
|
756
|
+
* @memberof CallFrameRecordingFailedEvent
|
|
757
|
+
*/
|
|
758
|
+
type: string;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* This event is sent when a frame is captured from a call
|
|
762
|
+
* @export
|
|
763
|
+
* @interface CallFrameRecordingFrameReadyEvent
|
|
764
|
+
*/
|
|
765
|
+
export interface CallFrameRecordingFrameReadyEvent {
|
|
766
|
+
/**
|
|
767
|
+
*
|
|
768
|
+
* @type {string}
|
|
769
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
770
|
+
*/
|
|
771
|
+
call_cid: string;
|
|
772
|
+
/**
|
|
773
|
+
* The time the frame was captured
|
|
774
|
+
* @type {string}
|
|
775
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
776
|
+
*/
|
|
777
|
+
captured_at: string;
|
|
778
|
+
/**
|
|
779
|
+
*
|
|
780
|
+
* @type {string}
|
|
781
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
782
|
+
*/
|
|
783
|
+
created_at: string;
|
|
784
|
+
/**
|
|
785
|
+
*
|
|
786
|
+
* @type {string}
|
|
787
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
788
|
+
*/
|
|
789
|
+
egress_id: string;
|
|
790
|
+
/**
|
|
791
|
+
* Call session ID
|
|
792
|
+
* @type {string}
|
|
793
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
794
|
+
*/
|
|
795
|
+
session_id: string;
|
|
796
|
+
/**
|
|
797
|
+
* The type of the track frame was captured from (TRACK_TYPE_VIDEO|TRACK_TYPE_SCREEN_SHARE)
|
|
798
|
+
* @type {string}
|
|
799
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
800
|
+
*/
|
|
801
|
+
track_type: string;
|
|
802
|
+
/**
|
|
803
|
+
* The type of event: "call.frame_recording_ready" in this case
|
|
804
|
+
* @type {string}
|
|
805
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
806
|
+
*/
|
|
807
|
+
type: string;
|
|
808
|
+
/**
|
|
809
|
+
* The URL of the frame
|
|
810
|
+
* @type {string}
|
|
811
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
812
|
+
*/
|
|
813
|
+
url: string;
|
|
814
|
+
/**
|
|
815
|
+
* The users in the frame
|
|
816
|
+
* @type {{ [key: string]: UserResponse; }}
|
|
817
|
+
* @memberof CallFrameRecordingFrameReadyEvent
|
|
818
|
+
*/
|
|
819
|
+
users: {
|
|
820
|
+
[key: string]: UserResponse;
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* This event is sent when frame recording has started
|
|
825
|
+
* @export
|
|
826
|
+
* @interface CallFrameRecordingStartedEvent
|
|
827
|
+
*/
|
|
828
|
+
export interface CallFrameRecordingStartedEvent {
|
|
829
|
+
/**
|
|
830
|
+
*
|
|
831
|
+
* @type {CallResponse}
|
|
832
|
+
* @memberof CallFrameRecordingStartedEvent
|
|
833
|
+
*/
|
|
834
|
+
call: CallResponse;
|
|
835
|
+
/**
|
|
836
|
+
*
|
|
837
|
+
* @type {string}
|
|
838
|
+
* @memberof CallFrameRecordingStartedEvent
|
|
839
|
+
*/
|
|
840
|
+
call_cid: string;
|
|
841
|
+
/**
|
|
842
|
+
*
|
|
843
|
+
* @type {string}
|
|
844
|
+
* @memberof CallFrameRecordingStartedEvent
|
|
845
|
+
*/
|
|
846
|
+
created_at: string;
|
|
847
|
+
/**
|
|
848
|
+
*
|
|
849
|
+
* @type {string}
|
|
850
|
+
* @memberof CallFrameRecordingStartedEvent
|
|
851
|
+
*/
|
|
852
|
+
egress_id: string;
|
|
853
|
+
/**
|
|
854
|
+
* The type of event: "call.frame_recording_started" in this case
|
|
855
|
+
* @type {string}
|
|
856
|
+
* @memberof CallFrameRecordingStartedEvent
|
|
857
|
+
*/
|
|
858
|
+
type: string;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* This event is sent when frame recording has stopped
|
|
862
|
+
* @export
|
|
863
|
+
* @interface CallFrameRecordingStoppedEvent
|
|
864
|
+
*/
|
|
865
|
+
export interface CallFrameRecordingStoppedEvent {
|
|
866
|
+
/**
|
|
867
|
+
*
|
|
868
|
+
* @type {CallResponse}
|
|
869
|
+
* @memberof CallFrameRecordingStoppedEvent
|
|
870
|
+
*/
|
|
871
|
+
call: CallResponse;
|
|
872
|
+
/**
|
|
873
|
+
*
|
|
874
|
+
* @type {string}
|
|
875
|
+
* @memberof CallFrameRecordingStoppedEvent
|
|
876
|
+
*/
|
|
877
|
+
call_cid: string;
|
|
878
|
+
/**
|
|
879
|
+
*
|
|
880
|
+
* @type {string}
|
|
881
|
+
* @memberof CallFrameRecordingStoppedEvent
|
|
882
|
+
*/
|
|
883
|
+
created_at: string;
|
|
884
|
+
/**
|
|
885
|
+
*
|
|
886
|
+
* @type {string}
|
|
887
|
+
* @memberof CallFrameRecordingStoppedEvent
|
|
888
|
+
*/
|
|
889
|
+
egress_id: string;
|
|
890
|
+
/**
|
|
891
|
+
* The type of event: "call.frame_recording_stopped" in this case
|
|
892
|
+
* @type {string}
|
|
893
|
+
* @memberof CallFrameRecordingStoppedEvent
|
|
894
|
+
*/
|
|
895
|
+
type: string;
|
|
896
|
+
}
|
|
723
897
|
/**
|
|
724
898
|
* This event is sent when HLS broadcasting has failed
|
|
725
899
|
* @export
|
|
@@ -1217,6 +1391,12 @@ export interface CallRecording {
|
|
|
1217
1391
|
* @memberof CallRecording
|
|
1218
1392
|
*/
|
|
1219
1393
|
filename: string;
|
|
1394
|
+
/**
|
|
1395
|
+
*
|
|
1396
|
+
* @type {string}
|
|
1397
|
+
* @memberof CallRecording
|
|
1398
|
+
*/
|
|
1399
|
+
session_id: string;
|
|
1220
1400
|
/**
|
|
1221
1401
|
*
|
|
1222
1402
|
* @type {string}
|
|
@@ -1385,7 +1565,7 @@ export interface CallRejectedEvent {
|
|
|
1385
1565
|
*/
|
|
1386
1566
|
created_at: string;
|
|
1387
1567
|
/**
|
|
1388
|
-
*
|
|
1568
|
+
* Provides information about why the call was rejected. You can provide any value, but the Stream API and SDKs use these default values: rejected, cancel, timeout and busy
|
|
1389
1569
|
* @type {string}
|
|
1390
1570
|
* @memberof CallRejectedEvent
|
|
1391
1571
|
*/
|
|
@@ -3301,6 +3481,12 @@ export interface EgressResponse {
|
|
|
3301
3481
|
* @memberof EgressResponse
|
|
3302
3482
|
*/
|
|
3303
3483
|
broadcasting: boolean;
|
|
3484
|
+
/**
|
|
3485
|
+
*
|
|
3486
|
+
* @type {FrameRecordingResponse}
|
|
3487
|
+
* @memberof EgressResponse
|
|
3488
|
+
*/
|
|
3489
|
+
frame_recording?: FrameRecordingResponse;
|
|
3304
3490
|
/**
|
|
3305
3491
|
*
|
|
3306
3492
|
* @type {EgressHLSResponse}
|
|
@@ -3327,6 +3513,38 @@ export interface EndCallResponse {
|
|
|
3327
3513
|
*/
|
|
3328
3514
|
duration: string;
|
|
3329
3515
|
}
|
|
3516
|
+
/**
|
|
3517
|
+
*
|
|
3518
|
+
* @export
|
|
3519
|
+
* @interface FPSStats
|
|
3520
|
+
*/
|
|
3521
|
+
export interface FPSStats {
|
|
3522
|
+
/**
|
|
3523
|
+
*
|
|
3524
|
+
* @type {number}
|
|
3525
|
+
* @memberof FPSStats
|
|
3526
|
+
*/
|
|
3527
|
+
average_fps: number;
|
|
3528
|
+
/**
|
|
3529
|
+
*
|
|
3530
|
+
* @type {number}
|
|
3531
|
+
* @memberof FPSStats
|
|
3532
|
+
*/
|
|
3533
|
+
tracked: number;
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
*
|
|
3537
|
+
* @export
|
|
3538
|
+
* @interface FrameRecordingResponse
|
|
3539
|
+
*/
|
|
3540
|
+
export interface FrameRecordingResponse {
|
|
3541
|
+
/**
|
|
3542
|
+
*
|
|
3543
|
+
* @type {string}
|
|
3544
|
+
* @memberof FrameRecordingResponse
|
|
3545
|
+
*/
|
|
3546
|
+
status: string;
|
|
3547
|
+
}
|
|
3330
3548
|
/**
|
|
3331
3549
|
*
|
|
3332
3550
|
* @export
|
|
@@ -3350,7 +3568,7 @@ export interface FrameRecordingSettingsRequest {
|
|
|
3350
3568
|
* @type {string}
|
|
3351
3569
|
* @memberof FrameRecordingSettingsRequest
|
|
3352
3570
|
*/
|
|
3353
|
-
quality?:
|
|
3571
|
+
quality?: FrameRecordingSettingsRequestQualityEnum;
|
|
3354
3572
|
}
|
|
3355
3573
|
/**
|
|
3356
3574
|
* @export
|
|
@@ -3361,6 +3579,17 @@ export declare const FrameRecordingSettingsRequestModeEnum: {
|
|
|
3361
3579
|
readonly AUTO_ON: "auto-on";
|
|
3362
3580
|
};
|
|
3363
3581
|
export type FrameRecordingSettingsRequestModeEnum = (typeof FrameRecordingSettingsRequestModeEnum)[keyof typeof FrameRecordingSettingsRequestModeEnum];
|
|
3582
|
+
/**
|
|
3583
|
+
* @export
|
|
3584
|
+
*/
|
|
3585
|
+
export declare const FrameRecordingSettingsRequestQualityEnum: {
|
|
3586
|
+
readonly _360P: "360p";
|
|
3587
|
+
readonly _480P: "480p";
|
|
3588
|
+
readonly _720P: "720p";
|
|
3589
|
+
readonly _1080P: "1080p";
|
|
3590
|
+
readonly _1440P: "1440p";
|
|
3591
|
+
};
|
|
3592
|
+
export type FrameRecordingSettingsRequestQualityEnum = (typeof FrameRecordingSettingsRequestQualityEnum)[keyof typeof FrameRecordingSettingsRequestQualityEnum];
|
|
3364
3593
|
/**
|
|
3365
3594
|
*
|
|
3366
3595
|
* @export
|
|
@@ -3567,6 +3796,12 @@ export interface GetCallStatsResponse {
|
|
|
3567
3796
|
* @memberof GetCallStatsResponse
|
|
3568
3797
|
*/
|
|
3569
3798
|
duration: string;
|
|
3799
|
+
/**
|
|
3800
|
+
*
|
|
3801
|
+
* @type {boolean}
|
|
3802
|
+
* @memberof GetCallStatsResponse
|
|
3803
|
+
*/
|
|
3804
|
+
is_truncated_report: boolean;
|
|
3570
3805
|
/**
|
|
3571
3806
|
*
|
|
3572
3807
|
* @type {TimeStats}
|
|
@@ -5394,19 +5629,19 @@ export interface Response {
|
|
|
5394
5629
|
*/
|
|
5395
5630
|
export interface RingSettingsRequest {
|
|
5396
5631
|
/**
|
|
5397
|
-
*
|
|
5632
|
+
* When none of the callees accept a ring call in this time a rejection will be sent by the caller with reason 'timeout' by the SDKs
|
|
5398
5633
|
* @type {number}
|
|
5399
5634
|
* @memberof RingSettingsRequest
|
|
5400
5635
|
*/
|
|
5401
5636
|
auto_cancel_timeout_ms: number;
|
|
5402
5637
|
/**
|
|
5403
|
-
*
|
|
5638
|
+
* When a callee is online but doesn't answer a ring call in this time a rejection will be sent with reason 'timeout' by the SDKs
|
|
5404
5639
|
* @type {number}
|
|
5405
5640
|
* @memberof RingSettingsRequest
|
|
5406
5641
|
*/
|
|
5407
5642
|
incoming_call_timeout_ms: number;
|
|
5408
5643
|
/**
|
|
5409
|
-
*
|
|
5644
|
+
* When a callee doesn't accept or reject a ring call in this time a missed call event will be sent
|
|
5410
5645
|
* @type {number}
|
|
5411
5646
|
* @memberof RingSettingsRequest
|
|
5412
5647
|
*/
|
|
@@ -5869,6 +6104,12 @@ export interface StartTranscriptionResponse {
|
|
|
5869
6104
|
* @interface StatsOptions
|
|
5870
6105
|
*/
|
|
5871
6106
|
export interface StatsOptions {
|
|
6107
|
+
/**
|
|
6108
|
+
*
|
|
6109
|
+
* @type {boolean}
|
|
6110
|
+
* @memberof StatsOptions
|
|
6111
|
+
*/
|
|
6112
|
+
enable_rtc_stats: boolean;
|
|
5872
6113
|
/**
|
|
5873
6114
|
*
|
|
5874
6115
|
* @type {number}
|
|
@@ -6989,6 +7230,12 @@ export interface UserSessionStats {
|
|
|
6989
7230
|
* @memberof UserSessionStats
|
|
6990
7231
|
*/
|
|
6991
7232
|
distance_to_sfu_kilometers?: number;
|
|
7233
|
+
/**
|
|
7234
|
+
*
|
|
7235
|
+
* @type {FPSStats}
|
|
7236
|
+
* @memberof UserSessionStats
|
|
7237
|
+
*/
|
|
7238
|
+
fps?: FPSStats;
|
|
6992
7239
|
/**
|
|
6993
7240
|
*
|
|
6994
7241
|
* @type {number}
|
|
@@ -7262,6 +7509,12 @@ export interface UserSessionStats {
|
|
|
7262
7509
|
* @interface UserStats
|
|
7263
7510
|
*/
|
|
7264
7511
|
export interface UserStats {
|
|
7512
|
+
/**
|
|
7513
|
+
*
|
|
7514
|
+
* @type {string}
|
|
7515
|
+
* @memberof UserStats
|
|
7516
|
+
*/
|
|
7517
|
+
feedback?: string;
|
|
7265
7518
|
/**
|
|
7266
7519
|
*
|
|
7267
7520
|
* @type {UserInfoResponse}
|
|
@@ -7369,6 +7622,14 @@ export type VideoEvent = ({
|
|
|
7369
7622
|
} & CallDeletedEvent) | ({
|
|
7370
7623
|
type: 'call.ended';
|
|
7371
7624
|
} & CallEndedEvent) | ({
|
|
7625
|
+
type: 'call.frame_recording_failed';
|
|
7626
|
+
} & CallFrameRecordingFailedEvent) | ({
|
|
7627
|
+
type: 'call.frame_recording_ready';
|
|
7628
|
+
} & CallFrameRecordingFrameReadyEvent) | ({
|
|
7629
|
+
type: 'call.frame_recording_started';
|
|
7630
|
+
} & CallFrameRecordingStartedEvent) | ({
|
|
7631
|
+
type: 'call.frame_recording_stopped';
|
|
7632
|
+
} & CallFrameRecordingStoppedEvent) | ({
|
|
7372
7633
|
type: 'call.hls_broadcasting_failed';
|
|
7373
7634
|
} & CallHLSBroadcastingFailedEvent) | ({
|
|
7374
7635
|
type: 'call.hls_broadcasting_started';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { JsonValue } from '@protobuf-ts/runtime';
|
|
2
|
-
import type { JsonReadOptions } from '@protobuf-ts/runtime';
|
|
3
|
-
import type { JsonWriteOptions } from '@protobuf-ts/runtime';
|
|
1
|
+
import type { JsonReadOptions, JsonValue, JsonWriteOptions } from '@protobuf-ts/runtime';
|
|
4
2
|
import { MessageType } from '@protobuf-ts/runtime';
|
|
5
3
|
/**
|
|
6
4
|
* `Struct` represents a structured data value, consisting of fields
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { JsonValue } from '@protobuf-ts/runtime';
|
|
2
|
-
import type { JsonReadOptions } from '@protobuf-ts/runtime';
|
|
3
|
-
import type { JsonWriteOptions } from '@protobuf-ts/runtime';
|
|
1
|
+
import type { JsonReadOptions, JsonValue, JsonWriteOptions } from '@protobuf-ts/runtime';
|
|
4
2
|
import { MessageType } from '@protobuf-ts/runtime';
|
|
5
3
|
/**
|
|
6
4
|
* A Timestamp represents a point in time independent of any time zone or local
|
|
@@ -491,6 +491,12 @@ export interface ReconnectDetails {
|
|
|
491
491
|
* @generated from protobuf field: string previous_session_id = 7;
|
|
492
492
|
*/
|
|
493
493
|
previousSessionId: string;
|
|
494
|
+
/**
|
|
495
|
+
* the reconnect reason
|
|
496
|
+
*
|
|
497
|
+
* @generated from protobuf field: string reason = 8;
|
|
498
|
+
*/
|
|
499
|
+
reason: string;
|
|
494
500
|
}
|
|
495
501
|
/**
|
|
496
502
|
* @generated from protobuf message stream.video.sfu.event.Migration
|
|
@@ -464,6 +464,45 @@ export interface Browser {
|
|
|
464
464
|
*/
|
|
465
465
|
version: string;
|
|
466
466
|
}
|
|
467
|
+
/**
|
|
468
|
+
* @generated from protobuf message stream.video.sfu.models.RTMPIngress
|
|
469
|
+
*/
|
|
470
|
+
export interface RTMPIngress {
|
|
471
|
+
/**
|
|
472
|
+
* Video dimensions and frame rate
|
|
473
|
+
*
|
|
474
|
+
* @generated from protobuf field: uint32 width = 1;
|
|
475
|
+
*/
|
|
476
|
+
width: number;
|
|
477
|
+
/**
|
|
478
|
+
* @generated from protobuf field: uint32 height = 2;
|
|
479
|
+
*/
|
|
480
|
+
height: number;
|
|
481
|
+
/**
|
|
482
|
+
* @generated from protobuf field: double frame_rate = 3;
|
|
483
|
+
*/
|
|
484
|
+
frameRate: number;
|
|
485
|
+
/**
|
|
486
|
+
* Client info
|
|
487
|
+
*
|
|
488
|
+
* @generated from protobuf field: string software = 4;
|
|
489
|
+
*/
|
|
490
|
+
software: string;
|
|
491
|
+
/**
|
|
492
|
+
* @generated from protobuf field: string version = 5;
|
|
493
|
+
*/
|
|
494
|
+
version: string;
|
|
495
|
+
/**
|
|
496
|
+
* @generated from protobuf field: string encoder = 6;
|
|
497
|
+
*/
|
|
498
|
+
encoder: string;
|
|
499
|
+
/**
|
|
500
|
+
* Connection info
|
|
501
|
+
*
|
|
502
|
+
* @generated from protobuf field: string remote_addr = 7;
|
|
503
|
+
*/
|
|
504
|
+
remoteAddr: string;
|
|
505
|
+
}
|
|
467
506
|
/**
|
|
468
507
|
* @generated from protobuf message stream.video.sfu.models.Device
|
|
469
508
|
*/
|
|
@@ -1101,6 +1140,13 @@ declare class Browser$Type extends MessageType<Browser> {
|
|
|
1101
1140
|
* @generated MessageType for protobuf message stream.video.sfu.models.Browser
|
|
1102
1141
|
*/
|
|
1103
1142
|
export declare const Browser: Browser$Type;
|
|
1143
|
+
declare class RTMPIngress$Type extends MessageType<RTMPIngress> {
|
|
1144
|
+
constructor();
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* @generated MessageType for protobuf message stream.video.sfu.models.RTMPIngress
|
|
1148
|
+
*/
|
|
1149
|
+
export declare const RTMPIngress: RTMPIngress$Type;
|
|
1104
1150
|
declare class Device$Type extends MessageType<Device> {
|
|
1105
1151
|
constructor();
|
|
1106
1152
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AndroidState, AppleState, Error, InputDevices, PeerType, TrackInfo, TrackType, VideoDimension, WebsocketReconnectStrategy } from '../models/models';
|
|
1
|
+
import { AndroidState, AppleState, Error, InputDevices, PeerType, RTMPIngress, TrackInfo, TrackType, VideoDimension, WebsocketReconnectStrategy } from '../models/models';
|
|
2
2
|
import { ServiceType } from '@protobuf-ts/runtime-rpc';
|
|
3
3
|
import { MessageType } from '@protobuf-ts/runtime';
|
|
4
4
|
/**
|
|
@@ -131,6 +131,18 @@ export interface SendStatsRequest {
|
|
|
131
131
|
* @generated from protobuf field: stream.video.sfu.signal.Telemetry telemetry = 11;
|
|
132
132
|
*/
|
|
133
133
|
telemetry?: Telemetry;
|
|
134
|
+
/**
|
|
135
|
+
* @generated from protobuf field: stream.video.sfu.models.RTMPIngress rtmp = 12;
|
|
136
|
+
*/
|
|
137
|
+
rtmp?: RTMPIngress;
|
|
138
|
+
/**
|
|
139
|
+
* @generated from protobuf field: string subscriber_rtc_stats = 13;
|
|
140
|
+
*/
|
|
141
|
+
subscriberRtcStats: string;
|
|
142
|
+
/**
|
|
143
|
+
* @generated from protobuf field: string publisher_rtc_stats = 14;
|
|
144
|
+
*/
|
|
145
|
+
publisherRtcStats: string;
|
|
134
146
|
}
|
|
135
147
|
/**
|
|
136
148
|
* @generated from protobuf message stream.video.sfu.signal.SendStatsResponse
|
|
@@ -2,8 +2,10 @@ import { RpcInterceptor } from '@protobuf-ts/runtime-rpc';
|
|
|
2
2
|
import { TwirpOptions } from '@protobuf-ts/twirp-transport';
|
|
3
3
|
import { SignalServerClient } from '../gen/video/sfu/signal_rpc/signal.client';
|
|
4
4
|
import { Logger, LogLevel } from '../coordinator/connection/types';
|
|
5
|
+
import type { Trace } from '../stats/rtc/types';
|
|
5
6
|
export declare const withHeaders: (headers: Record<string, string>) => RpcInterceptor;
|
|
6
7
|
export declare const withRequestLogger: (logger: Logger, level: LogLevel) => RpcInterceptor;
|
|
8
|
+
export declare const withRequestTracer: (trace: Trace) => RpcInterceptor;
|
|
7
9
|
/**
|
|
8
10
|
* Creates new SignalServerClient instance.
|
|
9
11
|
*
|
|
@@ -3,13 +3,15 @@ import { CallState } from '../store';
|
|
|
3
3
|
import { PeerType } from '../gen/video/sfu/models/models';
|
|
4
4
|
import { StreamSfuClient } from '../StreamSfuClient';
|
|
5
5
|
import { AllSfuEvents, Dispatcher } from './Dispatcher';
|
|
6
|
+
import { TraceSlice } from '../stats';
|
|
6
7
|
export type BasePeerConnectionOpts = {
|
|
7
8
|
sfuClient: StreamSfuClient;
|
|
8
9
|
state: CallState;
|
|
9
10
|
connectionConfig?: RTCConfiguration;
|
|
10
11
|
dispatcher: Dispatcher;
|
|
11
|
-
onUnrecoverableError?: () => void;
|
|
12
|
+
onUnrecoverableError?: (reason: string) => void;
|
|
12
13
|
logTag: string;
|
|
14
|
+
enableTracing: boolean;
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* A base class for the `Publisher` and `Subscriber` classes.
|
|
@@ -22,15 +24,16 @@ export declare abstract class BasePeerConnection {
|
|
|
22
24
|
protected readonly state: CallState;
|
|
23
25
|
protected readonly dispatcher: Dispatcher;
|
|
24
26
|
protected sfuClient: StreamSfuClient;
|
|
25
|
-
protected onUnrecoverableError?: () => void;
|
|
27
|
+
protected onUnrecoverableError?: (reason: string) => void;
|
|
26
28
|
protected isIceRestarting: boolean;
|
|
27
29
|
private isDisposed;
|
|
30
|
+
private readonly tracer?;
|
|
28
31
|
private readonly subscriptions;
|
|
29
32
|
private unsubscribeIceTrickle?;
|
|
30
33
|
/**
|
|
31
34
|
* Constructs a new `BasePeerConnection` instance.
|
|
32
35
|
*/
|
|
33
|
-
protected constructor(peerType: PeerType, { sfuClient, connectionConfig, state, dispatcher, onUnrecoverableError, logTag, }: BasePeerConnectionOpts);
|
|
36
|
+
protected constructor(peerType: PeerType, { sfuClient, connectionConfig, state, dispatcher, onUnrecoverableError, logTag, enableTracing, }: BasePeerConnectionOpts);
|
|
34
37
|
/**
|
|
35
38
|
* Disposes the `RTCPeerConnection` instance.
|
|
36
39
|
*/
|
|
@@ -63,6 +66,10 @@ export declare abstract class BasePeerConnection {
|
|
|
63
66
|
* @param selector an optional `MediaStreamTrack` to get the stats for.
|
|
64
67
|
*/
|
|
65
68
|
getStats: (selector?: MediaStreamTrack | null) => Promise<RTCStatsReport>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the current tracing buffer.
|
|
71
|
+
*/
|
|
72
|
+
getTrace: () => TraceSlice | undefined;
|
|
66
73
|
/**
|
|
67
74
|
* Handles the ICECandidate event and
|
|
68
75
|
* Initiates an ICE Trickle process with the SFU.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Trace, TraceRecord } from './types';
|
|
2
|
+
export type TraceSlice = {
|
|
3
|
+
snapshot: TraceRecord[];
|
|
4
|
+
rollback: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare class Tracer {
|
|
7
|
+
private buffer;
|
|
8
|
+
private enabled;
|
|
9
|
+
private readonly id;
|
|
10
|
+
constructor(id: string | null);
|
|
11
|
+
setEnabled: (enabled: boolean) => void;
|
|
12
|
+
trace: Trace;
|
|
13
|
+
take: () => TraceSlice;
|
|
14
|
+
dispose: () => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type RTCStatsDataType = RTCConfiguration | RTCIceCandidate | RTCSignalingState | RTCIceConnectionState | RTCIceGatheringState | RTCPeerConnectionState | [number | null | string] | string | RTCOfferOptions | [string | RTCDataChannelInit | undefined] | (RTCOfferOptions | undefined) | RTCSessionDescriptionInit | (RTCIceCandidateInit | RTCIceCandidate) | object | null | undefined;
|
|
2
|
+
export type Trace = (tag: string, data: RTCStatsDataType) => void;
|
|
3
|
+
export type TraceRecord = [
|
|
4
|
+
tag: string,
|
|
5
|
+
id: string | null,
|
|
6
|
+
data: RTCStatsDataType,
|
|
7
|
+
timestamp: number
|
|
8
|
+
];
|
package/index.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import 'webrtc-adapter';
|
|
2
2
|
|
|
3
|
+
// side effect: we patch the mediaDevices APIs here
|
|
4
|
+
// so we can intercept invocations and collect statistics
|
|
5
|
+
import './src/stats/rtc/mediaDevices';
|
|
6
|
+
|
|
3
7
|
export * from './src/gen/coordinator';
|
|
4
8
|
export * from './src/coordinator/connection/types';
|
|
5
9
|
|