Contact us
tel:15797766463
mail:business@seeshiontech.com
Update time : 2019-10-16 16:07:55
Create an instance of SXTemplate by calling its contructor, pass template package folder path and SXTemplateUsage::SXTemplateUsageRender as arguments.
Pass user asset files to SXTemplate instance by calling its setReplaceableFilePaths method.
Create an instance of SXTemplateRender by calling its constructor initWithTemplate, and passing your SXTemplate instance as an argument, you can also set a audio file as background audio by passing its file path as second argument.
Call commit method of your SXTemaplate instance.
(Optional) You can accesss assets and layers by their UI Keys.
(Optional) Set the outputPath property for the SXTemplateRender instance. The output file path must be a absolute file path that ends with .mp4 extension.
Set the delegate property for the SXTemplateRender instance.
Call the start method of your SXTemplateRender instance to start rendering.
After rendering finished, set your SXTemplateRender instance and SXTemplate instance to nil to free memory.
SXTemplate *sxTemplate = [[SXTemplate alloc] init:@\"Your template path\" type:SXTemplateUsageRender];
[sxTemplate setReplaceableFilePaths:@[@\"asset path\"]];
SXTemplateRender *render = [[SXTemplateRender alloc] initWithTemplate:sxTemplate audioPath:@\"audio path\"];
render.delegate = self;
[sxTemplate commit];
[render start];
SXTemplate instance with SXTemplateUsageRender type. setReplaceableFilePaths method, you need to pass local file paths