close() {
    if (this._status === OPENED) {
      this._status = CLOSING;
      // Stop display
      if (this.node) {
        if (this.node.stop) {
          this.node.stop();
        }
        this.node.srcObject = null;
        this.container.removeChild(this.node);
        this.node = null;
      }
      // Stop listening to remote ICE candidates
      this._remoteICECandidates(false);
      // Stop listening to SDP messages
      DataSync.off(`${this._remotePath}/sdp`, 'value');
      // Remove data
      DataSync.remove(this._localPath);
      // Close PeerConnection
      if (this.pc && this.pc.signalingState !== 'closed') {
        this.pc.onsignalingstatechange = () => {
          if (this.pc.signalingState !== 'closed') {
            this._status = CLOSED;
          }
        };
        this.pc.close();
      } else {
        this._status = CLOSED;
      }
    }
  }
/**
   * Close the PeerConnection and stop listening to SDP messages
   * @access protected
   */
Close the PeerConnection and stop listening to SDP messages
@access protected
Close the PeerConnection and stop listening to SDP messages @access protected
close() {
    if (this._status === OPENED) {
      this._status = CLOSING;
      if (this.node) {
        if (this.node.stop) {
          this.node.stop();
        }
        this.node.srcObject = null;
        this.container.removeChild(this.node);
        this.node = null;
      }
      this._remoteICECandidates(false);
      DataSync.off(`${this._remotePath}/sdp`, 'value');
      DataSync.remove(this._localPath);
      if (this.pc && this.pc.signalingState !== 'closed') {
        this.pc.onsignalingstatechange = () => {
          if (this.pc.signalingState !== 'closed') {
            this._status = CLOSED;
          }
        };
        this.pc.close();
      } else {
        this._status = CLOSED;
      }
    }
  }
close ( ) { if ( this . _status === OPENED ) { this . _status = CLOSING ; if ( this . node ) { if ( this . node . stop ) { this . node . stop ( ) ; } this . node . srcObject = null ; this . container . removeChild ( this . node ) ; this . node = null ; } this . _remoteICECandidates ( false ) ; DataSync . off ( ` ${ this . _remotePath } ` , 'value' ) ; DataSync . remove ( this . _localPath ) ; if ( this . pc && this . pc . signalingState !== 'closed' ) { this . pc . onsignalingstatechange = ( ) => { if ( this . pc . signalingState !== 'closed' ) { this . _status = CLOSED ; } } ; this . pc . close ( ) ; } else { this . _status = CLOSED ; } } }
Close the PeerConnection and stop listening to SDP messages
 @access protected
Close the PeerConnection and stop listening to SDP messages @access protected
// Stop display // Stop listening to remote ICE candidates // Stop listening to SDP messages // Remove data // Close PeerConnection