JanusClient constructor Null safety

JanusClient(
  1. {required JanusTransport transport,
  2. List<RTCIceServer>? iceServers,
  3. int refreshInterval = 50,
  4. String? apiSecret,
  5. bool isUnifiedPlan = true,
  6. String? token,
  7. bool? stringIds = false,
  8. @Deprecated('set this option to true if you using legacy janus plugins with no unified-plan support only.') bool usePlanB = false,
  9. Duration? pollingInterval,
  10. dynamic loggerName = "JanusClient",
  11. dynamic maxEvent = 10,
  12. dynamic loggerLevel = Level.ALL,
  13. 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,
    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);
}