Skip to content

Migration to 1.40.0 #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Example/fastlane
*.mobileprovision
xcuserdata
.DS_Store
Example/build/*
37 changes: 27 additions & 10 deletions Example/Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -18,10 +18,27 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="UCZ-29-s3y">
<rect key="frame" x="40" y="247" width="310" height="350"/>
<rect key="frame" x="40" y="217" width="310" height="410"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6jh-xc-CaM" userLabel="Default">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Az8-P7-khP" userLabel="NEW UI">
<rect key="frame" x="0.0" y="0.0" width="310" height="50"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="C8G-cG-eSg"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/>
<state key="normal" title="OPEN VIDEO EDITOR - NEW UI">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="5"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="openNewVideoEditorUI:" destination="BYZ-38-t0r" eventType="touchUpInside" id="zPu-Na-1yz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6jh-xc-CaM" userLabel="Default">
<rect key="frame" x="0.0" y="60" width="310" height="50"/>
<color key="backgroundColor" red="0.12156862745098039" green="0.12156862745098039" blue="0.12156862745098039" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="12b-pN-eFA"/>
Expand All @@ -38,7 +55,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Xjq-v9-Kyb" userLabel="PiP">
<rect key="frame" x="0.0" y="60" width="310" height="50"/>
<rect key="frame" x="0.0" y="120" width="310" height="50"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/>
<state key="normal" title="OPEN VIDEO EDITOR - PIP">
Expand All @@ -52,7 +69,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="X13-Te-Eiz" userLabel="Drafts">
<rect key="frame" x="0.0" y="120" width="310" height="50"/>
<rect key="frame" x="0.0" y="180" width="310" height="50"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
Expand All @@ -67,7 +84,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pF3-7f-yJr" userLabel="Trimmer">
<rect key="frame" x="0.0" y="180" width="310" height="50"/>
<rect key="frame" x="0.0" y="240" width="310" height="50"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
Expand All @@ -82,7 +99,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HCw-be-gid" userLabel="Photo (Gallery)">
<rect key="frame" x="0.0" y="240" width="310" height="50"/>
<rect key="frame" x="0.0" y="300" width="310" height="50"/>
<color key="backgroundColor" red="0.12916186882622985" green="0.53729480806210805" blue="0.94933973587278919" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
Expand All @@ -97,7 +114,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XRR-o0-cdr" userLabel="Photo (Editor)">
<rect key="frame" x="0.0" y="300" width="310" height="50"/>
<rect key="frame" x="0.0" y="360" width="310" height="50"/>
<color key="backgroundColor" red="0.1291618688" green="0.53729480809999997" blue="0.94933973589999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
Expand All @@ -114,7 +131,7 @@
</subviews>
</stackView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="License token is invalid" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="5" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U2o-Rc-B2d">
<rect key="frame" x="40" y="206.66666666666666" width="310" height="20.333333333333343"/>
<rect key="frame" x="40" y="176.66666666666666" width="310" height="20.333333333333343"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<color key="textColor" systemColor="systemRedColor"/>
<nil key="highlightedColor"/>
Expand Down
6 changes: 3 additions & 3 deletions Example/Example/VideoEditorModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
import UIKit
import BanubaVideoEditorSDK

import VideoEditor
import BanubaVideoEditorCore
import AVFoundation
import AVKit
import Photos
import BSImagePicker
import VEExportSDK
import BanubaAudioBrowserSDK

// Adopting CountdownView to using in BanubaVideoEditorSDK
Expand All @@ -19,11 +18,12 @@ class VideoEditorModule {

var isVideoEditorInitialized: Bool { videoEditorSDK != nil }

init(token: String) {
init(token: String, isEditorV2Enabled: Bool) {
let config = createConfiguration()

let videoEditorSDK = BanubaVideoEditor(
token: token,
arguments: [.useEditorV2: isEditorV2Enabled],
configuration: config
)

Expand Down
19 changes: 15 additions & 4 deletions Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import UIKit
import BanubaVideoEditorSDK
import BanubaPhotoEditorSDK

import VideoEditor
import AVFoundation
import AVKit
import Photos
import BSImagePicker
import VEExportSDK
import BanubaVideoEditorCore
import BanubaAudioBrowserSDK
import BanubaLicenseServicingSDK

Expand Down Expand Up @@ -40,6 +39,18 @@ class ViewController: UIViewController, BanubaVideoEditorDelegate, BanubaPhotoEd
}

// MARK: - Actions
@IBAction func openNewVideoEditorUI(_ sender: Any) {
let musicTrackPreset: MediaTrack? = nil

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

@IBAction func openVideoEditorDefault(_ sender: Any) {
let musicTrackPreset: MediaTrack? = nil
// Uncomment to apply custom audio track in video editor
Expand Down Expand Up @@ -183,13 +194,13 @@ class ViewController: UIViewController, BanubaVideoEditorDelegate, BanubaPhotoEd
return musicTrackPreset
}

private func checkLicenseAndOpenVideoEditor(with launchConfig: VideoEditorLaunchConfig) {
private func checkLicenseAndOpenVideoEditor(with launchConfig: VideoEditorLaunchConfig, isEditorV2Enabled: Bool = false) {
// Deallocate any active instances of both editors to free used resources
// and to prevent "You are trying to create the second instance of the singleton." crash
photoEditorModule = nil
videoEditorModule = nil

videoEditorModule = VideoEditorModule(token: AppDelegate.licenseToken)
videoEditorModule = VideoEditorModule(token: AppDelegate.licenseToken, isEditorV2Enabled: isEditorV2Enabled)

guard let videoEditorSDK = videoEditorModule?.videoEditorSDK else {
invalidTokenMessageLabel.text = "Banuba Video Editor SDK is not initialized: license token is unknown or incorrect.\nPlease check your license token or contact Banuba"
Expand Down
10 changes: 6 additions & 4 deletions Example/Example/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@
"com.banuba.newEditor.masks" = "Masks";
"com.banuba.newEditor.audio" = "Audio";
"com.banuba.newEditor.filters" = "Filters";
"com.banuba.newEditor.blur" = "Blur";
"com.banuba.newEditor.pixelate" = "Pixelate";
"com.banuba.newEditor.speed" = "Speed";
"com.banuba.newEditor.crop" = "Crop";
"com.banuba.newEditor.split" = "Split";
Expand All @@ -824,8 +824,9 @@
"com.banuba.newEditor.replace" = "Replace";
"com.banuba.newEditor.delete" = "Delete";
"com.banuba.newEditor.adjust" = "Adjust";
"com.banuba.newEditor.circle" = "Circle";
"com.banuba.newEditor.square" = "Square";
"com.banuba.newEditor.addCircle" = "Add Circle";
"com.banuba.newEditor.addSquare" = "Add Square";
"com.banuba.newEditor.pixelation" = "Pixelation";
"com.banuba.newEditor.voiceEffect" = "Effect";
"com.banuba.newEditor.captions" = "Captions";
"com.banuba.newEditor.secondsFormat" = "%@s";
Expand All @@ -843,7 +844,8 @@
"com.banuba.newEditor.videoIsTooShortFormat" = "The video is too short. Minimum length is %d second.";
"com.banuba.newEditor.next" = "Next";
"com.banuba.newEditor.reset" = "Reset";
"com.banuba.newEditor.videoSaved" = "Video saved.";
"com.banuba.newEditor.noFreeClipForFilter" = "No free clip for new filter";
"com.banuba.newEditor.noFreeClipForMask" = "No free clip for new masks";
"com.banuba.newEditor.none" = "None";
"com.banuba.newEditor.normal" = "Normal";

Expand Down
25 changes: 9 additions & 16 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,23 @@ inhibit_all_warnings!

target 'Example' do

banuba_sdk_version = '1.39.7'

# Video Editor

pod 'BanubaARCloudSDK', banuba_sdk_version #optional
banuba_sdk_version = '1.40.0'

pod 'BanubaVideoEditorSDK', banuba_sdk_version
pod 'BanubaAudioBrowserSDK', banuba_sdk_version #optional

pod 'BanubaSDKSimple', banuba_sdk_version
pod 'BanubaSDK', banuba_sdk_version
pod 'BanubaSDKServicing', banuba_sdk_version
pod 'VideoEditor', banuba_sdk_version
pod 'BanubaUtilities', banuba_sdk_version
pod 'BanubaVideoEditorGallerySDK', banuba_sdk_version #optional
pod 'BanubaLicenseServicingSDK', banuba_sdk_version

pod 'BNBLicenseUtils', banuba_sdk_version

pod 'VEExportSDK', banuba_sdk_version
pod 'VEEffectsSDK', banuba_sdk_version
pod 'VEPlaybackSDK', banuba_sdk_version

pod "BSImagePicker"
pod 'BanubaARCloudSDK', banuba_sdk_version # optional
pod 'BanubaAudioBrowserSDK', banuba_sdk_version # optional

# Photo Editor

pod 'BanubaPhotoEditorSDK', '1.2.5'

# Third party

pod "BSImagePicker"
end
Loading