create static method
Creates a new Peer
Use initiator
to specify if this is the peer that should initiate
the connection. For the webrtc config
the default is to use publicly
available stun server config is used. Although this works during
development it could get taken down at any moment and does not support
the turn protocol. If transfer is not working you can turn on logging
with the verbose
option.
Implementation
static Future<Peer> create(
{bool initiator = false,
bool verbose = false,
Map<String, dynamic>? config,
RTCDataChannelInit? dataChannelConfig}) async {
var conf = config ?? _googleStunConfig;
var connection = await createPeerConnection(conf, _loopbackConstraints);
return Peer._init(connection, initiator, verbose, dataChannelConfig);
}