few-analyst-46
08/29/2025, 9:25 AMtall-airline-16756
08/29/2025, 9:25 AMtall-airline-16756
08/29/2025, 9:26 AMfew-analyst-46
08/29/2025, 9:44 AMtall-airline-16756
08/29/2025, 9:45 AMdestination_identities
property of the TextStreamInfo
. This tells you which participants the stream is aimed at. If destination_identities
is empty, it means the stream is going out to everyone in the room. Otherwise, it lists the particular participant identities who will receive it.
Here’s a simple way to do this:
1. *Sending a text stream to specific people:*`writer = await room.localParticipant.stream_text(
topic="my-topic",
destination_identities=["user1", "user2"]
)`
2. *Handling an incoming text stream and checking who it’s for:*`def on_text_received(reader: rtc.TextStreamReader, participant_identity: str):
info = reader.info
if info.destination_identities:
print(f"Stream is directed to: {info.destination_identities}")
else:
print("Stream is broadcast to all participants")
# Process stream content
async for chunk in reader:
print(f"Received chunk: {chunk}")`
Don’t forget, you need to register your handler for the topic to actually receive those streams:
room.register_text_stream_handler(topic="my-topic", handler=on_text_received)
By checking out reader.info.destination_identities
, you’ll quickly see if the text stream is meant for certain participants or everyone in the room. Hope this helps!
Sources: Sending text | LiveKit Docs | livekit-rtc/livekit/rtc/participant.pyfew-analyst-46
08/29/2025, 10:19 AMtall-airline-16756
08/29/2025, 10:20 AM