track

val track: MediaStreamTrack

The track to render.

For MediaType.VIDEO and MediaType.SHARE this is always a VideoTrack: cast it and pass it to VideoView.addTrack. The SDK picks the render path behind that cast, so the same code works for the local camera, a remote camera and a screen share.

For MediaType.AUDIO and MediaType.SHARE_AUDIO it is a handle, not something you can play — the SDK mixes and plays remote audio itself, and casting it to VideoTrack throws. Use it only to tell the streams apart.

Resolved on first read and then kept, so repeated reads return the same reference.