Browse Source

fix(ie11): do not call JSON.stringify with temasys ice candidate

Calling JSON.stringify on a temasys object causes a stack overflow.
The result is that the JingleSessionPC's work queue never gets
cleared so future work, like video muting, will not get called.
Instead of passing in the candidate directly, manually do
what chrome's implementation of candidate.toJSON does.
dev1
Leonard Kim 7 years ago
parent
commit
d73c81eb4b
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      modules/RTC/TraceablePeerConnection.js

+ 9
- 1
modules/RTC/TraceablePeerConnection.js View File

@@ -2257,7 +2257,15 @@ TraceablePeerConnection.prototype.addIceCandidate = function(
2257 2257
         successCallback,
2258 2258
         failureCallback) {
2259 2259
     // var self = this;
2260
-    this.trace('addIceCandidate', JSON.stringify(candidate, null, ' '));
2260
+
2261
+    // Calling JSON.stringify with temasys objects causes a stack overflow, so
2262
+    // instead pick out values to log.
2263
+    this.trace('addIceCandidate', JSON.stringify({
2264
+        candidate: candidate.candidate,
2265
+        sdpMid: candidate.sdpMid,
2266
+        sdpMLineIndex: candidate.sdpMLineIndex,
2267
+        usernameFragment: candidate.usernameFragment
2268
+    }, null, ' '));
2261 2269
     this.peerconnection.addIceCandidate(
2262 2270
         candidate, successCallback, failureCallback);
2263 2271
 

Loading…
Cancel
Save