Kotlin

Adjusting the sample app UI

The Android SDK exposes the video streams (both published and subscribed) as View objects. You can attach these views to any composable view in your layout.

  1. Create a composable view

In Android Studio:

  • Create a new file VideoChatScreen.kt
  • Fill contents of the file with:
  1. Now declare publisherView and subscriberView as properties of the MainActivity class (right after the declaration for the session property):
private var publisherView by mutableStateOf<View?>(null)
private var subscriberView by mutableStateOf<View?>(null)
  1. Finally, in the existing onCreate() method, initialize the VideoChatScreen view by adding it via the setContent() method call: