initialize static method
Initialize the WebRTC plugin.
On native, this snapshots the build defaults that the implicit peer-connection factory will use the next time it is created.
Calling initialize again refreshes the snapshot. Already-built factories keep their original configuration, the new configuration takes effect only on the next factory build.
Params:
"networkIgnoreMask": a list of AdapterType objects converted to string with .value
Android specific params:
"forceSWCodec": a boolean that forces software codecs to be used for video.
"forceSWCodecList": a list of strings of software codecs that should use software.
"androidAudioConfiguration": an AndroidAudioConfiguration object mapped with toMap()
"bypassVoiceProcessing": a boolean that bypasses the audio processing for the audio device.
"audioSampleRate": (Android only) Sets both input and output sample rate in Hz (e.g., 48000). If not specified, uses the native device's default sample rate.
"audioOutputSampleRate": (Android only) Sets only output sample rate in Hz (e.g., 48000). Takes precedence over audioSampleRate for output. If not specified, uses audioSampleRate or native default.
Implementation
static Future<void> initialize({
Map<String, dynamic>? options,
bool refresh = false,
}) async {
if (initialized && !refresh) {
return;
}
await _channel.invokeMethod<void>('initialize', <String, dynamic>{
'options': options ?? <String, dynamic>{},
});
initialized = true;
}