Skip to content

Latest commit

 

History

History
132 lines (99 loc) · 4.25 KB

File metadata and controls

132 lines (99 loc) · 4.25 KB

Quickstart Guide

Installation

CocoaPods

❗ Important Requires CocoaPods 1.12.1+. Check with pod --version and upgrade if needed.

  1. Add sources and pods to your Podfile:
source 'https://cdn.cocoapods.org/'
source 'https://github.com/Banuba/specs.git'
source 'https://github.com/sdk-banuba/banuba-sdk-podspecs.git'

banuba_sdk_version = '1.50.1'

pod 'BanubaVideoEditorSDK', banuba_sdk_version
pod 'BanubaSDKSimple', banuba_sdk_version
pod 'BanubaSDK', banuba_sdk_version
pod 'BanubaARCloudSDK', banuba_sdk_version      # optional
pod 'BanubaAudioBrowserSDK', banuba_sdk_version # optional
  1. Install the pods:
pod install --repo-update
  1. Open the generated .xcworkspace in Xcode and run the project.

SPM

SPM integration is available in the spm branch.

  1. Add the required packages using the URLs: https://github.com/Banuba/BanubaVideoEditorSDK-iOS https://github.com/Banuba/BanubaSDK-iOS

  2. Use Exact Version mode and specify the 1.50.1 version.

❗ Info For more details, refer to the SPM Mandatory modules.

Info.plist Updates

Add the iOS permissions required by the SDK (camera, microphone, photo library, media library) to your Info.plist:

<key>NSAppleMusicUsageDescription</key>
<string>This app requires access to the media library</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires access to the microphone.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>

Localization

Add English Localized Strings file to the project.

Video Editor Module Setup

  1. Create VideoEditorModule to initialize and customize the Video Editor SDK.
  2. Inside it, add method with your customizations:
class VideoEditorModule {
  ... 
  func createConfiguration() -> VideoEditorConfig {
      var config = VideoEditorConfig()
      ...
      return config
  }
}

Launch

Create instance of BanubaVideoEditor by using the license token.

let videoEditorSDK = BanubaVideoEditor(
      token: AppDelegate.licenseToken,
      configuration: config,
      externalViewControllerFactory: viewControllerFactory
    )

❗ Important

  1. Returns nil if the license token is invalid – verify your token
  2. Check license activation before starting the editor.
  3. Expired/revoked licenses show a "Video content unavailable" screen

This example launches from camera:

 let cameraLaunchConfig = VideoEditorLaunchConfig(
        entryPoint: .camera,
        hostController: self,
        musicTrack: nil, // Paste a music track as a track preset at the camera screen to record video with music
        animated: true
)

videoEditorModule.presentVideoEditor(with: cameraLaunchConfig)

Implement export

The Video Editor SDK can export multiple files at once. To set up export:

  1. Make an ExportConfiguration object. Add one or more ExportVideoConfiguration objects to it. Each one stands for a video or audio file.

  2. Call BanubaVideoEditor.export() and pass your ExportConfiguration to start.

Check the export implementation in the sample.

Read the Export integration guide for more details.

Customization options

Explore customization options in our documentation.