MediaConnection constructor

MediaConnection(
  1. String peerId,
  2. Peer? provider,
  3. PeerConnectOption? options
)

Implementation

MediaConnection(super.peerId, super.provider, super.options) {
  _localStream = options?.stream;
  connectionId = options?.connectionId ?? _idPrefix + util.randomToken();
  _negotiator = Negotiator(this);

  if (_localStream != null) {
    _negotiator?.startConnection(
        options!.copyWith(originator: true, stream: _localStream));
  }
}