onMediaRelayRequestReceived

open fun onMediaRelayRequestReceived(participantId: String, roomId: String, displayName: String, accept: () -> Unit, reject: () -> Unit)

Called when another room asks to relay its media into this one. Nothing is relayed until you answer with accept or reject.

Both need a joined room. Because the app decides when to answer — usually when a user dismisses a dialog — the room may have ended or started reconnecting by then. The answer is then not sent, and the reason arrives on onError.

Code Example:

override fun onMediaRelayRequestReceived(
participantId: String, roomId: String, displayName: String,
accept: () -> Unit, reject: () -> Unit,
) {
showRelayDialog(displayName, onAccept = accept, onReject = reject)
}

Parameters

participantId

who made the request.

roomId

the requesting room's ID.

displayName

the requester's display name.

accept

accepts the relay; the relayed participants then arrive here through onParticipantJoined. onMediaRelayStarted fires in the requesting room, not this one.

reject

rejects the relay; the requesting room is told.