Sending a new signalling message peerLeft.
This commit is contained in:
@@ -43,6 +43,8 @@ class TrackStatusMessage(BaseModel):
|
|||||||
class RenegotiateMessage(BaseModel):
|
class RenegotiateMessage(BaseModel):
|
||||||
type: Literal["renegotiate"] = "renegotiate"
|
type: Literal["renegotiate"] = "renegotiate"
|
||||||
|
|
||||||
|
class PeerLeftMessage(BaseModel):
|
||||||
|
type: Literal["peerLeft"] = "peerLeft"
|
||||||
|
|
||||||
class SignallingMessage:
|
class SignallingMessage:
|
||||||
Inbound = Union[TrackStatusMessage] # in case we need to add new messages in the future
|
Inbound = Union[TrackStatusMessage] # in case we need to add new messages in the future
|
||||||
@@ -272,9 +274,9 @@ class SmallWebRTCConnection(BaseObject):
|
|||||||
logger.warning("Video transceiver not found. Cannot replace video track.")
|
logger.warning("Video transceiver not found. Cannot replace video track.")
|
||||||
|
|
||||||
async def disconnect(self):
|
async def disconnect(self):
|
||||||
# TODO: we should trigger something to know we are leaving
|
self.send_app_message(
|
||||||
# so the client does not try to reconnect
|
{"type": SIGNALLING_TYPE, "message": PeerLeftMessage().model_dump()}
|
||||||
# Like participant left
|
)
|
||||||
await self._close()
|
await self._close()
|
||||||
|
|
||||||
async def _close(self):
|
async def _close(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user