processPetForegroundMediaByTemplate(params: Object)

Requires:
AIKit≥1.4.3@ray-js/ray≥1.7.27
Platforms:
iOSAndroid
import { ai } from '@ray-js/ray';

const { processPetForegroundMediaByTemplate } = ai;

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

Description

Compose pet foreground media based on a template

Parameters

PropertyTypeRequiredDescription
YesTemplate object
mediaSourcestringYesInput media data source
NoOutput configuration
NoExtended parameters
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
PropertyTypeDescription
outputPathstringPath of the output foreground media
Extension data
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

ai.processPetForegroundMediaByTemplate({
  templateObject: {
    type: "xx",
    effect: {
      code: "xx",
      name: "xx",
      ouputDuration: 3000,
      outputDuration: 3000,
      image: "xx",
      resource: "xx",
    },
  },
  mediaSource: "xx",
  outputConfig: {},
  extendParam: {},
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});