Commit 1ad91adf authored by Jackson Vieira's avatar Jackson Vieira Committed by Juliusz Chroboczek

Fix audio activity detection for downstreams

Replaced the non-existent `track` property in `RTCStatsType`
with the valid `inbound-rtp` property.
parent ea49756a
......@@ -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);
});
......
......@@ -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])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment