Skip to main content
Language:

Configure Filters

VideoEditor SDK supports several configuration options for the filter 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.

flattenCategories#

By default, the filters are grouped according to the FilterCategory instances passed to the configuration.filter.categories. In this example, the filter grouping is disabled so that all available filters will be displayed separately.

File:
import { Configuration, VESDK } from "react-native-videoeditorsdk";
export const videoFilterConfigurationExample = async (): Promise<void> => {
// Add a video from the assets directory.
const video = require("../../../../assets/vesdk/Skater.mp4");
// Create a `Configuration` object.
const configuration: Configuration = {
filter: {
// By default, the filters are grouped according to the filter
// categories passed to the configuration. In this example,
// the filter grouping is disabled so that all
// available filters will be displayed separately.
flattenCategories: true,
},
};
try {
// 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);
}
};