static FTCMediaXBase get instance
Future<void> setLicense(String url, String key, FTCMediaLicenseListener listener) async
Parameter Name | Type | Description |
url | String | License url. |
key | String | License key. |
callback | ILicenseCallback | Callback |
typedef FTCMediaLicenseListener = void Function(int errCode, String msg);
Error Code | Description |
0 | Success: Succeeded |
-1 | The input parameter is invalid, such as an empty URL or KEY. |
-3 | Download failed. Check the network settings. |
-4 | The TE authorization information read locally is empty, which might be caused by an I/O failure. |
-5 | Reading VCUBE TEMP License file content is empty, might be caused by I/O failure. |
-6 | The JSON field in the v_cube.license file is incorrect. Contact the Tencent Cloud team to fix it. |
-7 | Signature verification failed. Contact the Tencent Cloud team to fix it. |
-8 | Decryption failed. Contact the Tencent Cloud team to fix it. |
-9 | The JSON field in the TELicense field is incorrect. Contact the Tencent Cloud team to fix it. |
-10 | The TE authorization information from network resolution is empty. Contact the Tencent Cloud team to fix it. |
-11 | Failed to write TE authorization info to the local file, which might be caused by an I/O failure. |
-12 | Download failed. Failed to parse the local asset. |
-13 | Authentication failure. Please check whether the so file is in the package or the so path is correctly set. |
3004/3005 | Invalid authorization. Contact the Tencent Cloud team to fix it. |
3015 | Bundle Id / Package Name mismatch. Check whether the Bundle Id / Package Name used by your App matches the applied one, and verify the correct license file is used. |
3018 | The authorization file has expired. Apply for renewal with Tencent Cloud. |
Others | Contact the Tencent Cloud team to fix it. |
Future<void> setLogEnable(bool enable) async
FTCEffectAnimView gift animation playback instance.FTCEffectAnimView({this.controllerCallback, Key? viewKey})
Parameter Name | Type | Description |
controllerCallback | FEffectViewControllerCallback | The playback controller for the current gift animation was successfully created. |
Future<int> startPlay(String playUrl) async
Future<void> setVideoMode(FVideoMode videoMode) async
Enumeration Value | Description |
FVideoMode.VIDEO_MODE_NONE | Ordinary mp4 file |
FVideoMode.EVIDEO_MODE_SPLIT_HORIZONTAL | left-right alignment (alpha left, rgb right) |
FVideoMode.VIDEO_MODE_SPLIT_VERTICAL | top-bottom alignment (alpha top, rgb bottom) |
FVideoMode.VIDEO_MODE_SPLIT_HORIZONTAL_REVERSE | left-right alignment (rgb left, alpha right) |
FVideoMode.VIDEO_MODE_SPLIT_VERTICAL_REVERSE | top-bottom alignment (rgb top, alpha bottom) |
Future<void> setConfig(FTCEffectConfig config) async
Future<void> setScaleType(FScaleType type) async
Enumeration Value | Description |
FScaleType.FIT_XY | Fully fill the entire layout with default values. |
FScaleType.FIT_CENTER | Display the video in the middle of the layout at its original ratio. |
FScaleType.CENTER_CROP | Fill the layout completely according to the video ratio (excess part not shown). |
void setFetchResource(FResourceFetcher resFetcher)
class FResourceFetcher {get imageFResImgResultFetcher? imgFetcher;get textFResTextResultFetcher? textFetcher;// Resource release notificationFResReleaseListener? releaseListener;FResourceFetcher({this.imgFetcher, this.textFetcher, this.releaseListener});}
Future<void> requestUpdateResource() async
Future<void> setRenderRotation(int rotation) async
Future<bool> isPlaying() async
Future<void> resume() async
Future<void> pause() async
Future<void> seekTo(int millSec) async
Future<void> seekProgress(double progress) async
Future<void> setLoop(bool isLoop) async
Future<void> setLoopCount(int loopCount) async
Future<void> setDuration(int durationInMilliSec) async
Future<void> stopPlay({bool? clearLastFrame}) async
Future<void> setMute(bool mute)
void setPlayListener(FAnimPlayListener? listener)
class FAnimPlayListener {FEmptyFunction? onPlayStart;FEmptyFunction? onPlayEnd;FIntParamsFunction? onPlayError;FOnPlayEventFunction? onPlayEvent;FAnimPlayListener({this.onPlayStart, this.onPlayEnd, this.onPlayError, this.onPlayEvent});}
static static int REPORT_INFO_ON_PLAY_EVT_PLAY_END = 2006;static static int REPORT_INFO_ON_PLAY_EVT_RCV_FIRST_I_FRAME = 2003;static static int REPORT_INFO_ON_PLAY_EVT_CHANGE_RESOLUTION = 2009;static static int REPORT_INFO_ON_PLAY_EVT_LOOP_ONCE_COMPLETE = 6001;static static int REPORT_INFO_ON_VIDEO_CONFIG_READY = 200001;static static int REPORT_INFO_ON_NEED_SURFACE = 200002;static static int REPORT_INFO_ON_VIDEO_SIZE_CHANGE = 200003;static static int REPORT_ANIM_INFO = 200004;
static const REPORT_ERROR_TYPE_HEVC_NOT_SUPPORT = -10007; // HEVC NOT supportedstatic const REPORT_ERROR_TYPE_INVALID_PARAM = -10008; // invalid parameterstatic const REPORT_ERROR_TYPE_INVALID_LICENSE = -10009; // INVALID LICENSEstatic const REPORT_ERROR_TYPE_ADVANCE_MEDIA_PLAYER = -10010; // MediaPlayer playback failurestatic const REPORT_ERROR_TYPE_MC_DECODER = -10011; // MediaCodec Decoder failurestatic const REPORT_ERROR_TYPE_UNKNOWN_ERROR = -20000; // unknown error
Future<FTCEffectAnimInfo> getTCAnimInfo() async
// Set CodecTypeFCodecType? codecType;
// Set freeze frame indexFFreezeFrame? freezeFrame;
// Set the animation format to playFAnimType? animType;
Attribute Name | Type | Description |
type | int | Current animation type: FAnimType.MP4 (MP4 resources) and FAnimType.TCMP4 (TCMP4 resources). |
duration | long | Animation duration: milliseconds. |
width | int | Animation width. |
height | int | Animation height. |
encryptLevel | int | The current animation's advanced encryption type. If the value is 0, it means no advanced encryption. Otherwise, it indicates advanced encryption. |
mixInfo | FMixInfo | Fusion animation info. When null, it means the animation has no fusion info. |
Attribute Name | Type | Description |
textMixItemList | List<FMixItem> | Text fusion info. When null, it means no text fusion info. |
imageMixItemList | List<FMixItem> | Image fusion info. When null, it means no image fusion info. |
Attribute Name | Type | Description |
id | String | Current fusion animation id. |
tag | String | Current fusion animation tag. |
text | String | Current text content of the fusion animation (empty for image fusion animations). If it is tcmp4, the value is its internal original text content; if it is mp4, the value is the tag filled in the tool. |
Attribute Name | Type | Description |
text | String | Finally replace the displayed text content. |
color | int | Text color, format requirement: ARGB, such as 0xFFFFFFFF. |
fontStyle | String | Text display style, valid values: "bold" means bold text, default size if not specified. |
alignment | int | Text alignment mode, valid values: TEXT_ALIGNMENT_NONE (default value, keep SDK default alignment), TEXT_ALIGNMENT_LEFT (left), TEXT_ALIGNMENT_CENTER (center), TEXT_ALIGNMENT_RIGHT (right). |
fontSize | double | Text size, unit is px; if text size is set (value larger than 0), the internal auto scale policy will be disabled and the set text size will be forcibly applied, which may cause oversized text not fully displayed. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback