ep_webrtc 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git@github.com:ether/ep_webrtc.git",
6
6
  "type": "git"
7
7
  },
8
- "version": "2.0.1",
8
+ "version": "2.0.2",
9
9
  "description": "WebRTC based audio/video chat to Etherpad",
10
10
  "author": "John McLear <john@mclear.co.uk>",
11
11
  "contributors": [],
@@ -18,7 +18,7 @@
18
18
  require('./adapter');
19
19
  const padcookie = require('ep_etherpad-lite/static/js/pad_cookie').padcookie;
20
20
 
21
- const enableDebugLogging = false;
21
+ let enableDebugLogging = false;
22
22
  const debug = (...args) => { if (enableDebugLogging) console.debug('ep_webrtc:', ...args); };
23
23
 
24
24
  const EventTargetPolyfill = (() => {
@@ -220,6 +220,7 @@ class PeerState extends EventTargetPolyfill {
220
220
  return;
221
221
  }
222
222
  this._debug('creating RTCPeerConnection with config', this._pcConfig);
223
+ this._debug('peer IDs:', peerIds);
223
224
  this._setRemoteStream(null);
224
225
  this._ids.from.instance = ++nextInstanceId;
225
226
  this._ids.to = peerIds;
@@ -341,7 +342,7 @@ class PeerState extends EventTargetPolyfill {
341
342
  }
342
343
 
343
344
  async receiveMessage(msg) {
344
- if (this._closed) return debug('Ignoring message because PeerState is closed');
345
+ if (this._closed) return this._debug('Ignoring message because PeerState is closed');
345
346
  const {ids, candidate, description, hangup} = msg;
346
347
  if (hangup != null) {
347
348
  this.close(true);
@@ -464,6 +465,9 @@ exports.rtc = new class {
464
465
  this._trackLocks = {audio: new Mutex(), video: new Mutex()};
465
466
  }
466
467
 
468
+ get enableDebugLogging() { return enableDebugLogging; }
469
+ set enableDebugLogging(val) { enableDebugLogging = !!val; }
470
+
467
471
  // API HOOKS
468
472
 
469
473
  async postAceInit(hookName, {pad}) {