API | Description |
Set the log listener. | |
getSdkVersion | Get the current SDK version number. |
API | Description |
Instance initialization method. | |
Class initialization method. | |
deinit | Release the instance. |
Create a copy of the instance. |
API | Description |
Append a video resource to the end and return the index after successful addition. | |
Insert an array of video resources at a specified position. | |
Append an image resource to the end; passing kCMTimeZero for duration defaults to 3 seconds. | |
Insert an array of image resources at a specified position; passing @(0) in durations defaults to 3 seconds. | |
Get the number of resources currently being edited. | |
Get the list of currently used resource information. | |
Remove the video or image resource at the specified position. | |
Delete all resource (video/image/template) clips. | |
Clear all resources (video & BGM) and all effects. | |
Modify the playback time range of a specified resource. | |
Modify the playback rate of a specified resource (0, 3]. | |
Adjust resource position and return whether the adjustment was successful. | |
Call this API to synchronously regenerate playback resources after changing resources/BGM. | |
Call this API to synchronously regenerate playback resources after changing resources/BGM, and execute a callback upon completion. | |
Time-consuming operation: generate player resources. | |
Bind the generated player resources to the player and execute a callback upon completion. | |
Set the background volume of a specified resource (0-1f). | |
Set the background volume of all resources (0-1f). | |
Get the volume of the resource at the specified index. | |
Set whether the video is played in reverse. | |
Set the rotation angle of all resources (clockwise, 0-360°). | |
Set the rotation angle of the video at the specified index (clockwise, 0-360°). | |
Set the transform for all resources. | |
Set the transform for a specified resource. | |
Set the size of all resources. | |
Set the size of a specified resource. | |
Set the crop info for a specified resource. |
API | Description |
Add BGM. Use startAtVideoTime to set when BGM starts playing on the timeline; use timeRange to clip the music material's playback range. Returns the unique ID of the BGM material. | |
Delete a BGM by the unique ID generated when the BGM was added. | |
Delete all BGM. | |
Adjust the playback start position of the BGM with the specified ID in the video. | |
Set the playback range of the BGM with the specified ID, used to clip the music material. | |
Set the playback volume of the BGM with the specified ID (0-1f). | |
Set additional custom information for the BGM with the specified ID. | |
Get the additional custom information of the BGM with the specified ID. | |
Set the playback volume of all BGMs (0-1f). | |
Get the volume of the BGM with the specified ID. | |
Adjust the playback speed of the BGM with the specified ID (1 is normal speed). | |
Get the playback speed of the BGM with the specified ID. | |
Get the list of all currently used BGM information. |
API | Description |
Initialize the preview player. Requires a parameter (TAVPreviewParam) containing the parent container and rendering mode. | |
Set whether to loop playback. | |
Get whether loop playback is currently enabled. | |
Start playback. | |
Start playback from a specified time (CMTime). | |
Pause playback. | |
Stop playback. | |
Refresh the preview player. | |
Seek to a specified time (CMTime) for playback. | |
Seek to a specified time for playback and execute a callback after seek completes. | |
Release the player. | |
Get the total preview duration (requires calling flushImmediately after adding resources for an accurate value). | |
Main track total duration (can be obtained immediately after adding resources). | |
Returns whether the player is currently playing. | |
Get the current playback time (NSTimeInterval). | |
Get the current playback time (CMTime). | |
Get the current player fill mode. | |
Unregister the playback state listener. | |
Set the current rendering size (CGSize). | |
Get the current rendering size. | |
Get the complete AVAsset resource of the current player. | |
Get the complete AVVideoComposition of the current player. |
API | Description |
Add a filter effect. Specify the filter material via lutPath, set the filter strength and effective time range (timeRange). Returns the unique ID generated when the filter was created. | |
Adjust the strength and effective time range (timeRange) of the filter with the specified ID. | |
Delete a filter by the unique ID generated when the filter was created. | |
Delete all filter effects. | |
Save the track index of the filter with the specified ID. | |
Get the list of all currently configured filter effect information. |
API | Description |
Add an effect. Specify the effect material path via path, and set the corresponding time range (timeRange) for the effect. Returns the unique ID generated when the effect was created. | |
Update the playback time range (timeRange) of the effect with the specified ID. | |
Delete an effect by the unique ID generated when the effect was created. | |
Delete all effects. | |
Save the track index of the effect with the specified ID (for business use). | |
Get the list of all currently configured effect information. |
API | Description |
Generate and export the video. Uses a full export configuration (TAVEditorGenerateConfig); if nil is passed, default settings are used (preview resolution, 30fps, 8Mbps bitrate). Provides progress and completion callbacks. | |
Generate and export the video by specifying a preset export resolution (TAVVideoCompressed); provides progress and completion callbacks. | |
Quickly generate and export the video using a full export configuration (TAVEditorGenerateConfig); provides progress and completion callbacks. | |
Quickly generate and export the video by specifying a preset export resolution (TAVVideoCompressed); provides progress and completion callbacks. | |
Cancel the current video generation task and execute a callback after cancellation. | |
Pause the current video export process. | |
Resume the paused video export process. |
API | Description |
Get the slot information (TAVTemplateConfig) of the video template at the specified path (templatePath). | |
Apply the video template at the specified path (templatePath). Returns TAVTemplateCode, where 0 means success, -1 means invalid path, -2 means no permission. |
API | Description |
getPipManager | |
getStickerManager | |
getVideoFrameManager | |
getDraftManager |
Parameter Name | Type | Description |
logLevel | TAVLogLevel | The log level to set. |
listener | Log listener for receiving logs output by the SDK. If nil is passed, the current listener will be removed. |
void-(instancetype)initWithRenderSize:(CGSize)renderSize assetsPath:(NSString *)assetsPath;Parameter Name | Type | Description |
renderSize | CGSize | Rendering size for the canvas, scaled by aspect ratio. Pass CGSizeZero to automatically adapt the rendering size. |
assetsPath | NSString * | Model resource path. |
instancetype / (TAVEditor *)+(instancetype)editorWithRenderSize:(CGSize)renderSize assetsPath:(NSString *)assetsPath;Parameter Name | Type | Description |
renderSize | CGSize | Rendering size for the canvas, scaled by aspect ratio. Pass CGSizeZero to automatically adapt the rendering size. |
assetsPath | NSString * | Model resource path. |
instancetype-(instancetype)fork;instancetype-(int)addVideoClip:(NSString *)path;Parameter Name | Type | Description |
path | NSString * | Local path of the video material. |
int-(int)addVideoClips:(NSArray *)paths index:(int)index;Parameter Name | Type | Description |
paths | NSArray * | Array of video resource paths. |
index | int | The position (index) at which to insert the resources. |
int-(int)addImageClip:(NSString *)path duration:(CMTime)duration;Parameter Name | Type | Description |
path | NSString * | Local path of the image resource. |
duration | CMTime | Display duration of the image on the timeline. If kCMTimeZero is passed, the default duration (typically 3 seconds) is used. |
int-(int)addImageClips:(NSArray<NSString *> *)paths index:(int)index durations:(NSArray<NSNumber *> *)durations;Parameter Name | Type | Description |
paths | NSArray<NSString *> * | Array of image resource paths. |
index | int | The position (index) at which to insert the resources. |
durations | NSArray<NSNumber *> * | Array of display durations for each image, in seconds. If @0 is passed, the default duration (typically 3 seconds) is used. |
int-(int)getClipCount;int-(NSArray<TAVClipInfo *> *)getClipInfos;NSArray<TAVClipInfo *> *-(void)removeClip:(int)index;Parameter Name | Type | Description |
index | int | The index of the resource clip to remove. |
void-(void)removeAllClip;void-(void)clearAll;void-(void)setClipRange:(CMTimeRange)timeRange index:(int)index;Parameter Name | Type | Description |
timeRange | CMTimeRange | The new playback range for the resource, defining the start time and duration on the timeline. |
index | int | The index of the resource clip to modify. |
void-(void)setClipSpeed:(CGFloat)speed index:(int)index;Parameter Name | Type | Description |
speed | CGFloat | The playback rate to set. Valid range is (0, 3]. |
index | int | The index of the resource clip to modify. |
void-(BOOL)updateClipIndex:(int)oldIndex toIndex:(int)newIndex;Parameter Name | Type | Description |
oldIndex | int | The index of the resource clip before adjustment. |
newIndex | int | The new position index after adjustment. |
BOOL-(void)flushImmediately;voidcompletion block.-(void)flushImmediatelyCompletion:(void (^)(BOOL finished))completion;Parameter Name | Type | Description |
completion | void (^)(BOOL finished) | Callback block executed after resource update is complete. finished indicates whether the operation completed successfully. |
voidAVPlayerItem。-(AVPlayerItem *)preparePlayerItem;AVPlayerItem *AVPlayerItem to the player and restore playback state.-(void)bindPlayerItem:(AVPlayerItem *)playerItem completion:(void (^)(BOOL finished))completion;Parameter Name | Type | Description |
playerItem | AVPlayerItem * | |
completion | void (^)(BOOL finished) | Callback block executed after binding and state restoration are complete. |
void-(void)setClipVolume:(float)volume index:(int)index;Parameter Name | Type | Description |
volume | float | The volume value to set, range [0.0, 1.0]. |
index | int | The index of the resource clip whose volume is to be modified. |
void-(void)setAllClipsVolume:(float)volume;Parameter Name | Type | Description |
volume | float | The volume value to set, range [0.0, 1.0]. |
void-(float)getClipVolume:(int)index;Parameter Name | Type | Description |
index | int | The index of the resource clip whose volume is to be queried. |
float-(void)setReverse:(BOOL)isReverse;Parameter Name | Type | Description |
isReverse | BOOL | Set to YES for reverse playback, NO for normal playback. |
void-(void)setClipsRotation:(int)rotation;Parameter Name | Type | Description |
rotation | int | Clockwise rotation angle, range (0, 360] degrees. |
void-(void)setClipRotation:(int)rotation index:(int)index;Parameter Name | Type | Description |
rotation | int | Clockwise rotation angle, range (0, 360] degrees. |
index | int | The index of the resource clip whose rotation is to be modified. |
void-(void)setClipTransform:(CGAffineTransform)transform;Parameter Name | Type | Description |
transform | CGAffineTransform | The affine transform matrix to apply. |
void-(void)setClipTransform:(CGAffineTransform)transform index:(int)index;Parameter Name | Type | Description |
transform | CGAffineTransform | The affine transform matrix to apply. |
index | int | The index of the resource clip whose transform is to be modified. |
void-(void)setClipSize:(CGSize)size;Parameter Name | Type | Description |
size | CGSize | The display size to set. |
void-(void)setClipSize:(CGSize)size index:(int)index;Parameter Name | Type | Description |
size | CGSize | The display size to set. |
index | int | The index of the resource clip whose size is to be modified. |
void-(void)setCropInfo:(TAVMediaAssetCropInfo *)cropInfo index:(int)index;Parameter Name | Type | Description |
cropInfo | TAVMediaAssetCropInfo * | Struct containing the crop region and mode information. |
index | int | The index of the resource clip whose crop info is to be set. |
void-(int)addBgm:(NSString *)bgmPath startAtVideoTime:(CMTime)startAtVideoTime timeRange:(CMTimeRange)timeRange;Parameter Name | Type | Description |
bgmPath | NSString * | File path of the music material. |
startAtVideoTime | CMTime | The time point at which BGM starts playing on the main timeline (default is 0). For example, if the main track is a 10-second video and you want BGM to start at the 5th second, pass the CMTime corresponding to 5 seconds as CMTime。 |
timeRange | CMTimeRange | Clip range of the music material (default is the entire song). For example, if a song is 0-90 seconds long, set timeRange to clip any segment within 0-90 seconds. |
int-(BOOL)removeBgm:(int)bgmId;Parameter Name | Type | Description |
bgmId | int | The unique ID generated when the BGM was added. |
BOOL-(void)removeAllBgm;void-(void)updateBgm:(int)bgmId atVideoTime:(CMTime)startAtVideoTime;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM to modify. |
startAtVideoTime | CMTime | The new start time for BGM on the main timeline. |
void-(void)updateBgm:(int)bgmId playRange:(CMTimeRange)timeRange;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM to modify. |
timeRange | CMTimeRange | The new clip range of the music material. |
void-(void)setBgm:(int)bgmId volume:(float)volume;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM whose volume is to be modified. |
volume | float | The volume value to set, range [0.0, 1.0]. |
void-(void)setBgm:(int)bgmId extraInfo:(NSDictionary *)extraInfo;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM for which to set additional info. |
extraInfo | NSDictionary * | Custom additional information dictionary to save. |
void-(NSDictionary *)getBgmExtraInfo:(int)bgmId;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM whose additional info is to be retrieved. |
NSDictionary *-(void)setAllBgmVolume:(float)volume;Parameter Name | Type | Description |
volume | float | The volume value to set, range [0.0, 1.0]. |
void-(float)getBgmVolume:(int)bgmId;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM whose volume is to be queried. |
float-(void)setBgm:(int)bgmId speed:(float)speed;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM whose speed is to be modified. |
speed | float | Playback speed. 1.0 is normal speed, greater than 1.0 is fast-forward, less than 1.0 is slow motion. |
void-(float)getBgmSpeed:(int)bgmId;Parameter Name | Type | Description |
bgmId | int | The unique ID of the BGM whose speed is to be queried. |
float-(NSArray<TAVBgmInfo *> *)getBgmInfos;NSArray<TAVBgmInfo *> *-(void)setPreview:(TAVPreviewParam *)param;Parameter Name | Type | Description |
param | TAVPreviewParam * | Object containing parameters such as the parent container view and rendering mode. |
void-(void)setPlayLoop:(BOOL)isLoop;Parameter Name | Type | Description |
isLoop | BOOL | YES indicates loop playback is enabled,NO indicates single playback. |
void-(BOOL)isPlayLoop;BOOL-(void)play;void-(void)playAtTime:(CMTime)time;Parameter Name | Type | Description |
time | CMTime | The specified start playback time. |
void-(void)pause;void-(void)stop;void-(void)refresh;void-(void)seekToTime:(CMTime)seekTime;Parameter Name | Type | Description |
seekTime | CMTime | The specified seek time. |
void-(void)seekToTime:(CMTime)seekTime completion:(void (^)(BOOL finished))completion;Parameter Name | Type | Description |
seekTime | CMTime | The specified seek time. |
completion | void (^)(BOOL finished) | Callback block when seek completes. finished indicates whether the operation completed successfully. |
void-(void)destoryPlayer;voidflushImmediately first to get an accurate duration.-(CMTime)getTotalDuration;CMTime-(NSTimeInterval)duration;NSTimeInterval-(BOOL)isPlaying;BOOL-(NSTimeInterval)currentTime;NSTimeIntervalCMTime struct).-(CMTime)currentCMTime;CMTime-(void)setPlayerViewFillMode:(TAVPlayerFillMode)fillMode;Parameter Name | Type | Description |
fillMode | The preview fill mode enum to set. |
void-(TAVPlayerFillMode)playerViewFillMode;TAVPlayerFillMode-(void)registerPlayerObserver:(id<TAVEditorPlayerObserver>)observer;Parameter Name | Type | Description |
observer | id<TAVEditorPlayerObserver> |
void-(void)resignObserver:(id<TAVEditorPlayerObserver>)observer;Parameter Name | Type | Description |
observer | id<TAVEditorPlayerObserver> | The listener object to unregister. |
void-(void)setRenderSize:(CGSize)renderSize;Parameter Name | Type | Description |
renderSize | CGSize | The rendering size (width and height) to set. |
void-(CGSize)getRenderSize;CGSizeAVAsset object used by the current player, which contains all track resource information.-(AVAsset *)currentAVAsset;AVAsset *AVAsset。AVVideoComposition object generated from the current editing state, which describes how video tracks are composed and rendered (including filters, transforms, etc.).-(AVVideoComposition *)currentComposition;AVVideoComposition *-(int)addFilter:(NSString *)lutPath strength:(float)strength timeRange:(CMTimeRange)timeRange;Parameter Name | Type | Description |
lutPath | NSString * | Path to the filter material file, typically a LUT file path. |
strength | float | Filter strength, typically in the range [0.0, 1.0]. |
timeRange | CMTimeRange | The time range on the timeline where the filter effect is active. |
int-(void)setFilter:(int)lutId Strength:(float)strength timeRange:(CMTimeRange)timeRange;Parameter Name | Type | Description |
lutId | int | The unique ID generated when the filter was created. |
strength | float | The new filter strength. |
timeRange | CMTimeRange | The new effective time range for the filter. |
void-(void)removeFilter:(int)lutId;Parameter Name | Type | Description |
lutId | int | The unique ID of the filter to delete. |
void-(void)removeAllFilter;void-(void)setFilter:(int)lutId trackIndex:(int)trackIndex;Parameter Name | Type | Description |
lutId | int | The unique ID of the filter. |
trackIndex | int | The track index to which the filter is applied. |
void-(NSArray<TAVFilterInfo *> *)getFilterInfos;NSArray<TAVFilterInfo *> *-(int)addMotionEffect:(NSString *)path timeRange:(CMTimeRange)timeRange;Parameter Name | Type | Description |
path | NSString * | File path of the effect material. |
timeRange | CMTimeRange | The corresponding time range on the timeline where the effect is active. |
int-(void)updateMotionEffect:(int)effectId playRange:(CMTimeRange)timeRange;Parameter Name | Type | Description |
effectId | int | The unique ID of the effect to update. |
timeRange | CMTimeRange | The new display range for the effect. |
void-(void)removeMotionEffect:(int)effectId;Parameter Name | Type | Description |
effectId | int | The unique ID of the effect to delete. |
void-(void)removeAllMotionEffect;void-(void)setMotionEffect:(int)effectId trackIndex:(int)trackIndex;Parameter Name | Type | Description |
effectId | int | The unique ID of the effect. |
trackIndex | int | The track index to which the effect is applied. |
void-(NSArray<TAVEffectInfo *> *)getEffectInfos;NSArray<TAVEffectInfo *> *-(void)generateVideo:(TAVEditorGenerateConfig *)config outputPath:(NSString *)outputPath progress:(void (^)(CGFloat progress))progressBlock completion:(void (^)(NSError *error, NSString *outputPath))completion;Parameter Name | Type | Description |
config | TAVEditorGenerateConfig * | Export configuration object for the video. If nil is passed, default configuration will be used (resolution matches preview, 30fps, bitrate of 8 * 1000 * 1000). |
outputPath | NSString * | Final export path for the video file. |
progressBlock | void (^)(CGFloat progress) | Export progress callback block, reporting progress values between [0.0, 1.0]. |
completion | void (^)(NSError *error, NSString *outputPath) | Export completion callback block. If export fails, error contains the error information;outputPath is the final successfully exported file path. |
voiderrorError code 200001: App entered background during export; 200002: Failed to move exported file from temp directory; others are system error codes.-(void)generateVideoWithCompressed:(TAVVideoCompressed)compressed outputPath:(NSString *)outputPath progress:(void (^)(CGFloat progress))progressBlock completion:(void (^)(NSError *error, NSString *outputPath))completion;Parameter Name | Type | Description |
compressed | The preset resolution enum value used for video export. | |
outputPath | NSString * | Final export path for the video file. |
progressBlock | void (^)(CGFloat progress) | Export progress callback block. |
completion | void (^)(NSError *error, NSString *outputPath) | Export completion callback block. |
voiderrorError code 200001: App entered background during export; 200002: Failed to move exported file from temp directory; others are system error codes.generateVideo, this method may use more optimized settings to speed up export.-(void)quickGenerateVideo:(TAVEditorGenerateConfig *)config outputPath:(NSString *)outputPath progress:(void (^)(CGFloat progress))progressBlock completion:(void (^)(NSError *error, NSString *outputPath))completion;Parameter Name | Type | Description |
config | TAVEditorGenerateConfig * | Export configuration object for the video. If nil, default configuration will be used. |
outputPath | NSString * | Final export path for the video file. |
progressBlock | void (^)(CGFloat progress) | Export progress callback block. |
completion | void (^)(NSError *error, NSString *outputPath) | Export completion callback block. |
voiderrorError code 200001: App entered background during export; 200002: Failed to move exported file from temp directory; others are system error codes.-(void)quickGenerateVideoWithCompressed:(TAVVideoCompressed)compressed outputPath:(NSString *)outputPath progress:(void (^)(CGFloat progress))progressBlock completion:(void (^)(NSError *error, NSString *outputPath))completion;Parameter Name | Type | Description |
compressed | The preset resolution enum value used for video export. | |
outputPath | NSString * | Final export path for the video file. |
progressBlock | void (^)(CGFloat progress) | Export progress callback block. |
completion | void (^)(NSError *error, NSString *outputPath) | Export completion callback block. |
voiderrorError code 200001: App entered background during export; 200002: Failed to move exported file from temp directory; others are system error codes.-(void)cancelGenerate:(void(^ __nullable)(void))completion;Parameter Name | Type | Description |
completion | void (^ __nullable)(void) | Callback block executed after the cancellation operation completes. |
void-(void)pauseGenerate;void-(void)resumeGenerate;void-(TAVTemplateConfig * _Nullable)getTemplateConfig:(NSString * _Nullable)templatePath;Parameter Name | Type | Description |
templatePath | NSString * _Nullable | File path of the video template material. |
TAVTemplateConfig * _Nullablenil。-(TAVTemplateCode)setTemplate:(NSString * _Nullable)templatePath;Parameter Name | Type | Description |
templatePath | NSString * _Nullable | File path of the video template material. |
TAVTemplateCodeAPI | Description |
Set the PIP view data source (id<ITAVPipViewDataSource>). | |
Create a PIP object (TAVMediaPipItem). Specify the resource path (filePath) and media type (mediaType), where 0 is video and 1 is image. | |
Add PIP to the editor track. | |
Delete the specified PIP object. | |
Delete the currently active PIP object. | |
Delete all PIP objects. | |
Get a list of all current PIP objects. | |
Unregister the PIP context state listener. | |
Get the currently active PIP object. | |
Activate the specified PIP object, making it the current operation target. | |
Deactivate the specified PIP object. | |
Deactivate the currently active PIP object. | |
Find the corresponding PIP view (TAVPipView) by PIP object (pipItem). |
-(void)setPipViewDataSource:(id<ITAVPipViewDataSource>)dataSource;Parameter Name | Type | Description |
dataSource | id<ITAVPipViewDataSource> | An object conforming to the ITAVPipViewDataSource protocol, providing the data and logic needed for PIP views. |
void-(TAVMediaPipItem *)createPipItem:(NSString *)filePath mediaType:(NSInteger)mediaType;Parameter Name | Type | Description |
filePath | NSString * | File path of the PIP material. |
mediaType | NSInteger | Resource type: 0 for video, 1 for image. |
TAVMediaPipItem *-(void)loadPip:(TAVMediaPipItem *)pipItem;Parameter Name | Type | Description |
pipItem | TAVMediaPipItem * | The PIP object to load onto the timeline. |
void-(void)removePip:(TAVMediaPipItem *)pipItem;Parameter Name | Type | Description |
pipItem | TAVMediaPipItem * | The PIP object to delete. |
void-(void)removeCurrentPip;void-(void)removeAllPip;void-(NSArray<TAVMediaPipItem *> *)getAllPipItems;NSArray<TAVMediaPipItem *> *-(void)addPipObserver:(id<TAVPipContextObserver>)observer;Parameter Name | Type | Description |
observer | id<TAVPipContextObserver> |
void-(void)removePipObserver:(id<TAVPipContextObserver>)observer;Parameter Name | Type | Description |
observer | id<TAVPipContextObserver> | The listener object to unregister. |
void-(TAVMediaPipItem *)getCurrentPipItem;TAVMediaPipItem *-(void)activePip:(TAVMediaPipItem *)pipItem;Parameter Name | Type | Description |
pipItem | TAVMediaPipItem * | The PIP object to activate. |
void-(void)resignPip:(TAVMediaPipItem *)pipItem;Parameter Name | Type | Description |
pipItem | TAVMediaPipItem * | The PIP object to deactivate. |
void-(void)resignCurrentPip;void-(TAVPipView *)fetchPipView:(TAVMediaPipItem *)pipItem;Parameter Name | Type | Description |
pipItem | TAVMediaPipItem * | The PIP object used to find its corresponding view. |
TAVPipView *pipItem associated PIP view.API | Description |
Set the sticker view data source (id<ITAVStickerViewDataSource>), which must implement the method for returning sticker views. | |
Create a sticker object (TAVMediaStickerItem). Specify the sticker path (stickerPath) and sticker type (stickerItemType). | |
Load and add a sticker object to the editor track. | |
Delete the specified sticker object. | |
Delete all sticker objects. | |
Delete the currently active sticker. | |
Get the currently active sticker object (TAVMediaStickerItem). | |
Get the list of all sticker objects. | |
Find the corresponding sticker object (TAVMediaStickerItem) by TAVSticker. | |
Get the rendering layer object (TAVSticker) of the currently active sticker. | |
Get the currently active sticker view (TAVStickerView). | |
Get the corresponding sticker view by TAVSticker. | |
Get the corresponding sticker view by TAVMediaStickerItem. | |
Remove the sticker context state observer. | |
Activate a sticker: hide the sticker on the rendering layer, show the corresponding interactive view on stickerContentView. | |
Deactivate a sticker: show the sticker on the rendering layer, hide the corresponding interactive view on stickerContentView. | |
Deactivate the currently active sticker. | |
Deactivate all active stickers. | |
Get the current video display rectangle (CGRect). |
stickerViewWithStickerItem method to return custom sticker views.-(void)setStickerViewDataSource:(id<ITAVStickerViewDataSource>)dataSource;Parameter Name | Type | Description |
dataSource | id<ITAVStickerViewDataSource> | The sticker view data source object. |
voidTAVMediaStickerItem)。-(TAVMediaStickerItem *)createStickerItem:(NSString *)stickerPath stickerType:(TAVStickerItemType)stickerItemType;Parameter Name | Type | Description |
stickerPath | NSString * | Path to the sticker material. |
stickerItemType | TAVStickerItemType | Type of the sticker resource. |
TAVMediaStickerItem *-(void)loadStickerItem:(TAVMediaStickerItem *)stickerItem;Parameter Name | Type | Description |
stickerItem | TAVMediaStickerItem * | The sticker object to load. |
void-(void)removeStickerItem:(TAVMediaStickerItem *)stickerItem;Parameter Name | Type | Description |
stickerItem | TAVMediaStickerItem * | The sticker object to delete. |
void-(void)removeAllStickerItem;void-(void)removeCurrentSticker;voidTAVMediaStickerItem)。-(TAVMediaStickerItem *)getCurrentStickerItem;TAVMediaStickerItem *TAVMediaStickerItem) list.-(NSArray <TAVMediaStickerItem *>*)getAllStickerItems;NSArray <TAVMediaStickerItem *>*TAVSticker) by the sticker rendering layer object (TAVMediaStickerItem)。-(TAVMediaStickerItem *)getStickerItemWithSticker:(TAVSticker *)sticker;Parameter Name | Type | Description |
sticker | TAVSticker * | The sticker rendering layer object. |
TAVMediaStickerItem *TAVSticker)。-(TAVSticker *)getCurrentSticker;TAVSticker *TAVStickerView)。-(TAVStickerView *)getCurrentStickerView;TAVStickerView *TAVSticker) and return the corresponding sticker view.-(TAVStickerView *)fetchStickerView:(TAVSticker *)sticker;Parameter Name | Type | Description |
sticker | TAVSticker * | The sticker rendering layer object. |
TAVStickerView *sticker associated sticker view.TAVMediaStickerItem) and return the corresponding sticker view.-(TAVStickerView *)fetchStickerVIewWithItem:(TAVMediaStickerItem *)stickerItem;Parameter Name | Type | Description |
stickerItem | TAVMediaStickerItem * | The sticker object. |
TAVStickerView *stickerItem associated sticker view.-(void)addStickerObserver:(id<TAVStickerContextObserver>)observer;Parameter Name | Type | Description |
observer | id<TAVStickerContextObserver> |
void-(void)removeStickerObserver:(id<TAVStickerContextObserver>)observer;Parameter Name | Type | Description |
observer | id<TAVStickerContextObserver> | The observer object to remove. |
void-(void)activeStickerItem:(TAVMediaStickerItem *)stickerItem;Parameter Name | Type | Description |
stickerItem | TAVMediaStickerItem * | The sticker object to activate. |
void-(void)resignStickerItem:(TAVMediaStickerItem *)stickerItem;Parameter Name | Type | Description |
stickerItem | TAVMediaStickerItem * | The sticker object to deactivate. |
void-(void)resignCurrentStickerItem;void-(void)resignAllStickerItems;void-(CGRect)currentVideoRect;CGRectAPI | Description |
Async: Get an array of thumbnails for the resource at the specified main track index (clipIndex), with the specified count and size. Returns a Generator object that can be used to cancel the operation. | |
Async: Get a single thumbnail for the resource at the specified main track index (clipIndex) and time (pts). Returns a Generator object that can be used to cancel the operation. | |
Sync: Synchronously get and return the current frame thumbnail for the resource at the specified main track index (clipIndex) and time (pts). | |
Async: Get the rendered result frame for the specified time (pts) on the main track. isExportMode determines whether the result matches preview or export. Returns a Generator object for cancellation. | |
Async: Get rendered result frames for multiple time points (times) on the main track. Returns a dictionary of multiple frames, and a Generator object that can be used for cancellation. | |
Sync: Get the rendered result frame for the specified time (pts) on the main track. longSide specifies the length of the longest side. | |
Sync: Get rendered result frames for multiple time points (times) on the main track. Returns a dictionary of multiple frames. | |
Async: Get an array of thumbnails for the video at the specified path (videoPath), with the specified count, size, and time range. Returns a Generator object that can be used for cancellation. | |
Async: Get a single thumbnail for the video at the specified path (videoPath) and time (pts). Returns a Generator object that can be used for cancellation. | |
Sync: Synchronously get and return the current frame thumbnail for the video at the specified path (videoPath) and time (pts). | |
Cancel a specified generation operation, such as cancelling a thumbnail or frame generation task. |
-(id)getClipThumbnail:(int)clipIndex count:(int)count size:(CGSize)size completion:(void (^)(NSArray *images))thumbCompletion;Parameter Name | Type | Description |
clipIndex | int | Index of the resource file on the main track. |
count | int | Number of thumbnails to generate. |
size | CGSize | Size (width and height) of the thumbnails. |
thumbCompletion | void (^)(NSArray *images) | Callback returning the corresponding thumbnail array. |
idcancelGenerate: to cancel generation.-(id)getClipThumbnail:(int)clipIndex pts:(CMTime)pts size:(CGSize)size completion:(void (^)(UIImage *image))thumbCompletion;Parameter Name | Type | Description |
clipIndex | int | Index of the resource file on the main track. |
pts | CMTime | Time point in the resource file. |
size | CGSize | Size (width and height) of the thumbnails. |
thumbCompletion | void (^)(UIImage *image) | Callback returning the corresponding thumbnail. |
idcancelGenerate: to cancel generation.-(UIImage *)getClipThumbnail:(int)clipIndex pts:(CMTime)pts size:(CGSize)size;Parameter Name | Type | Description |
clipIndex | int | Index of the resource file on the main track. |
pts | CMTime | Time point in the resource file. |
size | CGSize | Size (width and height) of the thumbnails. |
UIImage *-(id)getClipFrameAtTime:(CMTime)pts exportMode:(BOOL)isExportMode longSide:(CGFloat)length completion:(void (^)(UIImage *image))completion;Parameter Name | Type | Description |
pts | CMTime | Time point. |
isExportMode | BOOL | Whether in export mode: YES means the result matches export, NO means the result matches preview (default). |
length | CGFloat | Length of the longest side of the result image; the SDK calculates the short side proportionally. |
completion | void (^)(UIImage *image) | Callback returning the corresponding rendered frame image. |
idcancelGenerate: to cancel generation.-(id)getClipFrameWithTimes:(NSArray <NSValue *>*)times exportMode:(BOOL)isExportMode longSide:(CGFloat)length completion:(void (^)(NSDictionary <NSValue *, UIImage *> *images))completion;Parameter Name | Type | Description |
times | NSArray <NSValue *>* | An array containing multiple time points ( CMTime wrapped in NSValue). |
isExportMode | BOOL | Whether in export mode: YES means the result matches export, NO means the result matches preview. |
length | CGFloat | Length of the longest side of the result image; the SDK calculates the short side proportionally. |
completion | void (^)(NSDictionary <NSValue *, UIImage *> *images) | Callback returning a dictionary of time points and corresponding rendered frame images. |
idcancelGenerate: to cancel generation.-(UIImage *)getClipFrameAtTime:(CMTime)pts exportMode:(BOOL)isExportMode longSide:(CGFloat)length;Parameter Name | Type | Description |
pts | CMTime | Time point. |
isExportMode | BOOL | Whether in export mode. |
length | CGFloat | Length of the longest side of the result image; the SDK calculates the short side proportionally. |
UIImage *-(NSDictionary <NSValue *, UIImage *> *)getClipFrameWithTimes:(NSArray <NSValue *>*)times exportMode:(BOOL)isExportMode longSide:(CGFloat)length;Parameter Name | Type | Description |
times | NSArray <NSValue *>* | An array containing multiple time points ( CMTime wrapped in NSValue). |
isExportMode | BOOL | Whether in export mode. |
length | CGFloat | Length of the longest side of the result image; the SDK calculates the short side proportionally. |
NSDictionary <NSValue *, UIImage *> *-(id)getThumbnail:(NSString *)videoPath count:(int)count size:(CGSize)size timeRange:(CMTimeRange)timeRange completion:(void (^)(NSArray<UIImage *> *images, NSError *error))thumbCompletion;Parameter Name | Type | Description |
videoPath | NSString * | Path of the video resource. |
count | int | Number of thumbnails to generate. |
size | CGSize | Size (width and height) of the thumbnails. |
timeRange | CMTimeRange | Time range for video frame extraction, defaults to the entire video duration. |
thumbCompletion | void (^)(NSArray<UIImage *> *images, NSError *error) | Callback returning the corresponding thumbnail array and error information. |
idcancelGenerate: to cancel generation.-(id)getThumbnail:(NSString *)videoPath pts:(CMTime)pts size:(CGSize)size completion:(void (^)(UIImage *image, NSError *error))thumbCompletion;Parameter Name | Type | Description |
videoPath | NSString * | Path of the video resource. |
pts | CMTime | Time point in the resource file. |
size | CGSize | Size (width and height) of the thumbnails. |
thumbCompletion | void (^)(UIImage *image, NSError *error) | Callback returning the corresponding thumbnail and error information. |
idcancelGenerate: to cancel generation.-(UIImage *)getThumbnail:(NSString *)videoPath pts:(CMTime)pts size:(CGSize)size;Parameter Name | Type | Description |
videoPath | NSString * | Path of the video resource. |
pts | CMTime | Time point in the resource file. |
size | CGSize | Size (width and height) of the thumbnails. |
UIImage *-(void)cancelGenerate:(id)generator;Parameter Name | Type | Description |
generator | id | The Generator object returned by the getClipThumbnail... or getThumbnail... series of async methods. |
voidAPI | Description |
Set the draft storage path. If not set, the SDK's built-in default path is used. | |
Get the list of all drafts in the current storage directory (NSArray<TAVDraft *> *). | |
Generate a draft to the preset directory, caching all resources used by the draft into the draft directory, and delete them together with the draft. | |
Generate a draft to the preset directory without caching resources used by the draft; resource management is the user's responsibility. | |
Get the draft object currently loaded in the editor. | |
Load the specified draft object (draft) and execute a callback after loading is complete. | |
Delete the specified draft object. | |
Delete all drafts. | |
Reset/start recording the editor's operation history for a new undo/redo chain. | |
Commit an operation as a history checkpoint, marked as a draft. Returns whether the commit was successful. | |
Returns whether the current editor state can be undone (BOOL). | |
Returns whether the current editor state can be redone (BOOL). | |
Undo/revert to the previous operation state and execute a callback upon completion. | |
Redo/advance to the next operation state and execute a callback upon completion. | |
Add a draft state listener (id<ITAVDraftStateListener>). | |
Remove the draft state listener. |
+(void)setDraftStorageDir:(NSString *)storageDir;Parameter Name | Type | Description |
storageDir | NSString * | Storage path for draft files. |
void+(NSArray<TAVDraft *> *)readDraftList;NSArray<TAVDraft *> *TAVDraft).-(BOOL)generateDraft;BOOL-(BOOL)generateDraftNoCacheResources;BOOL-(TAVDraft *)getCurrentDraft;TAVDraft *-(void)loadDraft:(TAVDraft *)draft onDraftLoadingFinished:(TAVDraftLoadingCallBack)callback;Parameter Name | Type | Description |
draft | TAVDraft * | The draft object to load. |
callback | TAVDraftLoadingCallBack | Callback function after draft loading is complete. |
void+(void)deleteDraft:(TAVDraft *)draft;Parameter Name | Type | Description |
draft | TAVDraft * | The draft object to delete. |
void+(void)deleteAllDrafts;void-(void)resetDraftRecord;void-(BOOL)commit:(NSString *)tag;Parameter Name | Type | Description |
tag | NSString * | A tag value to mark this commit. |
BOOL-(BOOL)canUndo;BOOL-(BOOL)canRedo;BOOL-(void)undo:(TAVDraftActionCallBack)callback;Parameter Name | Type | Description |
callback | TAVDraftActionCallBack | Callback function after the undo operation completes. |
void-(void)redo:(TAVDraftActionCallBack)callback;Parameter Name | Type | Description |
callback | TAVDraftActionCallBack | Callback function after the redo operation completes. |
void-(void)addDraftStateListener:(id<ITAVDraftStateListener>)listener;Parameter Name | Type | Description |
listener | id<ITAVDraftStateListener> | An object conforming to the ITAVDraftStateListener protocol. |
void-(void)removeDraftStateListener:(id<ITAVDraftStateListener>)listener;Parameter Name | Type | Description |
listener | id<ITAVDraftStateListener> | The listener to remove. |
voidAPI | Description |
Log listener callback. |
-(void)onLog:(TAVLogLevel)loggerLevel logMessage:(NSString * _Nonnull)logMessage;Parameter Name | Type | Description |
loggerLevel | TAVLogLevel | Returns the current log level. |
logMessage | NSString * _Nonnull | Returns the current log message. |
voidAPI | Description |
Called when the media resource (AVPlayerItem) bound to the player changes. | |
Called when the playback progress changes, with the current playback time (CMTime) as a parameter. | |
Called when the player's playback state (TAVPlaybackState, such as play, pause, stop, etc.) changes. | |
Called when the player's playback speed changes. | |
Called when the player reaches the end of playback (playback complete). | |
Called when the video's rendering area or rectangle (videoRect) changes. |
AVPlayerItem) changes.-(void)mediaPlayerItemDidChange:(AVPlayerItem *)playerItem;Parameter Name | Type | Description |
playerItem | AVPlayerItem * | The new media player playback item object. |
void-(void)mediaPlayerProgressDidChange:(CMTime)currentTime;Parameter Name | Type | Description |
currentTime | CMTime | The current playback time point. |
void-(void)mediaPlayerStateDidChange:(TAVPlaybackState)state;Parameter Name | Type | Description |
state | The new state of the media player. |
void-(void)mediaPlayerSpeedDidChange:(CGFloat)speed;Parameter Name | Type | Description |
speed | CGFloat | The new playback speed of the media player. |
void-(void)mediaPlayerDidPlayToEnd;voidvideoRect) changes.-(void)mediaPlayerVideoRectDidChange:(CGRect)videoRect;Parameter Name | Type | Description |
videoRect | CGRect | The new rendering rectangle of the video content. |
voidAPI | Description |
Called when the PIP view is shown. This usually occurs when the PIP object is activated and ready for on-screen interaction. | |
Called when the PIP view is hidden. This usually occurs when the PIP object is deactivated or temporarily invisible. | |
Called when the PIP view is removed. This usually occurs when the PIP object is permanently deleted from the editor. | |
Called when the PIP view is deactivated. Indicates that the view is no longer the current user's primary operation target. | |
Called when the PIP view is activated. Indicates that the view has become the current user's primary operation target. |
TAVPipView) is shown.-(void)didShowPipView:(TAVPipView *)pipView;Parameter Name | Type | Description |
pipView | TAVPipView * | The PIP view object currently being shown. |
voidTAVPipView) is hidden.-(void)didHidePipView:(TAVPipView *)pipView;Parameter Name | Type | Description |
pipView | TAVPipView * | The PIP view object currently being hidden. |
voidTAVPipView) is removed from the rendering layer.-(void)didRemovePipView:(TAVPipView *)pipView;Parameter Name | Type | Description |
pipView | TAVPipView * | The PIP view object currently being removed. |
voidTAVPipView) is deactivated (exits editing focus).-(void)didResignPipView:(TAVPipView *)pipView;Parameter Name | Type | Description |
pipView | TAVPipView * | The PIP view object currently being deactivated. |
voidTAVPipView) is activated (enters editing focus).-(void)didActivePipView:(TAVPipView *)pipView;Parameter Name | Type | Description |
pipView | TAVPipView * | The PIP view object currently being activated. |
voidAPI | Description |
Notifies the delegate when the sticker list changes (e.g., after adding or deleting stickers). | |
Notifies the delegate when the currently active sticker object changes. | |
Notifies the delegate that the video frame needs to be refreshed (e.g., sticker position, scale, etc. changed, requiring a redraw). | |
Notifies the delegate when a specified sticker view is activated (typically meaning the user starts editing that sticker). | |
Notifies the delegate when a specified sticker view is deactivated (resigned). | |
Notifies the delegate when a specified sticker view is removed. | |
Notifies the delegate when a specified sticker view is shown. | |
Notifies the delegate when a specified sticker view is hidden. |
-(void)stickerContextStickerListDidChange:(TAVStickerContext *)context;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
void-(void)stickerContextCurrentStickerDidChange:(TAVStickerContext *)context;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
void-(void)stickerContextShouldRefreshVideoFrame:(TAVStickerContext *)context;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
void-(void)stickerContext:(TAVStickerContext *)context didActiveSticker:(TAVStickerView *)stickerView;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
stickerView | TAVStickerView * | The sticker view that was activated. |
void-(void)stickerContext:(TAVStickerContext *)context didResignSticker:(TAVStickerView *)stickerView;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
stickerView | TAVStickerView * | The sticker view that was deactivated. |
void-(void)stickerContext:(TAVStickerContext *)context didRemoveSticker:(TAVStickerView *)stickerView;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
stickerView | TAVStickerView * | The sticker view that was removed. |
void-(void)stickerContext:(TAVStickerContext *)context didShowSticker:(TAVStickerView *)stickerView;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
stickerView | TAVStickerView * | The sticker view that was shown. |
void-(void)stickerContext:(TAVStickerContext *)context didHideSticker:(TAVStickerView *)stickerView;Parameter Name | Type | Description |
context | TAVStickerContext * | The sticker context object reporting this event. |
stickerView | TAVStickerView * | The sticker view that was hidden. |
voidtypedef NS_ENUM(NSUInteger, TAVPlayerFillMode);Enum Value | Raw Value | Description |
TAVPlayerFillModeAspectFit | 0 | Aspect Fit: Maintains the video content's aspect ratio, fitting the entire video within the view boundaries. The video may not fill the entire view, and black bars may appear (similar to AVLayerVideoGravityResizeAspect)。 |
TAVPlayerFillModeAspectFill | 1 | Aspect Fill: Maintains the video content's aspect ratio, filling the entire view boundaries. The video may be cropped, ensuring no black bars appear (similar to AVLayerVideoGravityResizeAspectFill)。 |
TAVPlayerFillModeFill | 2 | Scale to Fill: Does not maintain the video content's aspect ratio, stretching or scaling directly to fill the entire view boundaries. The video may be distorted (similar to AVLayerVideoGravityResize)。 |
typedef NS_ENUM(NSInteger, TAVVideoCompressed);Enum Value | Raw Value | Description |
TAVVideoCompressed480P | 0 | 480P Resolution: The video will be compressed to 640 × 480 resolution (maximum long side of 640). |
TAVVideoCompressed540P | 1 | 540P Resolution: The video will be compressed to 960 × 540 resolution (maximum long side of 960). |
TAVVideoCompressed720P | 2 | 720P Resolution |
TAVVideoCompressed1080P | 3 | 1080P Resolution: The video will be compressed to 1920 × 1080 resolution (maximum long side of 1920). |
typedef NS_ENUM(NSInteger, TAVEditorMediaType);Enum Value | Raw Value | Description |
TAVEditorMediaTypeUnknown | 0 | Unknown Type。 |
TAVEditorMediaTypeVideo | 1 << 0 (i.e., 1) | Video Type: Represents that the resource contains a video track. |
TAVEditorMediaTypeAudio | 1 << 1 (i.e., 2) | Audio Type: Represents that the resource contains an audio track. |
TAVEditorMediaTypeImage | 1 << 2 (i.e., 4) | Photo Type: Represents that the resource is a static image. |
typedef NS_ENUM(NSInteger, TAVPlaybackState);Enum Value | Raw Value | Description |
TAVPlaybackStateInit | 0 | Initialized: The player object has just been created and is in its initial state. |
TAVPlaybackStatePreparing | 1 | Loading / Preparing: The player is loading resources and preparing for playback. |
TAVPlaybackStateReady | 2 | Ready: The player is ready to play or pause and can respond to control commands. |
TAVPlaybackStateLoading | 3 | Buffering: During playback, buffering is needed due to network or other reasons. |
TAVPlaybackStatePlaying | 4 | Playing: The player is playing media content normally. |
TAVPlaybackStatePaused | 5 | Paused: The player is paused and can resume playback via a resume command. |
TAVPlaybackStateFinished | 6 | Playback Finished: Media content playback is complete. |
TAVPlaybackStateStopped | 7 | Playback Stopped: The player has been explicitly stopped and typically needs to be reloaded to play. |
TAVPlaybackStateDestoryed | 8 | Player Destroyed: The player object has been released or destroyed. |
TAVPlaybackStateFailed | 9 | Playback Failed: An error occurred during playback, preventing normal playback. |
피드백