Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix the problems in the last commit

  • Loading branch information...
commit 9cba669ea0dcb4de3f2a0d1525cd0e578cce9a9c 1 parent 8c6528f
Dennis Mårtensson authored

Showing 1 changed file with 8 additions and 7 deletions. Show diff stats Hide diff stats

  1. +8 7 lib/webrtc.io.js
15 lib/webrtc.io.js
@@ -87,7 +87,7 @@ if (navigator.webkitGetUserMedia) {
87 87 "url": "stun:stun.l.google.com:19302"
88 88 }]
89 89 };
90   - }
  90 + };
91 91
92 92
93 93 // Reference to the lone PeerConnection instance.
@@ -117,7 +117,7 @@ if (navigator.webkitGetUserMedia) {
117 117 "optional": [{
118 118 "DtlsSrtpKeyAgreement": true
119 119 }]
120   - }
  120 + };
121 121
122 122
123 123 // check whether data channel is supported.
@@ -282,7 +282,7 @@ if (navigator.webkitGetUserMedia) {
282 282 };
283 283 // temporary measure to remove Moz* constraints in Chrome
284 284 if (navigator.webkitGetUserMedia) {
285   - for (prop in constraints.mandatory) {
  285 + for (var prop in constraints.mandatory) {
286 286 if (prop.indexOf("Moz") != -1) {
287 287 delete constraints.mandatory[prop];
288 288 }
@@ -477,17 +477,18 @@ function preferOpus(sdp) {
477 477
478 478 // Search for m line.
479 479 for (var i = 0; i < sdpLines.length; i++) {
  480 + var mLineIndex = null;
480 481 if (sdpLines[i].search('m=audio') !== -1) {
481   - var mLineIndex = i;
  482 + mLineIndex = i;
482 483 break;
483 484 }
484 485 }
485 486 if (mLineIndex === null) return sdp;
486 487
487 488 // If Opus is available, set it as the default in m line.
488   - for (var i = 0; i < sdpLines.length; i++) {
489   - if (sdpLines[i].search('opus/48000') !== -1) {
490   - var opusPayload = extractSdp(sdpLines[i], /:(\d+) opus\/48000/i);
  489 + for (var j = 0; j < sdpLines.length; j++) {
  490 + if (sdpLines[j].search('opus/48000') !== -1) {
  491 + var opusPayload = extractSdp(sdpLines[j], /:(\d+) opus\/48000/i);
491 492 if (opusPayload) sdpLines[mLineIndex] = setDefaultCodec(sdpLines[mLineIndex], opusPayload);
492 493 break;
493 494 }

0 comments on commit 9cba669

Please sign in to comment.
Something went wrong with that request. Please try again.