Skip to content

Commit 574ca1e

Browse files
author
dimaspirit
committed
check bytesReceived
1 parent fa3005a commit 574ca1e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

samples/webrtc/js/app.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,27 @@
134134
}
135135
}
136136

137+
function isBytesReceivedChanges(userId, inboundrtp) {
138+
var res = true,
139+
inbBytesRec = inboundrtp.bytesReceived;
140+
141+
if(network[userId] === undefined) {
142+
network[userId] = {
143+
'bytesReceived': inbBytesRec
144+
};
145+
} else {
146+
if(network[userId].bytesReceived === inbBytesRec) {
147+
res = false;
148+
} else {
149+
network[userId] = {
150+
'bytesReceived': inbBytesRec
151+
};
152+
}
153+
}
154+
155+
return res;
156+
}
157+
137158
/**
138159
* INITIALIZE
139160
*/
@@ -492,12 +513,11 @@
492513
console.groupEnd();
493514

494515
var inboundrtp = is_firefox ? _.findWhere(stats, {type: 'inboundrtp'}) : undefined;
495-
496516
/**
497517
* Hack for Firefox
498518
* (https://bugzilla.mozilla.org/show_bug.cgi?id=852665)
499519
*/
500-
if(is_firefox && !inboundrtp) {
520+
if(is_firefox && (!inboundrtp || !isBytesReceivedChanges(userId, inboundrtp))) {
501521
QB.webrtc.onStopCallListener(app.currentSession, userId);
502522
app.currentSession.processOnStop(userId);
503523
}

0 commit comments

Comments
 (0)