externalMedia method

Future<Channel> externalMedia(
  1. dynamic callback(
    1. bool,
    2. Channel
    ), {
  2. required String app,
  3. dynamic variables,
  4. required dynamic external_host,
  5. String? encapsulation,
  6. String? transport,
  7. String? connection_type,
  8. required String format,
  9. String? direction,
})

Implementation

Future<Channel> externalMedia(
  Function(bool, Channel) callback, {
  required String app, //: string;
  dynamic variables, //?: Containers;
  required external_host, //: string;
  String? encapsulation, //?: string;
  String? transport, //?: string;
  String? connection_type, //?: string;
  required String format, //: string;
  String? direction, //?: string;
}) async {
  var resp = await ChannelsApi.externalMedia(
      app: app,
      variables: variables,
      external_host: external_host,
      encapsulation: encapsulation,
      transport: transport,
      connection_type: connection_type,
      format: format,
      direction: direction);

  //print(resp.resp);

  var channelJson = resp.resp;

  Channel channel = Channel.fromJson(jsonDecode(channelJson));

  statisChannels[channel.id] = channel;
  return channel;

  // resp.then((value) {
  //   if (value.statusCode == 200 || value.statusCode == 204)
  //     callback(false, this);
  //   else
  //     callback(true, this);
  // });
}