1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 00:25:58 +01:00

Fix audio activity detection for downstreams

Replaced the non-existent `track` property in `RTCStatsType`
with the valid `inbound-rtp` property.
This commit is contained in:
Jackson Vieira 2023-08-26 02:29:15 -03:00 committed by Juliusz Chroboczek
parent ea49756a89
commit 1ad91adf89
2 changed files with 2 additions and 2 deletions

View file

@ -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);
});

View file

@ -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])