setMotionTmpl method

Future<void> setMotionTmpl(
  1. String? fullPath
)

选择使用哪一款 AI 动效挂件 ,该接口仅在 企业版 SDK 中生效

有些挂件本身会有声音特效,通过此 API 可以关闭这些特效播放时所带的声音效果。

参数:fullPath 特效文件夹的全路径。

tmplPath

Implementation

Future<void> setMotionTmpl(String? fullPath) async {
  if (Platform.isIOS) {
    if (fullPath == null || fullPath.isEmpty) {
      return _channel.invokeMethod(
          'setMotionTmpl', {"tmplPath": null, "tmplName": null});
    }
    if (fullPath.endsWith("/")) {
      fullPath = fullPath.substring(0, fullPath.length - 1);
    }
    String tmplName = fullPath.substring(fullPath.lastIndexOf("/") + 1);
    String tmplPath =
        fullPath.substring(0, fullPath.length - tmplName.length);
    return _channel.invokeMethod(
        'setMotionTmpl', {"tmplPath": tmplPath, "tmplName": tmplName});
  }
  return _channel.invokeMethod('setMotionTmpl', {"tmplPath": fullPath});
}