updateConstraints(constraints) {
    Log.d('Local~updateConstraints', constraints);
    this.constraints = constraints;
    return navigator.mediaDevices.getUserMedia(this.constraints)
      .catch((e) => {
        (this._callbacks[Events.local.WEBRTC_ERROR] || [])
          .forEach(cb => cb(e));
        return e;
      })
      .then((media) => {
        ['audio', 'video'].forEach((kind) => {
          const constraintsValue = this.constraints[kind];
          if (constraintsValue) {
            if (constraintsValue.deviceId || constraintsValue.facingMode) {
              this._inputs[kind] = _getConstraintValue(
                constraintsValue,
                constraintsValue.facingMode ? 'facingMode' : 'deviceId'
              );
            }
          }
        });
        this.media = media;
      });
  }
/**
   * Updates the stream constraints and retrieve the new MediaStream
   * @param constraints
   * @returns {*|Promise.<TResult>}
   */
Updates the stream constraints and retrieve the new MediaStream
@param constraints
@returns {*|Promise.}
Updates the stream constraints and retrieve the new MediaStream @param constraints @returns { * |Promise . }
updateConstraints(constraints) {
    Log.d('Local~updateConstraints', constraints);
    this.constraints = constraints;
    return navigator.mediaDevices.getUserMedia(this.constraints)
      .catch((e) => {
        (this._callbacks[Events.local.WEBRTC_ERROR] || [])
          .forEach(cb => cb(e));
        return e;
      })
      .then((media) => {
        ['audio', 'video'].forEach((kind) => {
          const constraintsValue = this.constraints[kind];
          if (constraintsValue) {
            if (constraintsValue.deviceId || constraintsValue.facingMode) {
              this._inputs[kind] = _getConstraintValue(
                constraintsValue,
                constraintsValue.facingMode ? 'facingMode' : 'deviceId'
              );
            }
          }
        });
        this.media = media;
      });
  }
updateConstraints ( constraints ) { Log . d ( 'Local~updateConstraints' , constraints ) ; this . constraints = constraints ; return navigator . mediaDevices . getUserMedia ( this . constraints ) . catch ( ( e ) => { ( this . _callbacks [ Events . local . WEBRTC_ERROR ] || [ ] ) . forEach ( cb => cb ( e ) ) ; return e ; } ) . then ( ( media ) => { [ 'audio' , 'video' ] . forEach ( ( kind ) => { const constraintsValue = this . constraints [ kind ] ; if ( constraintsValue ) { if ( constraintsValue . deviceId || constraintsValue . facingMode ) { this . _inputs [ kind ] = _getConstraintValue ( constraintsValue , constraintsValue . facingMode ? 'facingMode' : 'deviceId' ) ; } } } ) ; this . media = media ; } ) ; }
Updates the stream constraints and retrieve the new MediaStream
 @param constraints
 @returns {*|Promise.<TResult>}
Updates the stream constraints and retrieve the new MediaStream @param constraints @returns { * |Promise . <TResult > }