@stream-io/video-client 0.7.2 → 0.7.4
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 +14 -0
- package/dist/index.browser.es.js +17 -9
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +17 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +17 -9
- package/dist/index.es.js.map +1 -1
- package/dist/src/gen/coordinator/index.d.ts +28 -38
- package/package.json +1 -1
- package/src/gen/coordinator/index.ts +28 -34
- package/src/logger.ts +5 -0
- package/src/rtc/Publisher.ts +5 -1
- package/src/rtc/codecs.ts +5 -7
|
@@ -2725,18 +2725,6 @@ export interface GetCallResponse {
|
|
|
2725
2725
|
* @interface GetCallStatsResponse
|
|
2726
2726
|
*/
|
|
2727
2727
|
export interface GetCallStatsResponse {
|
|
2728
|
-
/**
|
|
2729
|
-
*
|
|
2730
|
-
* @type {number}
|
|
2731
|
-
* @memberof GetCallStatsResponse
|
|
2732
|
-
*/
|
|
2733
|
-
average_jitter: number;
|
|
2734
|
-
/**
|
|
2735
|
-
*
|
|
2736
|
-
* @type {number}
|
|
2737
|
-
* @memberof GetCallStatsResponse
|
|
2738
|
-
*/
|
|
2739
|
-
average_latency: number;
|
|
2740
2728
|
/**
|
|
2741
2729
|
*
|
|
2742
2730
|
* @type {number}
|
|
@@ -2757,66 +2745,64 @@ export interface GetCallStatsResponse {
|
|
|
2757
2745
|
duration: string;
|
|
2758
2746
|
/**
|
|
2759
2747
|
*
|
|
2760
|
-
* @type {
|
|
2748
|
+
* @type {Stats}
|
|
2761
2749
|
* @memberof GetCallStatsResponse
|
|
2762
2750
|
*/
|
|
2763
|
-
|
|
2751
|
+
jitter?: Stats;
|
|
2764
2752
|
/**
|
|
2765
2753
|
*
|
|
2766
|
-
* @type {
|
|
2754
|
+
* @type {Stats}
|
|
2767
2755
|
* @memberof GetCallStatsResponse
|
|
2768
2756
|
*/
|
|
2769
|
-
|
|
2757
|
+
latency?: Stats;
|
|
2770
2758
|
/**
|
|
2771
2759
|
*
|
|
2772
2760
|
* @type {number}
|
|
2773
2761
|
* @memberof GetCallStatsResponse
|
|
2774
2762
|
*/
|
|
2775
|
-
|
|
2763
|
+
max_freezes_duration_seconds: number;
|
|
2776
2764
|
/**
|
|
2777
2765
|
*
|
|
2778
|
-
* @type {
|
|
2766
|
+
* @type {number}
|
|
2779
2767
|
* @memberof GetCallStatsResponse
|
|
2780
2768
|
*/
|
|
2781
|
-
|
|
2782
|
-
[key: string]: UserStats;
|
|
2783
|
-
};
|
|
2769
|
+
max_participants: number;
|
|
2784
2770
|
/**
|
|
2785
2771
|
*
|
|
2786
2772
|
* @type {number}
|
|
2787
2773
|
* @memberof GetCallStatsResponse
|
|
2788
2774
|
*/
|
|
2789
|
-
|
|
2775
|
+
max_total_quality_limitation_duration_seconds: number;
|
|
2790
2776
|
/**
|
|
2791
2777
|
*
|
|
2792
|
-
* @type {
|
|
2778
|
+
* @type {Array<UserStats>}
|
|
2793
2779
|
* @memberof GetCallStatsResponse
|
|
2794
2780
|
*/
|
|
2795
|
-
|
|
2781
|
+
participant_report: Array<UserStats>;
|
|
2796
2782
|
/**
|
|
2797
2783
|
*
|
|
2798
2784
|
* @type {number}
|
|
2799
2785
|
* @memberof GetCallStatsResponse
|
|
2800
2786
|
*/
|
|
2801
|
-
|
|
2787
|
+
publishing_participants: number;
|
|
2802
2788
|
/**
|
|
2803
2789
|
*
|
|
2804
|
-
* @type {
|
|
2790
|
+
* @type {number}
|
|
2805
2791
|
* @memberof GetCallStatsResponse
|
|
2806
2792
|
*/
|
|
2807
|
-
|
|
2793
|
+
quality_score: number;
|
|
2808
2794
|
/**
|
|
2809
2795
|
*
|
|
2810
2796
|
* @type {number}
|
|
2811
2797
|
* @memberof GetCallStatsResponse
|
|
2812
2798
|
*/
|
|
2813
|
-
|
|
2799
|
+
sfu_count: number;
|
|
2814
2800
|
/**
|
|
2815
2801
|
*
|
|
2816
|
-
* @type {
|
|
2802
|
+
* @type {Array<SFULocationResponse>}
|
|
2817
2803
|
* @memberof GetCallStatsResponse
|
|
2818
2804
|
*/
|
|
2819
|
-
|
|
2805
|
+
sfus: Array<SFULocationResponse>;
|
|
2820
2806
|
}
|
|
2821
2807
|
/**
|
|
2822
2808
|
*
|
|
@@ -5006,25 +4992,25 @@ export interface UserSessionStats {
|
|
|
5006
4992
|
* @type {number}
|
|
5007
4993
|
* @memberof UserSessionStats
|
|
5008
4994
|
*/
|
|
5009
|
-
|
|
4995
|
+
max_fir_per_second?: number;
|
|
5010
4996
|
/**
|
|
5011
4997
|
*
|
|
5012
4998
|
* @type {number}
|
|
5013
4999
|
* @memberof UserSessionStats
|
|
5014
5000
|
*/
|
|
5015
|
-
|
|
5001
|
+
max_freezes_per_second?: number;
|
|
5016
5002
|
/**
|
|
5017
5003
|
*
|
|
5018
5004
|
* @type {number}
|
|
5019
5005
|
* @memberof UserSessionStats
|
|
5020
5006
|
*/
|
|
5021
|
-
|
|
5007
|
+
max_nack_per_second?: number;
|
|
5022
5008
|
/**
|
|
5023
5009
|
*
|
|
5024
5010
|
* @type {number}
|
|
5025
5011
|
* @memberof UserSessionStats
|
|
5026
5012
|
*/
|
|
5027
|
-
|
|
5013
|
+
max_pli_per_second?: number;
|
|
5028
5014
|
/**
|
|
5029
5015
|
*
|
|
5030
5016
|
* @type {VideoQuality}
|
|
@@ -5097,6 +5083,12 @@ export interface UserSessionStats {
|
|
|
5097
5083
|
* @memberof UserSessionStats
|
|
5098
5084
|
*/
|
|
5099
5085
|
sdk_version?: string;
|
|
5086
|
+
/**
|
|
5087
|
+
*
|
|
5088
|
+
* @type {string}
|
|
5089
|
+
* @memberof UserSessionStats
|
|
5090
|
+
*/
|
|
5091
|
+
session_id: string;
|
|
5100
5092
|
/**
|
|
5101
5093
|
*
|
|
5102
5094
|
* @type {Array<Subsession>}
|
|
@@ -5142,12 +5134,10 @@ export interface UserStats {
|
|
|
5142
5134
|
info: UserInfoResponse;
|
|
5143
5135
|
/**
|
|
5144
5136
|
*
|
|
5145
|
-
* @type {
|
|
5137
|
+
* @type {Array<UserSessionStats>}
|
|
5146
5138
|
* @memberof UserStats
|
|
5147
5139
|
*/
|
|
5148
|
-
session_stats:
|
|
5149
|
-
[key: string]: UserSessionStats;
|
|
5150
|
-
};
|
|
5140
|
+
session_stats: Array<UserSessionStats>;
|
|
5151
5141
|
}
|
|
5152
5142
|
/**
|
|
5153
5143
|
*
|
package/package.json
CHANGED
|
@@ -2724,18 +2724,6 @@ export interface GetCallResponse {
|
|
|
2724
2724
|
* @interface GetCallStatsResponse
|
|
2725
2725
|
*/
|
|
2726
2726
|
export interface GetCallStatsResponse {
|
|
2727
|
-
/**
|
|
2728
|
-
*
|
|
2729
|
-
* @type {number}
|
|
2730
|
-
* @memberof GetCallStatsResponse
|
|
2731
|
-
*/
|
|
2732
|
-
average_jitter: number;
|
|
2733
|
-
/**
|
|
2734
|
-
*
|
|
2735
|
-
* @type {number}
|
|
2736
|
-
* @memberof GetCallStatsResponse
|
|
2737
|
-
*/
|
|
2738
|
-
average_latency: number;
|
|
2739
2727
|
/**
|
|
2740
2728
|
*
|
|
2741
2729
|
* @type {number}
|
|
@@ -2756,64 +2744,64 @@ export interface GetCallStatsResponse {
|
|
|
2756
2744
|
duration: string;
|
|
2757
2745
|
/**
|
|
2758
2746
|
*
|
|
2759
|
-
* @type {
|
|
2747
|
+
* @type {Stats}
|
|
2760
2748
|
* @memberof GetCallStatsResponse
|
|
2761
2749
|
*/
|
|
2762
|
-
|
|
2750
|
+
jitter?: Stats;
|
|
2763
2751
|
/**
|
|
2764
2752
|
*
|
|
2765
|
-
* @type {
|
|
2753
|
+
* @type {Stats}
|
|
2766
2754
|
* @memberof GetCallStatsResponse
|
|
2767
2755
|
*/
|
|
2768
|
-
|
|
2756
|
+
latency?: Stats;
|
|
2769
2757
|
/**
|
|
2770
2758
|
*
|
|
2771
2759
|
* @type {number}
|
|
2772
2760
|
* @memberof GetCallStatsResponse
|
|
2773
2761
|
*/
|
|
2774
|
-
|
|
2762
|
+
max_freezes_duration_seconds: number;
|
|
2775
2763
|
/**
|
|
2776
2764
|
*
|
|
2777
|
-
* @type {
|
|
2765
|
+
* @type {number}
|
|
2778
2766
|
* @memberof GetCallStatsResponse
|
|
2779
2767
|
*/
|
|
2780
|
-
|
|
2768
|
+
max_participants: number;
|
|
2781
2769
|
/**
|
|
2782
2770
|
*
|
|
2783
2771
|
* @type {number}
|
|
2784
2772
|
* @memberof GetCallStatsResponse
|
|
2785
2773
|
*/
|
|
2786
|
-
|
|
2774
|
+
max_total_quality_limitation_duration_seconds: number;
|
|
2787
2775
|
/**
|
|
2788
2776
|
*
|
|
2789
|
-
* @type {
|
|
2777
|
+
* @type {Array<UserStats>}
|
|
2790
2778
|
* @memberof GetCallStatsResponse
|
|
2791
2779
|
*/
|
|
2792
|
-
|
|
2780
|
+
participant_report: Array<UserStats>;
|
|
2793
2781
|
/**
|
|
2794
2782
|
*
|
|
2795
2783
|
* @type {number}
|
|
2796
2784
|
* @memberof GetCallStatsResponse
|
|
2797
2785
|
*/
|
|
2798
|
-
|
|
2786
|
+
publishing_participants: number;
|
|
2799
2787
|
/**
|
|
2800
2788
|
*
|
|
2801
|
-
* @type {
|
|
2789
|
+
* @type {number}
|
|
2802
2790
|
* @memberof GetCallStatsResponse
|
|
2803
2791
|
*/
|
|
2804
|
-
|
|
2792
|
+
quality_score: number;
|
|
2805
2793
|
/**
|
|
2806
2794
|
*
|
|
2807
2795
|
* @type {number}
|
|
2808
2796
|
* @memberof GetCallStatsResponse
|
|
2809
2797
|
*/
|
|
2810
|
-
|
|
2798
|
+
sfu_count: number;
|
|
2811
2799
|
/**
|
|
2812
2800
|
*
|
|
2813
|
-
* @type {
|
|
2801
|
+
* @type {Array<SFULocationResponse>}
|
|
2814
2802
|
* @memberof GetCallStatsResponse
|
|
2815
2803
|
*/
|
|
2816
|
-
|
|
2804
|
+
sfus: Array<SFULocationResponse>;
|
|
2817
2805
|
}
|
|
2818
2806
|
|
|
2819
2807
|
/**
|
|
@@ -4997,25 +4985,25 @@ export interface UserSessionStats {
|
|
|
4997
4985
|
* @type {number}
|
|
4998
4986
|
* @memberof UserSessionStats
|
|
4999
4987
|
*/
|
|
5000
|
-
|
|
4988
|
+
max_fir_per_second?: number;
|
|
5001
4989
|
/**
|
|
5002
4990
|
*
|
|
5003
4991
|
* @type {number}
|
|
5004
4992
|
* @memberof UserSessionStats
|
|
5005
4993
|
*/
|
|
5006
|
-
|
|
4994
|
+
max_freezes_per_second?: number;
|
|
5007
4995
|
/**
|
|
5008
4996
|
*
|
|
5009
4997
|
* @type {number}
|
|
5010
4998
|
* @memberof UserSessionStats
|
|
5011
4999
|
*/
|
|
5012
|
-
|
|
5000
|
+
max_nack_per_second?: number;
|
|
5013
5001
|
/**
|
|
5014
5002
|
*
|
|
5015
5003
|
* @type {number}
|
|
5016
5004
|
* @memberof UserSessionStats
|
|
5017
5005
|
*/
|
|
5018
|
-
|
|
5006
|
+
max_pli_per_second?: number;
|
|
5019
5007
|
/**
|
|
5020
5008
|
*
|
|
5021
5009
|
* @type {VideoQuality}
|
|
@@ -5088,6 +5076,12 @@ export interface UserSessionStats {
|
|
|
5088
5076
|
* @memberof UserSessionStats
|
|
5089
5077
|
*/
|
|
5090
5078
|
sdk_version?: string;
|
|
5079
|
+
/**
|
|
5080
|
+
*
|
|
5081
|
+
* @type {string}
|
|
5082
|
+
* @memberof UserSessionStats
|
|
5083
|
+
*/
|
|
5084
|
+
session_id: string;
|
|
5091
5085
|
/**
|
|
5092
5086
|
*
|
|
5093
5087
|
* @type {Array<Subsession>}
|
|
@@ -5133,10 +5127,10 @@ export interface UserStats {
|
|
|
5133
5127
|
info: UserInfoResponse;
|
|
5134
5128
|
/**
|
|
5135
5129
|
*
|
|
5136
|
-
* @type {
|
|
5130
|
+
* @type {Array<UserSessionStats>}
|
|
5137
5131
|
* @memberof UserStats
|
|
5138
5132
|
*/
|
|
5139
|
-
session_stats:
|
|
5133
|
+
session_stats: Array<UserSessionStats>;
|
|
5140
5134
|
}
|
|
5141
5135
|
/**
|
|
5142
5136
|
*
|
package/src/logger.ts
CHANGED
|
@@ -17,6 +17,11 @@ export const logToConsole: Logger = (logLevel, message, ...args) => {
|
|
|
17
17
|
let logMethod;
|
|
18
18
|
switch (logLevel) {
|
|
19
19
|
case 'error':
|
|
20
|
+
if (isReactNative()) {
|
|
21
|
+
message = `ERROR: ${message}`;
|
|
22
|
+
logMethod = console.info;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
20
25
|
logMethod = console.error;
|
|
21
26
|
break;
|
|
22
27
|
case 'warn':
|
package/src/rtc/Publisher.ts
CHANGED
|
@@ -294,7 +294,11 @@ export class Publisher {
|
|
|
294
294
|
`Setting ${TrackType[trackType]} codec preferences`,
|
|
295
295
|
codecPreferences,
|
|
296
296
|
);
|
|
297
|
-
|
|
297
|
+
try {
|
|
298
|
+
transceiver.setCodecPreferences(codecPreferences);
|
|
299
|
+
} catch (err) {
|
|
300
|
+
logger('warn', `Couldn't set codec preferences`, err);
|
|
301
|
+
}
|
|
298
302
|
}
|
|
299
303
|
} else {
|
|
300
304
|
const previousTrack = transceiver.sender.track;
|
package/src/rtc/codecs.ts
CHANGED
|
@@ -6,18 +6,18 @@ export const getPreferredCodecs = (
|
|
|
6
6
|
codecToRemove?: string,
|
|
7
7
|
): RTCRtpCodecCapability[] | undefined => {
|
|
8
8
|
const logger = getLogger(['codecs']);
|
|
9
|
-
if (!('getCapabilities' in
|
|
10
|
-
logger
|
|
9
|
+
if (!('getCapabilities' in RTCRtpReceiver)) {
|
|
10
|
+
logger('warn', 'RTCRtpReceiver.getCapabilities is not supported');
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
const cap =
|
|
13
|
+
const cap = RTCRtpReceiver.getCapabilities(kind);
|
|
14
14
|
if (!cap) return;
|
|
15
15
|
const matched: RTCRtpCodecCapability[] = [];
|
|
16
16
|
const partialMatched: RTCRtpCodecCapability[] = [];
|
|
17
17
|
const unmatched: RTCRtpCodecCapability[] = [];
|
|
18
18
|
cap.codecs.forEach((c) => {
|
|
19
19
|
const codec = c.mimeType.toLowerCase();
|
|
20
|
-
logger
|
|
20
|
+
logger('debug', `Found supported codec: ${codec}`);
|
|
21
21
|
const shouldRemoveCodec =
|
|
22
22
|
codecToRemove && codec === `${kind}/${codecToRemove.toLowerCase()}`;
|
|
23
23
|
if (shouldRemoveCodec) return;
|
|
@@ -39,9 +39,7 @@ export const getPreferredCodecs = (
|
|
|
39
39
|
matched.push(c);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
logger?.('info', `Preffered codecs: `, result);
|
|
44
|
-
return result;
|
|
42
|
+
return [...matched, ...partialMatched, ...unmatched];
|
|
45
43
|
};
|
|
46
44
|
|
|
47
45
|
export const getGenericSdp = async (direction: RTCRtpTransceiverDirection) => {
|