File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 554
554
console . group ( 'onCallStatsReport' ) ;
555
555
console . log ( 'userId: ' , userId ) ;
556
556
console . log ( 'session: ' , session ) ;
557
+ console . log ( 'stats: ' , stats ) ;
557
558
console . groupEnd ( ) ;
558
559
559
560
/**
560
561
* Hack for Firefox
561
562
* (https://bugzilla.mozilla.org/show_bug.cgi?id=852665)
562
563
*/
563
564
if ( is_firefox ) {
564
- var inboundrtp = _ . findWhere ( stats , { type : 'inboundrtp' } ) ;
565
+ var inboundrtp = _ . findWhere ( stats , { ' type' : 'inboundrtp' } ) ;
565
566
566
- if ( ! inboundrtp || ! app . helpers . isBytesReceivedChanges ( userId , inboundrtp ) ) {
567
+ if ( ! app . helpers . isBytesReceivedChanges ( userId , inboundrtp ) ) {
567
568
console . warn ( 'This is Firefox and user ' + userId + ' has lost his connection.' ) ;
568
569
569
- if ( ! _ . isEmpty ( app . currentSession ) ) {
570
+ /**
571
+ * 2 - This is how many stats
572
+ * we can get without inboundrtp
573
+ * before close connection
574
+ */
575
+ if ( app . network [ userId ] . count >= 2 && ! _ . isEmpty ( app . currentSession ) ) {
570
576
app . currentSession . closeConnection ( userId ) ;
571
577
app . helpers . notifyIfUserLeaveCall ( session , userId , 'disconnected' , 'Disconnected' ) ;
572
578
}
713
719
var state = app . currentSession . connectionStateForUser ( userId ) ,
714
720
peerConnList = QB . webrtc . PeerConnectionState ;
715
721
716
-
717
722
if ( state === peerConnList . DISCONNECTED || state === peerConnList . FAILED || state === peerConnList . CLOSED ) {
718
723
return false ;
719
724
}
Original file line number Diff line number Diff line change 11
11
12
12
app . helpers . isBytesReceivedChanges = function ( userId , inboundrtp ) {
13
13
var res = true ,
14
- inbBytesRec = inboundrtp . bytesReceived ;
14
+ inbBytesRec = inboundrtp ? inboundrtp . bytesReceived : 0 ;
15
15
16
- if ( app . network [ userId ] === undefined ) {
16
+ if ( app . network [ userId ] || ! inboundrtp ) {
17
17
app . network [ userId ] = {
18
- 'bytesReceived' : inbBytesRec
18
+ 'bytesReceived' : inbBytesRec ,
19
+ 'count' : 0
19
20
} ;
20
21
} else {
21
22
if ( app . network [ userId ] . bytesReceived === inbBytesRec ) {
22
23
res = false ;
23
24
} else {
24
25
app . network [ userId ] = {
25
- 'bytesReceived' : inbBytesRec
26
+ 'bytesReceived' : inbBytesRec ,
27
+ 'count' : ++ app . network [ userId ] . count
26
28
} ;
27
29
}
28
30
}
You can’t perform that action at this time.
0 commit comments