Kotlin
Implement the Custom Capturer
Create a class that extends BaseVideoCapturer from the Vonage SDK. Your capturer must implement several key methods. For full implementation check the files used here: ScreenSharingCapturer.kt. Let's start by exploring getCaptureSettings()
getCaptureSettings() tells the SDK how your video is formatted: resolution, frame rate, and pixel format.
override fun getCaptureSettings(): CaptureSettings {
return CaptureSettings().apply {
this.fps = this@ScreenSharingCapturer.fps // 15 in our case
this.width = this@ScreenSharingCapturer.width
this.height = this@ScreenSharingCapturer.height
format = ABGR
}
}
fps– frames per second (15 fps is typical for screen sharing)width/height– dimensions of the captured framesformat– pixel format (e.g.ABGR,NV21)
Screen sharing
Learn how to implement tha screensharing capability using the Vonage Video API platform.
手順
1
Introduction2
Getting Started3
Creating a new project4
Adding the Android SDK5
Setting up authentication6
Requesting permissions7
Implement the Custom Capturer8
Starting the capture9
Initializing Session10
Running the app11
Conclusion