call method

MediaConnection call(
  1. String peerId,
  2. MediaStream stream
)

Implementation

MediaConnection call(String peerId, MediaStream stream) {
  if (peerId == id) {
    throw Exception('Cannot connect to self.');
  }
  final connectionId = _uuid.v4();
  final connection = MediaConnection(
    peerId: peerId,
    signalingClient: _signaling,
    adapter: _adapter,
    connectionId: connectionId,
    localStream: stream,
    config: _config,
  );

  _connections[connectionId] = connection;
  connection.call();

  return connection;
}