processPetForegroundMediaByTemplate

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);
}

Method signature
processPetForegroundMediaByTemplate(params: )

Description

Compose pet foreground media based on a template

Parameters

PropertyTypeRequiredDescription
YesTemplate object
mediaSourcestringYesInput media data source
NoOutput configuration
extendParamRecord<string, any>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
extDataRecord<string, any>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: {},
  mediaSource: "xx",
  outputConfig: {},
  extendParam: {},
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});