DiveRTMPServices.standard constructor

DiveRTMPServices.standard({
  1. bool commonNamesOnly = true,
})

When commonNamesOnly is true (default) it collects only the common services, and when false it collects all services.

Implementation

factory DiveRTMPServices.standard({bool commonNamesOnly = true}) {
  final services = <DiveRTMPService>[];
  final serviceNames = obslib.streamOutputGetServiceNames(commonNamesOnly: commonNamesOnly);
  for (final serviceName in serviceNames) {
    final rtmpServers = <DiveRTMPServer>[];
    final servers = obslib.streamOutputGetServiceServers(serviceName: serviceName);
    for (var server in servers.keys) {
      final url = servers[server];
      if (url != null) {
        rtmpServers.add(DiveRTMPServer(name: server, url: url));
      }
    }
    services.add(DiveRTMPService(name: serviceName, servers: rtmpServers));
  }

  return DiveRTMPServices(services);
}