JanusClient constructor Null safety
- {required JanusTransport transport,
- List<
RTCIceServer> ? iceServers, - int refreshInterval = 50,
- String? apiSecret,
- bool isUnifiedPlan = true,
- String? token,
- bool? stringIds = false,
- @Deprecated('set this option to true if you using legacy janus plugins with no unified-plan support only.') bool usePlanB = false,
- Duration? pollingInterval,
- dynamic loggerName = "JanusClient",
- dynamic maxEvent = 10,
- Level loggerLevel = Level.ALL,
- bool withCredentials = false}
JanusClient
setting usePlanB forces creation of peer connection with plan-b sdb semantics,
and would cause isUnifiedPlan to have no effect on sdpSemantics config
By default roomId should be numeric in nature although if you have configured stringIds
to true for room or janus, then you can have non-numeric roomIds.
Implementation
JanusClient(
{required JanusTransport transport,
List<RTCIceServer>? iceServers,
int refreshInterval = 50,
String? apiSecret,
bool isUnifiedPlan = true,
String? token,
bool? stringIds = false,
/// forces creation of peer connection with plan-b sdb semantics
@Deprecated('set this option to true if you using legacy janus plugins with no unified-plan support only.')
bool usePlanB = false,
Duration? pollingInterval,
loggerName = "JanusClient",
maxEvent = 10,
Level loggerLevel = Level.ALL,
bool withCredentials = false}) {
_stringIds = stringIds;
_transport = transport;
_isUnifiedPlan = isUnifiedPlan;
_iceServers = iceServers;
_refreshInterval = refreshInterval;
_apiSecret = apiSecret;
_loggerName = loggerName;
_maxEvent = maxEvent;
_loggerLevel = loggerLevel;
_withCredentials = withCredentials;
_isUnifiedPlan = isUnifiedPlan;
_token = token;
_pollingInterval = pollingInterval ?? Duration(seconds: 1);
_usePlanB = usePlanB;
_logger = Logger.detached(_loggerName);
_logger.level = _loggerLevel;
_logger.onRecord.listen((event) {
print(event);
});
this._pollingInterval = pollingInterval ?? Duration(seconds: 1);
}