Skip to content

Commit a8821c1

Browse files
authored
Merge pull request #506 from ant-media/add-playback-stats
Add playback stats for WebRTC and add test codes
2 parents 5879368 + 6b4bb5e commit a8821c1

File tree

6 files changed

+2457
-2187
lines changed

6 files changed

+2457
-2187
lines changed

karma.conf.cjs

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ module.exports = function(config) {
33
frameworks: ['mocha', 'chai', 'sinon'],
44
files: [
55
{ pattern: "src/test/js/**/*.js", type: "module" },
6-
{ pattern: "src/main/js/**/*.js", included: false }
6+
{ pattern: "src/main/js/**/*.js", included: false, served:true }
77

88
],
9+
10+
proxies: {
11+
'/volume-meter-processor.js': '/base/src/main/js/volume-meter-processor.js'
12+
},
913

1014
reporters: ['progress', 'coverage'],
1115

src/main/js/peer_stats.js

+34-3
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,44 @@ export class PeerStats {
6666
this.lastBytesSent = 0;
6767

6868
/**
69+
* @deprecated use videoPacketsSent
6970
* The total number of video packets sent.
7071
* @type {number}
7172
*/
7273
this.totalVideoPacketsSent = 0;
74+
/**
75+
* The total number of video packets sent.
76+
* @type {number}
77+
*/
78+
this.videoPacketsSent = 0;
79+
/**
80+
* The total number of video packets received.
81+
* @type {number}
82+
*/
83+
this.videoPacketsReceived = 0;
84+
7385

7486
/**
75-
* The total number of audio packets sent.
87+
* @deprecated use audioPacketsSent
88+
* The total number of audio packets sent.
7689
* @type {number}
7790
*/
7891
this.totalAudioPacketsSent = 0;
79-
80-
/**
92+
93+
/**
94+
*
95+
* The total number of audio packets sent.
96+
* @type {number}
97+
*/
98+
this.audioPacketsSent = 0;
99+
/*
100+
* The total number of audio packets received.
101+
* @type {number}
102+
*
103+
* */
104+
this.audioPacketsReceived = 0;
105+
106+
/**
81107
* The current timestamp.
82108
* @type {number}
83109
*/
@@ -216,6 +242,11 @@ export class PeerStats {
216242
* @type {*[]}
217243
*/
218244
this.inboundRtpList = [];
245+
246+
/**
247+
* The current round trip time for the candidate pair
248+
*/
249+
this.currentRoundTripTime = 0;
219250
}
220251
//kbits/sec
221252
get averageOutgoingBitrate() {

0 commit comments

Comments
 (0)