ericz 12 лет назад
Родитель
Сommit
81e1caedda
5 измененных файлов с 21 добавлено и 9 удалено
  1. 7 3
      demo/static/peer.js
  2. 7 3
      dist/peer.js
  3. 0 0
      dist/peer.min.js
  4. 3 1
      lib/sink.js
  5. 4 2
      lib/util.js

+ 7 - 3
demo/static/peer.js

@@ -726,8 +726,10 @@ EventEmitter.prototype.emit = function(type) {
 
 
 
-
 var util = {
+  
+  debug: false,
+  
   inherits: function(ctor, superCtor) {
     ctor.super_ = superCtor;
     ctor.prototype = Object.create(superCtor.prototype, {
@@ -754,7 +756,7 @@ var util = {
   },
   
   log: function () {
-    if (debug) {
+    if (util.debug) {
       for (var i = 0; i < arguments.length; i++) {
         console.log('*', i, '-- ', arguments[i]);
       }
@@ -828,9 +830,11 @@ function Peer(options) {
   EventEmitter.call(this);
   
   options = util.extend({
-    // Defaults
+    debug: false
   }, options);
   
+  util.debug = options.debug;
+  
   
   this._config = options.config || { 'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' }] };
   this._id = null;

+ 7 - 3
dist/peer.js

@@ -726,8 +726,10 @@ EventEmitter.prototype.emit = function(type) {
 
 
 
-
 var util = {
+  
+  debug: false,
+  
   inherits: function(ctor, superCtor) {
     ctor.super_ = superCtor;
     ctor.prototype = Object.create(superCtor.prototype, {
@@ -754,7 +756,7 @@ var util = {
   },
   
   log: function () {
-    if (debug) {
+    if (util.debug) {
       for (var i = 0; i < arguments.length; i++) {
         console.log('*', i, '-- ', arguments[i]);
       }
@@ -828,9 +830,11 @@ function Peer(options) {
   EventEmitter.call(this);
   
   options = util.extend({
-    // Defaults
+    debug: false
   }, options);
   
+  util.debug = options.debug;
+  
   
   this._config = options.config || { 'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' }] };
   this._id = null;

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/peer.min.js


+ 3 - 1
lib/sink.js

@@ -4,9 +4,11 @@ function Peer(options) {
   EventEmitter.call(this);
   
   options = util.extend({
-    // Defaults
+    debug: false
   }, options);
   
+  util.debug = options.debug;
+  
   
   this._config = options.config || { 'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' }] };
   this._id = null;

+ 4 - 2
lib/util.js

@@ -1,5 +1,7 @@
-
 var util = {
+  
+  debug: false,
+  
   inherits: function(ctor, superCtor) {
     ctor.super_ = superCtor;
     ctor.prototype = Object.create(superCtor.prototype, {
@@ -26,7 +28,7 @@ var util = {
   },
   
   log: function () {
-    if (debug) {
+    if (util.debug) {
       for (var i = 0; i < arguments.length; i++) {
         console.log('*', i, '-- ', arguments[i]);
       }

Некоторые файлы не были показаны из-за большого количества измененных файлов