DataTrackPublished

class DataTrackPublished(val room: Room, val participant: RemoteParticipant, val track: RemoteDataTrack) : RoomEvent

A RemoteParticipant published a data track.

Fires for every track, including those already published when this participant was first seen and those reattached after a full reconnect.

Collect frames in a separate coroutine so this event collector is not blocked.

room.events.collect { event ->
if (event is RoomEvent.DataTrackPublished) {
scope.launch {
event.track.subscribe().onSuccess { stream ->
stream.flow.collect { frame -> process(frame.payload) }
}
}
}
}

Constructors

Link copied to clipboard
constructor(room: Room, participant: RemoteParticipant, track: RemoteDataTrack)

Properties

Link copied to clipboard
Link copied to clipboard
val room: Room
Link copied to clipboard