This message was deleted.
# helpdesk
s
This message was deleted.
e
This is for listening to the events emitted by the room. when a TrackSubscribed event is emitted, it calls the onTrackSubscribed function. For example, when a new video track comes in, you may want to show that one on screen.
s
Yea, I was using this is my application but while debugging I found out that the code is executing the else part, Hence I am not able to render the subscribed tracks. is it not auto subscribing?
I am able to join the room
@eager-raincoat-52616 is there any other way to render subscribed tracks?
e
are there no track subscribed events?
s
@eager-raincoat-52616 There are track subscribed events as I have one remote user join the same room with his video publishing.
@eager-raincoat-52616 how can I enable adaptive stream for my use case? or is it automatically enabled?
e
you can enable adaptive streaming by passing in custom RoomOptions when creating the room
s
Alright!
Copy code
private fun onTrackSubscribed(event: RoomEvent.TrackSubscribed){
    val track = event.track
    if (track is VideoTrack) {

        TimberJ.i("Arushi","onTrackSubscribed:RoomWrapper")
        attachVideo(track);
    }

    
}
@eager-raincoat-52616 should attachVideo be executed continuously as the video frames are subscribed in real time? As in my code it is executed only once.
e
attachVideo should only be called once to setup the video renderer to receive the frames from the track