1010
1111async def main ():
1212 logging .basicConfig (level = logging .INFO )
13+ logger = logging .getLogger (__name__ )
1314 room = rtc .Room ()
1415
1516 @room .on ("participant_connected" )
1617 def on_participant_connected (participant : rtc .RemoteParticipant ):
17- logging .info (
18+ logger .info (
1819 "participant connected: %s %s" , participant .sid , participant .identity
1920 )
2021
@@ -30,15 +31,15 @@ def on_track_subscribed(
3031 publication : rtc .RemoteTrackPublication ,
3132 participant : rtc .RemoteParticipant ,
3233 ):
33- logging .info ("track subscribed: %s" , publication .sid )
34+ logger .info ("track subscribed: %s" , publication .sid )
3435 if track .kind == rtc .TrackKind .KIND_VIDEO :
3536 video_stream = rtc .VideoStream (track )
3637 asyncio .ensure_future (receive_frames (video_stream ))
3738
3839 # By default, autosubscribe is enabled. The participant will be subscribed to
3940 # all published tracks in the room
4041 await room .connect (URL , TOKEN )
41- logging .info ("connected to room %s" , room .name )
42+ logger .info ("connected to room %s" , room .name )
4243
4344 for identity , participant in room .remote_participants .items ():
4445 print (f"identity: { identity } " )
@@ -48,8 +49,10 @@ def on_track_subscribed(
4849 print (f"participant identity: { participant .identity } " )
4950 print (f"participant name: { participant .name } " )
5051 print (f"participant kind: { participant .kind } " )
51- print (f"participant track publications: {
52- participant .track_publications } " )
52+ print (
53+ f"participant track publications: {
54+ participant .track_publications } "
55+ )
5356 for tid , publication in participant .track_publications .items ():
5457 print (f"\t track id: { tid } " )
5558 print (f"\t \t track publication: { publication } " )
0 commit comments