-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleApp.kt
76 lines (59 loc) · 2.56 KB
/
SampleApp.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.banuba.sdk.example
import android.app.Application
import android.util.Log
import com.banuba.sdk.arcloud.di.ArCloudKoinModule
import com.banuba.sdk.audiobrowser.di.AudioBrowserKoinModule
import com.banuba.sdk.core.license.BanubaVideoEditor
import com.banuba.sdk.effectplayer.adapter.BanubaEffectPlayerKoinModule
import com.banuba.sdk.export.di.VeExportKoinModule
import com.banuba.sdk.gallery.di.GalleryKoinModule
import com.banuba.sdk.playback.di.VePlaybackSdkKoinModule
import com.banuba.sdk.ve.di.VeSdkKoinModule
import com.banuba.sdk.ve.flow.di.VeFlowKoinModule
import com.banuba.sdk.veui.di.VeUiSdkKoinModule
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
import org.koin.core.context.stopKoin
class SampleApp : Application() {
var videoEditor: BanubaVideoEditor? = null
companion object {
const val TAG = "BanubaVideoEditor"
val LICENSE_TOKEN = SET LICENSE TOKEN
const val ERR_SDK_NOT_INITIALIZED = "Banuba Video Editor SDK is not initialized: license token is unknown or incorrect.\nPlease check your license token or contact Banuba"
const val ERR_LICENSE_REVOKED = "License is revoked or expired. Please contact Banuba https://www.banuba.com/faq/kb-tickets/new"
}
override fun onCreate() {
super.onCreate()
videoEditor = BanubaVideoEditor.initialize(LICENSE_TOKEN)
if (videoEditor == null) {
// Token you provided is not correct - empty or truncated
Log.e(TAG, ERR_SDK_NOT_INITIALIZED)
}
}
fun prepareVideoEditor() {
// Initialize Video Editor
startKoin {
androidContext(applicationContext)
allowOverride(true)
// IMPORTANT! order of modules is required
modules(
VeSdkKoinModule().module,
VeExportKoinModule().module,
VePlaybackSdkKoinModule().module,
// Use AudioBrowserKoinModule ONLY if your contract includes this feature.
AudioBrowserKoinModule().module,
// IMPORTANT! ArCloudKoinModule should be set before TokenStorageKoinModule to get effects from the cloud
ArCloudKoinModule().module,
VeUiSdkKoinModule().module,
VeFlowKoinModule().module,
BanubaEffectPlayerKoinModule().module,
GalleryKoinModule().module,
// Sample integration module
VideoEditorKoinModule().module,
)
}
}
fun releaseVideoEditor() {
stopKoin()
}
}