Kotlin

Provide Containers for Video Views

The Vonage SDK returns View objects for publisher and subscriber. The sample hosts them in FrameLayout containers created from Compose via AndroidView:

Pass the containers to your activity so it can add publisher and subscriber views when the session connects:

Attach the View When Ready

In onConnected, publish and attach the publisher view:

Subscribe when a remote stream arrives: