tencent cloud

User Generated Short Video SDK

Android

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-05-11 17:46:56

Feature Overview

Template Editing enables one-tap video creation. Through the template editing interface, pre-made templates can be loaded, and users can add videos or images to achieve beat-synced music and stunning transition effects.

Related Interface Classes

Interface Class Name
Description
TAVEditor
SDK operation entry class.
TAVTemplateConfig
Template configuration class.

Interface Method Summary

Method
Parameters
Return Value
Description
setTemplateDir(String path)
path: absolute path to the template directory.
int
0: Success
-1: Invalid path
-2: Invalid authorization
Set the template working directory.
getTemplateDir()
-
String
Get the current template directory.
getTemplateConfig(String templatePath)
templatePath: template path.
TAVTemplateConfig
Get the template configuration information.

Template Editing Methods

Set Template Path

/**
* Set template path
*
* @param path Absolute path to the template directory
* @return Operation result code:
* 0: Success
* -1: Invalid path
* -2: Invalid authorization
*/
int setTemplateDir(String path);

Get Template Path

/**
* Get the currently set template path
*
* @return Absolute path to the template directory
*/
String getTemplateDir();

Get Template Configuration

/**
* Get template slot information
*
* @param templatePath Template path
* @return Template configuration object containing slot information
*/
TAVTemplateConfig getTemplateConfig(String templatePath);

TAVTemplateConfig Structure Description

TAVTemplateConfig class contains the following key information:
Slot list: positions of replaceable elements in the template.
Video track configuration: parameters of the main video track.
Audio track configuration: parameters of the background audio track.
Effect configuration: built-in effect parameters.

Usage Example

// Set template path
int result = editor.setTemplateDir("/sdcard/templates/project1");
if (result == 0) {
// Get template path
String templateDir = editor.getTemplateDir();
// Get template configuration
TAVTemplateConfig config = editor.getTemplateConfig(templateDir);
// Use configuration info
List<TAVTemplateSlot> slots = config.getSlots();
for (TAVTemplateSlot slot : slots) {
// Process each slot
}
} else {
// Handle error
switch (result) {
case -1:
Log.e("Template", "Invalid template path");
break;
case -2:
Log.e("Template", "Invalid template authorization");
break;
}
}

Error Handling Guide

Error Code
Meaning
Solution
-1
Invalid path
Check whether the path exists and has read permission.
-2
Invalid authorization
Check whether the template authorization file is valid.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック