startDownloadMessageVideoForComposition(params: Object)

Requires:
IPCKit≥6.3.1@ray-js/ray≥1.7.30
Platforms:
iOSAndroid
import { ipc } from '@ray-js/ray';

const { startDownloadMessageVideoForComposition } = ipc;

// Promise usage
try {
  const res = await startDownloadMessageVideoForComposition({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Video download; if there are multiple video files, they will be merged into a single video file

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesDevice ID
fileInfostringYesFile information, JSON string {"fileInfo":[ { "fileUrl": "xxx1", "key": "media key 1" }, { "fileUrl": "xxx2", "key": "media key 2" }, { "fileUrl": "xxx3", "key": "media key 3" }] }
savePathnumberYesSave path: 0 (default) — save to the phone gallery; 1 — save to the App gallery; 2 — save to both the phone gallery and the App gallery
NoConfiguration options for video processing
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionIPCKit Since
pathstringSave path after cloud storage download completes-
thingfilePathstringfile thingfilePathv6.7.1
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { ipc } from '@ray-js/ray'

ipc.startDownloadMessageVideoForComposition({
  deviceId: "xx",
  fileInfo: JSON.stringify({
    fileInfo: [
      { fileUrl: "xxx1", key: "media key 1" },
      { fileUrl: "xxx2", key: "media key 2" },
    ],
  }),
  savePath: 1,
  option: {
    targetWidth: 1280,
    targetHeight: 720,
    useFirstVideoResolution: true,
    rotation: 0,
  },
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});