Skip to content

合成实况

方法名

combiner

用法

  • 用法如下:
    js
    module.combiner({
      params: {
        saveDir: "/storage/emulated/0/levenLivePhoto/combiner",
        imagePath: this.imagePath,
        videoPath: this.videoPath
      },
      complete: (res) => {
        console.log(res)
        if (res.code == 0) {
          let data = res.data;
          let message = "合成结果:" + data.path;
          console.log(message)
          this.logs = message + "\n" + this.logs
        }
      }
    })
    js
    module.combiner({
      params: {
        saveDir: "/storage/emulated/0/levenLivePhoto/combiner",
        imagePath: imagePath.value,
        videoPath: videoPath.value
      },
      complete: (res : LevenResult) => {
        console.log(res)
        if (res.code == 0) {
          let data = res.data;
          let message = "合成结果:" + data.getString("path")!;
          logs.value = message + "\n" + logs.value
        }
      }
    } as LevenOptions)
  • 参数说明
    参数名参数类型是否必填默认值参数描述
    paramsObject接口请求参数
    params.saveDirString合成后保存的目录
    params.saveNameString保存的文件名,需以.jpg作为扩展名
    params.imagePathString图片文件路径,需选择jpg文件
    params.videoPathString视频文件路径,安卓平台请选择mp4文件
    successFunction执行成功的函数
    failFunction执行失败的函数
    completeFunction执行完成的函数,不管成功还是失败都会执行

回调

  • 示例
    json
    {
        "data": {
            "path": "/storage/emulated/0/levenLivePhoto/combiner/1786805307462MP.jpg"
        },
        "message": "",
        "code": 0
    }
  • 回调说明:
    参数名参数类型参数描述
    messageString消息提示
    dataObject数据对象
    data.pathString合成后的文件路径
    codeInteger返回类型,0.成功,其他:失败