cameraRatio method

  1. @deprecated
Future<double> cameraRatio ()

获取摄像头分辨率

Implementation

@deprecated
Future<double> cameraRatio() async {
  try {
    RtmpResponse res = RtmpResponse.fromData(
        await _configChannel.invokeMethod("cameraRatio", {}));
    if (res.isOk) {
      String ratio = res.oridata['ratio'];
      double width = double.parse(ratio.split("*")[1]);
      double height = double.parse(ratio.split("*")[0]);
      return width / height;
    } else {
      return null;
    }
  } catch (Exception) {
    return null;
  }
}