providers/core/core.peerconnection.js
function PeerConnection(portModule, dispatchEvent,
                        RTCPeerConnection, RTCSessionDescription,
                        RTCIceCandidate) {
  // Channel for emitting events to consumer.
  this.dispatchEvent = dispatchEvent;

  // a (hopefully unique) ID for debugging.
  this.peerName = "p" + Math.random();

  // This is the portApp (defined in freedom/src/port-app.js). A way to speak
  // to freedom.
  this.freedomModule = portModule.module;

  // For tests we may mock out the PeerConnection and
  // SessionDescription implementations
  this.RTCPeerConnection = RTCPeerConnection;
  this.RTCSessionDescription = RTCSessionDescription;
  this.RTCIceCandidate = RTCIceCandidate;

  // This is the a channel to send signalling messages.
  this.signallingChannel = null;

  // The DataPeer object for talking to the peer.
  this.peer = null;

  // The Core object for managing channels.
  this.freedomModule.once('core', function (Core) {
    this.core = new Core();
  }.bind(this));
  this.freedomModule.emit(this.freedomModule.controlChannel, {
    type: 'core request delegated to peerconnection',
    request: 'core'
  });
}
function PeerConnection(portModule, dispatchEvent,
                        RTCPeerConnection, RTCSessionDescription,
                        RTCIceCandidate) {
  // Channel for emitting events to consumer.
  this.dispatchEvent = dispatchEvent;

  // a (hopefully unique) ID for debugging.
  this.peerName = "p" + Math.random();

  // This is the portApp (defined in freedom/src/port-app.js). A way to speak
  // to freedom.
  this.freedomModule = portModule.module;

  // For tests we may mock out the PeerConnection and
  // SessionDescription implementations
  this.RTCPeerConnection = RTCPeerConnection;
  this.RTCSessionDescription = RTCSessionDescription;
  this.RTCIceCandidate = RTCIceCandidate;

  // This is the a channel to send signalling messages.
  this.signallingChannel = null;

  // The DataPeer object for talking to the peer.
  this.peer = null;

  // The Core object for managing channels.
  this.freedomModule.once('core', function (Core) {
    this.core = new Core();
  }.bind(this));
  this.freedomModule.emit(this.freedomModule.controlChannel, {
    type: 'core request delegated to peerconnection',
    request: 'core'
  });
}
function PeerConnection ( portModule , dispatchEvent , RTCPeerConnection , RTCSessionDescription , RTCIceCandidate ) { // Channel for emitting events to consumer. this . dispatchEvent = dispatchEvent ; // a (hopefully unique) ID for debugging. this . peerName = "p" + Math . random ( ) ; // This is the portApp (defined in freedom/src/port-app.js). A way to speak // to freedom. this . freedomModule = portModule . module ; // For tests we may mock out the PeerConnection and // SessionDescription implementations this . RTCPeerConnection = RTCPeerConnection ; this . RTCSessionDescription = RTCSessionDescription ; this . RTCIceCandidate = RTCIceCandidate ; // This is the a channel to send signalling messages. this . signallingChannel = null ; // The DataPeer object for talking to the peer. this . peer = null ; // The Core object for managing channels. this . freedomModule . once ( 'core' , function ( Core ) { this . core = new Core ( ) ; } . bind ( this ) ) ; this . freedomModule . emit ( this . freedomModule . controlChannel , { type : 'core request delegated to peerconnection' , request : 'core' } ) ; }
_signallingChannel is a channel for emitting events back to the freedom Hub.
_signallingChannel is a channel for emitting events back to the freedom Hub .