File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 1717
1818# flake8: noqa
1919# re-export packages from protocol
20- from livekit .protocol .egress import *
21- from livekit .protocol .ingress import *
22- from livekit .protocol .models import *
23- from livekit .protocol .room import *
24- from livekit .protocol .webhook import *
20+ from livekit .protocol .egress import * # type: ignore
21+ from livekit .protocol .ingress import * # type: ignore
22+ from livekit .protocol .models import * # type: ignore
23+ from livekit .protocol .room import * # type: ignore
24+ from livekit .protocol .webhook import * # type: ignore
2525
2626from .twirp_client import TwirpError , TwirpErrorCode
2727from .livekit_api import LiveKitAPI
Original file line number Diff line number Diff line change @@ -76,6 +76,16 @@ class RoomOptions:
7676 rtc_config : Optional [RtcConfiguration ] = None
7777
7878
79+ @dataclass
80+ class DataPacket :
81+ data : bytes
82+ kind : proto_room .DataPacketKind .ValueType
83+ participant : Optional [
84+ RemoteParticipant
85+ ] = None # None when the data has been sent by a server SDK
86+ topic : Optional [str ] = None
87+
88+
7989class ConnectError (Exception ):
8090 def __init__ (self , message : str ):
8191 self .message = message
@@ -372,10 +382,12 @@ def _on_room_event(self, event: proto_room.RoomEvent):
372382 rparticipant = self .participants [event .data_received .participant_sid ]
373383 self .emit (
374384 "data_received" ,
375- data ,
376- event .data_received .kind ,
377- rparticipant ,
378- event .data_received .topic ,
385+ DataPacket (
386+ data = data ,
387+ kind = event .data_received .kind ,
388+ participant = rparticipant ,
389+ topic = event .data_received .topic ,
390+ ),
379391 )
380392 elif which == "e2ee_state_changed" :
381393 sid = event .e2ee_state_changed .participant_sid
You can’t perform that action at this time.
0 commit comments