initCVResource method

Future<int?> initCVResource(
  1. string licenseFile,
  2. string algoModelDir
)

@detail api @author zhushufan.ref @brief Checks video effect license, sets the video effect resource model path, and initializes video effect. @param licenseFile The absolute path of the license file for authorization. @param algoModelDir The absolute path of the Effects SDK's models file. @return - 0: Success. - –1000: The Effects SDK is not integrated. - –1002: Your Effects SDK's version is incompatible. - < 0: Other error. See error code table for specific instructions. @note When validating the license, the difference of the timestamp of the CV server and the timestamp of the client is checked. You must not change the time of the client.

Implementation

Future<int?> initCVResource(string licenseFile, string algoModelDir) async {
  $a() => ($instance as $p_a.IVideoEffect)
      .initCVResource(licenseFile, algoModelDir);
  $i() => ($instance as $p_i.ByteRTCVideoEffect)
      .initCVResource(licenseFile, algoModelDir);

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}