Skip to content

Commit

Permalink
Fix audio activity detection for downstreams
Browse files Browse the repository at this point in the history
Replaced the non-existent `track` property in `RTCStatsType`
with the valid `inbound-rtp` property.
  • Loading branch information
Jackson-Vieira authored and jech committed Aug 28, 2023
1 parent ea49756 commit 1ad91ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion static/galene.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ function gotDownStats(stats) {
c.pc.getReceivers().forEach(r => {
let tid = r.track && r.track.id;
let s = tid && stats[tid];
let energy = s && s['track'] && s['track'].audioEnergy;
let energy = s && s['inbound-rtp'] && s['inbound-rtp'].audioEnergy;
if(typeof energy === 'number')
maxEnergy = Math.max(maxEnergy, energy);
});
Expand Down
2 changes: 1 addition & 1 deletion static/protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ Stream.prototype.updateStats = async function() {

if(report) {
for(let r of report.values()) {
if(rtid && r.type === 'track') {
if(rtid && r.type === 'inbound-rtp') {
if(!('totalAudioEnergy' in r))
continue;
if(!stats[rtid])
Expand Down

0 comments on commit 1ad91ad

Please sign in to comment.