This guide demonstrates how to quickly integrate iOS Video Editor SDK into React Native project.
The main part of an integration and customization is implemented in ios
directory
of React Native project using native iOS development process.
Once complete you will be able to launch video editor in your React Native project.
Add iOS Video Editor SDK dependencies to your Podfile.
Video Editor SDK uses a lot of resources required for running.
Please make sure all these resources are provided in your project.
- luts to use Lut effects shown in the Effects tab.
- Localizable.strings file with English localization.
Video Editor SDK needs only the Localizable.strings file.
Important
Check if the file YourProject-Bridging-Header.h exists in your React Native project in the ios
folder.
Add VE-Sample-Bridging-Header.h and SdkEditorModuleBridge.m files for communication between React Native and iOS and SdkEditorModule.swift file to initialize the SDK dependencies. This class also allows you to customize many Video and Photo Editor SDK features i.e. min/max video durations, export flow, order of effects and others.
To create YourProject-Bridging-Header.h, open your iOS project in Xcode and follow the steps below:
- Create a new empty Swift file in your project by following the path
File -> New -> File
: - Choose
Swift file
and clickNext
: - Click
Create
: - Xcode will suggest you to configure an Objective-C bridging Header. Click
Create Bridging Header
: - Copy VE-Sample-Bridging-Header.h to your
YourProject-Bridging-Header.h
.
- Copy VE-Sample-Bridging-Header.h to your
YourProject-Bridging-Header.h
.
- Create a new Swift file in your project by following the path
File -> New -> File
: - Choose
Swift file
and clickNext
: - Set the name
SdkEditorModule
and clickCreate
: - Copy SdkEditorModule.swift to your
SdkEditorModule
.
- Create a new empty .m file in your project by following the path
File -> New -> File
: - Choose
Objective-C file
and clickNext
: - Set the name of the file and click
Next
:
On the next view clickCreate
. - Copy SdkEditorModuleBridge.m to your
SdkEditorModuleBridge.m
.
- Copy SdkEditorModuleBridge.m to your
SdkEditorModuleBridge.m
Invoke initSDK on React Native side to initialize Video Editor SDK with the license token.
SdkEditorModule.initSDK(LICENSE_TOKEN);
Add ReactMethod on iOS side to initialize Video Editor SDK.
Please note that the instance videoEditor
can be nil if the license token is incorrect.
See example
Finally, once the SDK in initialized you can invoke openVideoEditor message from React Native to iOS
await SdkEditorModule.openVideoEditor();
and add ReactMethod on iOS side to start Video Editor.
Video Editor SDK exports single video with auto quality by default. Auto quality is based on device hardware capabilities.
Process the result and pass it to handler on React Native side.
To keep up with the latest developments and best practices, our team has completely redesigned the Video Editor SDK to be as convenient and enjoyable as possible.
Init the Video Editor with argument [.useEditorV2: true] to enable Editor UI V2:
videoEditorSDK = BanubaVideoEditor(
token: token,
arguments: [.useEditorV2 : true],
configuration: config,
externalViewControllerFactory: customViewControllerFactory
)
Banuba Face AR SDK product is used on camera and editor screens for applying various AR effects while making video content. Any Face AR effect is a folder that includes a number of files required for Face AR SDK to play this effect.
Note
Make sure preview.png file is included in effect folder. You can use this file as a preview for AR effect.
There are 2 options for adding and managing AR effects:
- Add
bundleEffects
folder in the ios project and place effects there. - Use AR Cloud for storing effects on a server.
This is an optional section in the integration process. In this section you will know how to connect audio to Video Editor.
Set false
to configEnableCustomAudioBrowser
and specify Soundstripe
in your SdkEditorModule
Important
The feature is not activated by default. Please, contact Banuba representatives to know more about using this feature.
AudioBrowserConfig.shared.musicSource = .soundstripe
to use audio from Soundstripe in Video Editor.
Request API key from Mubert.
Important
Banuba is not responsible for providing Mubert API key.
Set false
to configEnableCustomAudioBrowser
and specify MubertApiConfig
in your SdkEditorModule
AudioBrowserConfig.shared.musicSource = .mubert
BanubaAudioBrowser.setMubertKeys(
license: "SET MUBERT API LICENSE",
token: "SET MUBERT API TOKEN"
)
to use audio from Mubert in Video Editor.
Set false
to configEnableCustomAudioBrowser
and specify BanubaMusicProvider
in your SdkEditorModule
Important
The feature is not activated by default. Please, contact Banuba representatives to know more about using this feature.
AudioBrowserConfig.shared.musicSource = .banubaMusic
to use audio from Banuba Music
in Video Editor.
Video Editor SDK allows to implement your experience of providing audio tracks for your users - custom Audio Browser.
To check out the simplest experience you can set true
to configEnableCustomAudioBrowser
Important
Video Editor SDK can play only files stored on device.