File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -328,18 +328,24 @@ export class Peer {
328328 const rawStats = await sess . getStats ( ) ;
329329 const at = Date . now ( ) * 1_000 ;
330330 const stats = collectWebRTCStats ( rawStats ) ;
331- const quality = calculateWebRTCQuality ( stats ) ;
332-
333- events . push ( {
334- timestampUs : BigInt ( at ) ,
335- tags : {
336- src : this . transport . info ,
337- dst : sess . other ,
338- } ,
339- metrics : {
340- qualityScore : BigInt ( quality ) ,
341- } ,
342- } ) ;
331+
332+ if (
333+ stats . audio . length != 0 ||
334+ stats . video . length != 0 && stats . data . length != 0
335+ ) {
336+ const quality = calculateWebRTCQuality ( stats ) ;
337+
338+ events . push ( {
339+ timestampUs : BigInt ( at ) ,
340+ tags : {
341+ src : this . transport . info ,
342+ dst : sess . other ,
343+ } ,
344+ metrics : {
345+ qualityScore : BigInt ( quality ) ,
346+ } ,
347+ } ) ;
348+ }
343349 }
344350
345351 const request : AnalyticsReportReq = { events } ;
You can’t perform that action at this time.
0 commit comments