startStream method

Future<bool> startStream({
  1. required VideoResolution resolution,
})

Implementation

Future<bool> startStream({required VideoResolution resolution}) async {
  resolution = resolution ?? this.resolution;
  int index = resolution.index;
  if (resolution == VideoResolution.superHD) {
    index = 100;
  }

  bool ret = await writeCgi("livestream.cgi?streamid=10&substream=$index&");
  print("startStream ret${ret}");
  if (ret == true) {
    waitCommandResult((cmd, data) {
      return cmd == 24631;
    }, 3)
        .then((result) {
      ret = result?.isSuccess ?? false;
    });
    this.resolution = resolution;
  } else {}
  return ret;
}