Skip to content

Commit 6b7580d

Browse files
Handle room updates, move participant (#457)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 9e8a09b commit 6b7580d

File tree

7 files changed

+284
-142
lines changed

7 files changed

+284
-142
lines changed

examples/basic_room.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ def on_reconnecting() -> None:
117117
def on_reconnected() -> None:
118118
logging.info("reconnected")
119119

120+
@room.on("room_updated")
121+
def on_room_updated() -> None:
122+
logging.info(f"room updated, participants: {room.num_participants}")
123+
120124
token = (
121125
api.AccessToken()
122126
.with_identity("python-bot")
@@ -130,8 +134,8 @@ def on_reconnected() -> None:
130134
.to_jwt()
131135
)
132136
await room.connect(os.getenv("LIVEKIT_URL"), token)
133-
logging.info("connected to room %s", room.name)
134-
logging.info("participants: %s", room.remote_participants)
137+
logging.info(f"connected to room {room.name}, created {room.creation_time}")
138+
logging.info(f"participants: {room.remote_participants}")
135139

136140
await asyncio.sleep(2)
137141
await room.local_participant.publish_data("hello world")

livekit-rtc/livekit/rtc/_proto/participant_pb2.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-rtc/livekit/rtc/_proto/participant_pb2.pyi

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-rtc/livekit/rtc/_proto/room_pb2.py

Lines changed: 134 additions & 132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)