Jellyfish Python Server SDK

Server Notifications

Jellyfish sends server side notifications whenever some important event occurs, e.g.:

  • a room has been created
  • a peer has connected
  • component has crashed
  • etc.

This is the list of all available notifications:

 1"""
 2.. include:: ../../docs/server_notifications.md
 3"""
 4
 5# Exported messages
 6from jellyfish.events._protos.jellyfish import (
 7    ServerMessageComponentCrashed,
 8    ServerMessageHlsPlayable,
 9    ServerMessageMetricsReport,
10    ServerMessagePeerAdded,
11    ServerMessagePeerConnected,
12    ServerMessagePeerCrashed,
13    ServerMessagePeerDeleted,
14    ServerMessagePeerDisconnected,
15    ServerMessageRoomCrashed,
16    ServerMessageRoomCreated,
17    ServerMessageRoomDeleted,
18    ServerMessageTrack,
19    ServerMessageTrackAdded,
20    ServerMessageTrackMetadataUpdated,
21    ServerMessageTrackRemoved,
22    ServerMessageTrackType,
23)
24
25__all__ = [
26    "ServerMessageRoomCreated",
27    "ServerMessageRoomDeleted",
28    "ServerMessageRoomCrashed",
29    "ServerMessagePeerAdded",
30    "ServerMessagePeerConnected",
31    "ServerMessagePeerDeleted",
32    "ServerMessagePeerDisconnected",
33    "ServerMessagePeerCrashed",
34    "ServerMessageComponentCrashed",
35    "ServerMessageTrack",
36    "ServerMessageTrackType",
37    "ServerMessageTrackAdded",
38    "ServerMessageTrackMetadataUpdated",
39    "ServerMessageTrackRemoved",
40    "ServerMessageHlsPlayable",
41    "ServerMessageMetricsReport",
42]
@dataclass(eq=False, repr=False)
class ServerMessageRoomCreated(betterproto.Message):
181@dataclass(eq=False, repr=False)
182class ServerMessageRoomCreated(betterproto.Message):
183    """Notification sent when a room is created"""
184
185    room_id: str = betterproto.string_field(1)

Notification sent when a room is created

ServerMessageRoomCreated(room_id: str = <object object>)
room_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageRoomDeleted(betterproto.Message):
188@dataclass(eq=False, repr=False)
189class ServerMessageRoomDeleted(betterproto.Message):
190    """Notification sent when a room is deleted"""
191
192    room_id: str = betterproto.string_field(1)

Notification sent when a room is deleted

ServerMessageRoomDeleted(room_id: str = <object object>)
room_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageRoomCrashed(betterproto.Message):
 97@dataclass(eq=False, repr=False)
 98class ServerMessageRoomCrashed(betterproto.Message):
 99    """Notification sent when a room crashes"""
100
101    room_id: str = betterproto.string_field(1)

Notification sent when a room crashes

ServerMessageRoomCrashed(room_id: str = <object object>)
room_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessagePeerAdded(betterproto.Message):
104@dataclass(eq=False, repr=False)
105class ServerMessagePeerAdded(betterproto.Message):
106    """Notification sent when a peer is added"""
107
108    room_id: str = betterproto.string_field(1)
109    peer_id: str = betterproto.string_field(2)

Notification sent when a peer is added

ServerMessagePeerAdded(room_id: str = <object object>, peer_id: str = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessagePeerConnected(betterproto.Message):
120@dataclass(eq=False, repr=False)
121class ServerMessagePeerConnected(betterproto.Message):
122    """Notification sent when a peer connects"""
123
124    room_id: str = betterproto.string_field(1)
125    peer_id: str = betterproto.string_field(2)

Notification sent when a peer connects

ServerMessagePeerConnected(room_id: str = <object object>, peer_id: str = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessagePeerDeleted(betterproto.Message):
112@dataclass(eq=False, repr=False)
113class ServerMessagePeerDeleted(betterproto.Message):
114    """Notification sent when a peer is removed"""
115
116    room_id: str = betterproto.string_field(1)
117    peer_id: str = betterproto.string_field(2)

Notification sent when a peer is removed

ServerMessagePeerDeleted(room_id: str = <object object>, peer_id: str = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessagePeerDisconnected(betterproto.Message):
128@dataclass(eq=False, repr=False)
129class ServerMessagePeerDisconnected(betterproto.Message):
130    """Notification sent when a peer disconnects from JF"""
131
132    room_id: str = betterproto.string_field(1)
133    peer_id: str = betterproto.string_field(2)

Notification sent when a peer disconnects from JF

ServerMessagePeerDisconnected(room_id: str = <object object>, peer_id: str = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessagePeerCrashed(betterproto.Message):
136@dataclass(eq=False, repr=False)
137class ServerMessagePeerCrashed(betterproto.Message):
138    """Notification sent when a peer crashes"""
139
140    room_id: str = betterproto.string_field(1)
141    peer_id: str = betterproto.string_field(2)
142    reason: str = betterproto.string_field(3)

Notification sent when a peer crashes

ServerMessagePeerCrashed( room_id: str = <object object>, peer_id: str = <object object>, reason: str = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
reason: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageComponentCrashed(betterproto.Message):
145@dataclass(eq=False, repr=False)
146class ServerMessageComponentCrashed(betterproto.Message):
147    """Notification sent when a component crashes"""
148
149    room_id: str = betterproto.string_field(1)
150    component_id: str = betterproto.string_field(2)

Notification sent when a component crashes

ServerMessageComponentCrashed(room_id: str = <object object>, component_id: str = <object object>)
room_id: str = <object object>
component_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageTrack(betterproto.Message):
235@dataclass(eq=False, repr=False)
236class ServerMessageTrack(betterproto.Message):
237    """Describes a media track"""
238
239    id: str = betterproto.string_field(1)
240    type: "ServerMessageTrackType" = betterproto.enum_field(2)
241    metadata: str = betterproto.string_field(3)

Describes a media track

ServerMessageTrack( id: str = <object object>, type: ServerMessageTrackType = <object object>, metadata: str = <object object>)
id: str = <object object>
type: ServerMessageTrackType = <object object>
metadata: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
class ServerMessageTrackType(betterproto.Enum):
20class ServerMessageTrackType(betterproto.Enum):
21    """Defines types of tracks being published by peers and component"""
22
23    TRACK_TYPE_UNSPECIFIED = 0
24    TRACK_TYPE_VIDEO = 1
25    TRACK_TYPE_AUDIO = 2

Defines types of tracks being published by peers and component

TRACK_TYPE_UNSPECIFIED = <ServerMessageTrackType.TRACK_TYPE_UNSPECIFIED: 0>
TRACK_TYPE_VIDEO = <ServerMessageTrackType.TRACK_TYPE_VIDEO: 1>
TRACK_TYPE_AUDIO = <ServerMessageTrackType.TRACK_TYPE_AUDIO: 2>
Inherited Members
betterproto.Enum
from_string
enum.Enum
name
value
builtins.int
conjugate
bit_length
to_bytes
from_bytes
as_integer_ratio
real
imag
numerator
denominator
@dataclass(eq=False, repr=False)
class ServerMessageTrackAdded(betterproto.Message):
244@dataclass(eq=False, repr=False)
245class ServerMessageTrackAdded(betterproto.Message):
246    """Notification sent when peer or component adds new track"""
247
248    room_id: str = betterproto.string_field(1)
249    peer_id: str = betterproto.string_field(2, group="endpoint_info")
250    component_id: str = betterproto.string_field(3, group="endpoint_info")
251    track: "ServerMessageTrack" = betterproto.message_field(4)

Notification sent when peer or component adds new track

ServerMessageTrackAdded( room_id: str = <object object>, peer_id: str = <object object>, component_id: str = <object object>, track: ServerMessageTrack = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
component_id: str = <object object>
track: ServerMessageTrack = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageTrackMetadataUpdated(betterproto.Message):
264@dataclass(eq=False, repr=False)
265class ServerMessageTrackMetadataUpdated(betterproto.Message):
266    """Notification sent when metadata of a multimedia track is updated"""
267
268    room_id: str = betterproto.string_field(1)
269    peer_id: str = betterproto.string_field(2, group="endpoint_info")
270    component_id: str = betterproto.string_field(3, group="endpoint_info")
271    track: "ServerMessageTrack" = betterproto.message_field(4)

Notification sent when metadata of a multimedia track is updated

ServerMessageTrackMetadataUpdated( room_id: str = <object object>, peer_id: str = <object object>, component_id: str = <object object>, track: ServerMessageTrack = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
component_id: str = <object object>
track: ServerMessageTrack = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageTrackRemoved(betterproto.Message):
254@dataclass(eq=False, repr=False)
255class ServerMessageTrackRemoved(betterproto.Message):
256    """Notification sent when a track is removed"""
257
258    room_id: str = betterproto.string_field(1)
259    peer_id: str = betterproto.string_field(2, group="endpoint_info")
260    component_id: str = betterproto.string_field(3, group="endpoint_info")
261    track: "ServerMessageTrack" = betterproto.message_field(4)

Notification sent when a track is removed

ServerMessageTrackRemoved( room_id: str = <object object>, peer_id: str = <object object>, component_id: str = <object object>, track: ServerMessageTrack = <object object>)
room_id: str = <object object>
peer_id: str = <object object>
component_id: str = <object object>
track: ServerMessageTrack = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageHlsPlayable(betterproto.Message):
202@dataclass(eq=False, repr=False)
203class ServerMessageHlsPlayable(betterproto.Message):
204    """Notification sent when the HLS stream becomes available in a room"""
205
206    room_id: str = betterproto.string_field(1)
207    component_id: str = betterproto.string_field(2)

Notification sent when the HLS stream becomes available in a room

ServerMessageHlsPlayable(room_id: str = <object object>, component_id: str = <object object>)
room_id: str = <object object>
component_id: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set
@dataclass(eq=False, repr=False)
class ServerMessageMetricsReport(betterproto.Message):
195@dataclass(eq=False, repr=False)
196class ServerMessageMetricsReport(betterproto.Message):
197    """Message containing WebRTC metrics from JF"""
198
199    metrics: str = betterproto.string_field(1)

Message containing WebRTC metrics from JF

ServerMessageMetricsReport(metrics: str = <object object>)
metrics: str = <object object>
Inherited Members
betterproto.Message
SerializeToString
parse
FromString
to_dict
from_dict
to_json
from_json
to_pydict
from_pydict
is_set