Language:
Configure Border Frames
VideoEditor SDK supports configuring the frame tool allowing flexible adaptation to different needs and use cases. For a detailed explanation of how to configure different editor views, refer to this guide.
actions
#
actions
#Configuring the frame tool allows changing how users can interact with a given frame.
The actions users can perform are configured via the actions
property. In our example, we remove the option to change the frame width (FrameAction.WIDTH
) and only allow replacing it and changing its opacity.
File:
import { Configuration, FrameAction, VESDK } from "react-native-videoeditorsdk";export const videoFramesConfigurationExample = async (): Promise<void> => {try {// Add a video from the assets directory.const video = require("../../../../assets/vesdk/Skater.mp4");// Create a `Configuration` object.const configuration: Configuration = {frame: {// By default all actions are enabled in the frame tool.// For this example only two of them are enabled.actions: [FrameAction.OPACITY, FrameAction.REPLACE],},};// Open the video editor and handle the export as well as any occuring errors.const result = await VESDK.openEditor(video, configuration);if (result != null) {// The user exported a new video successfully and the newly generated video is located at `result.video`.console.log(result?.video);} else {// The user tapped on the cancel button within the editor.return;}} catch (error) {// There was an error generating the video.console.log(error);}};