Is there something wrong with the code? Thanks for the help.
from livekit import rtc
import logging
import asyncio
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s [in %(pathname)s:%(lineno)d] - %(message)s',
)
URL = ''
TOKEN = ''
async def main():
room = rtc.Room()
@room.on("participant_connected")
def on_participant_connected(participant: rtc.RemoteParticipant):
logging.info(
"participant connected: %s %s", participant.sid, participant.identity)
# By default, autosubscribe is enabled. The participant will be subscribed to
# all published tracks in the room
await room.connect(URL, TOKEN)
logging.info("connected to room %s", room.name)
# participants and tracks that are already available in the room
# participant_connected and track_published events will *not* be emitted for them
for participant in room.participants.items():
for publication in participant.tracks.items():
print("track publication: %s", publication.sid)
input("press enter to exit")
await room.disconnect()
if __name__ == '__main__':
asyncio.run(main())
Server: 1.5.2 python: livekit 0.8.0 Can't see participant connected.
But from the logs in the package, it looks normal:
server log shows them in the same room:
Is there something wrong with the code? Thanks for the help.