Kotlin
Adding the Android SDK (Kotlin DSL)
The app uses Maven to load the Android SDK:
- Update your
settings.gradlefile includingmavenCentral()repository if it doesn't exists already:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
or if you are using an older project setup, update your build.gradle file from your project root. Add mavenCentral() inside the repositories block like this:
allprojects {
repositories {
google()
mavenCentral()
}
}
- Modify your module-level
build.gradle.kts(typicallyapp/build.gradle.kts)
Add the SDK dependency:
dependencies {
implementation("com.vonage:client-sdk-video:2.31.0")
}
- Sync your project.
After updating your build.gradle.kts files, sync your project in Android Studio to download the Vonage SDK and apply the configuration.
Basic video rendering
Learn how to use a custom video renderer in Kotlin to display a black-and-white version of a video stream using the Vonage Video Android SDK.
手順
1
Introduction2
Getting Started3
Creating a new project4
Adding the Android SDK5
Setting up authentication6
Requesting permissions7
Creating the Inverted Video Renderer8
Creating a custom Renderer (MyRenderer)9
Publishing a stream to the session10
Connecting Custom Renderer to Publisher/Subscriber11
Running the app12
Conclusion