From 7581893fe8cfd6988eae10da9226e31678c7fb39 Mon Sep 17 00:00:00 2001 From: p1003 Date: Wed, 3 Dec 2025 14:15:22 +0100 Subject: [PATCH 1/4] Python server SDK reference - WIP --- .gitignore | 1 + .gitmodules | 3 + docusaurus.config.ts | 11 + package.json | 5 +- scripts/generate_python_docs.sh | 24 + .../api/server-python/fishjam.md | 498 ++++++++++ .../api/server-python/fishjam/agent.md | 237 +++++ .../api/server-python/fishjam/errors.md | 59 ++ .../api/server-python/fishjam/events.md | 863 ++++++++++++++++++ .../api/server-python/fishjam/peer.md | 100 ++ .../api/server-python/fishjam/room.md | 171 ++++ .../api/server-python/fishjam.md | 498 ++++++++++ .../api/server-python/fishjam/agent.md | 237 +++++ .../api/server-python/fishjam/errors.md | 59 ++ .../api/server-python/fishjam/events.md | 863 ++++++++++++++++++ .../api/server-python/fishjam/peer.md | 100 ++ .../api/server-python/fishjam/room.md | 171 ++++ .../api/server-python/fishjam.md | 498 ++++++++++ .../api/server-python/fishjam/agent.md | 237 +++++ .../api/server-python/fishjam/errors.md | 59 ++ .../api/server-python/fishjam/events.md | 863 ++++++++++++++++++ .../api/server-python/fishjam/peer.md | 100 ++ .../api/server-python/fishjam/room.md | 171 ++++ .../api/server-python/fishjam.md | 498 ++++++++++ .../api/server-python/fishjam/agent.md | 237 +++++ .../api/server-python/fishjam/errors.md | 59 ++ .../api/server-python/fishjam/events.md | 863 ++++++++++++++++++ .../api/server-python/fishjam/peer.md | 100 ++ .../api/server-python/fishjam/room.md | 171 ++++ 29 files changed, 7754 insertions(+), 2 deletions(-) create mode 100755 scripts/generate_python_docs.sh create mode 100644 versioned_docs/version-0.20.0/api/server-python/fishjam.md create mode 100644 versioned_docs/version-0.20.0/api/server-python/fishjam/agent.md create mode 100644 versioned_docs/version-0.20.0/api/server-python/fishjam/errors.md create mode 100644 versioned_docs/version-0.20.0/api/server-python/fishjam/events.md create mode 100644 versioned_docs/version-0.20.0/api/server-python/fishjam/peer.md create mode 100644 versioned_docs/version-0.20.0/api/server-python/fishjam/room.md create mode 100644 versioned_docs/version-0.21.0/api/server-python/fishjam.md create mode 100644 versioned_docs/version-0.21.0/api/server-python/fishjam/agent.md create mode 100644 versioned_docs/version-0.21.0/api/server-python/fishjam/errors.md create mode 100644 versioned_docs/version-0.21.0/api/server-python/fishjam/events.md create mode 100644 versioned_docs/version-0.21.0/api/server-python/fishjam/peer.md create mode 100644 versioned_docs/version-0.21.0/api/server-python/fishjam/room.md create mode 100644 versioned_docs/version-0.22.0/api/server-python/fishjam.md create mode 100644 versioned_docs/version-0.22.0/api/server-python/fishjam/agent.md create mode 100644 versioned_docs/version-0.22.0/api/server-python/fishjam/errors.md create mode 100644 versioned_docs/version-0.22.0/api/server-python/fishjam/events.md create mode 100644 versioned_docs/version-0.22.0/api/server-python/fishjam/peer.md create mode 100644 versioned_docs/version-0.22.0/api/server-python/fishjam/room.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/fishjam.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/fishjam/agent.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/fishjam/errors.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/fishjam/events.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/fishjam/peer.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/fishjam/room.md diff --git a/.gitignore b/.gitignore index 4a6c6459..e867858d 100644 --- a/.gitignore +++ b/.gitignore @@ -137,5 +137,6 @@ build docs/api/mobile/** docs/api/web/** docs/api/server/** +docs/api/server-python/** .cursor/ diff --git a/.gitmodules b/.gitmodules index bbecf2c7..6c7a308b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "api/room-manager"] path = api/room-manager url = git@github.com:fishjam-cloud/room-manager.git +[submodule "packages/python-server-sdk"] + path = packages/python-server-sdk + url = https://github.com/fishjam-cloud/python-server-sdk.git diff --git a/docusaurus.config.ts b/docusaurus.config.ts index fc5a625a..afb3f64b 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -90,6 +90,17 @@ function injectTypeDocSidebar( `${version.contentPath}/api/server/typedoc-sidebar.cjs`, ), }, + { + type: "category", + label: "Server SDK for Python", + link: { type: "doc", id: "api/server-python/fishjam" }, + items: [ + { + type: "autogenerated", + dirName: "api/server-python", + }, + ], + }, ] as const), ...item.items.filter((element) => element.type == "doc"), ], diff --git a/package.json b/package.json index f7194c7d..e10b7701 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "start": "docusaurus start", - "build": "docusaurus build", + "generate:python:docs": "sh ./scripts/generate_python_docs.sh", + "start": "npm run generate:python:docs && docusaurus start", + "build": "npm run generate:python:docs && docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", diff --git a/scripts/generate_python_docs.sh b/scripts/generate_python_docs.sh new file mode 100755 index 00000000..9bf135fe --- /dev/null +++ b/scripts/generate_python_docs.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +ROOTDIR=$(dirname $(dirname "$(readlink -f $0)")) +echo $ROOTDIR +cd $ROOTDIR + + +# cd packages/python-server-sdk +# uv run generate_docs + +# cd $ROOTDIR +# rm packages/python-server-sdk/docs/api/index.md +# cp -r packages/python-server-sdk/docs/api docs/api/server-python +rm -rf versioned_docs/version-0.20.0/api/server-python +rm -rf versioned_docs/version-0.21.0/api/server-python +rm -rf versioned_docs/version-0.22.0/api/server-python +rm -rf versioned_docs/version-0.23.0/api/server-python + +cp -r docs/api/server-python versioned_docs/version-0.20.0/api/server-python +cp -r docs/api/server-python versioned_docs/version-0.21.0/api/server-python +cp -r docs/api/server-python versioned_docs/version-0.22.0/api/server-python +cp -r docs/api/server-python versioned_docs/version-0.23.0/api/server-python diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam.md b/versioned_docs/version-0.20.0/api/server-python/fishjam.md new file mode 100644 index 00000000..1a6d1da2 --- /dev/null +++ b/versioned_docs/version-0.20.0/api/server-python/fishjam.md @@ -0,0 +1,498 @@ +--- +title: fishjam +sidebar_label: fishjam +custom_edit_url: null +--- + +# fishjam + + +## Submodules +- [events](fishjam/events) +- [errors](fishjam/errors) +- [room](fishjam/room) +- [peer](fishjam/peer) +- [agent](fishjam/agent) + +## FishjamClient +```python +class FishjamClient(fishjam.api._client.Client): +``` +Allows for managing rooms + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create a FishjamClient instance, providing the fishjam id and management token. + +### create_peer +```python +def create_peer( + self, + room_id: str, + options: fishjam.api._fishjam_client.PeerOptions | None = None +) -> tuple[fishjam._openapi_client.models.peer.Peer, str] +``` +Creates peer in the room + +Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer +to authenticate to Fishjam. + +The possible options to pass for peer are `PeerOptions`. + +### create_agent +```python +def create_agent( + self, + room_id: str, + options: fishjam.api._fishjam_client.AgentOptions | None = None +) +``` + + +### create_room +```python +def create_room( + self, + options: fishjam.api._fishjam_client.RoomOptions | None = None +) -> fishjam.api._fishjam_client.Room +``` +Creates a new room +Returns the created `Room` + +### get_all_rooms +```python +def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +``` +Returns list of all rooms + +### get_room +```python +def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +``` +Returns room with the given id + +### delete_peer +```python +def delete_peer(self, room_id: str, peer_id: str) -> None +``` +Deletes peer + +### delete_room +```python +def delete_room(self, room_id: str) -> None +``` +Deletes a room + +### refresh_peer_token +```python +def refresh_peer_token(self, room_id: str, peer_id: str) -> str +``` +Refreshes peer token + +### create_livestream_viewer_token +```python +def create_livestream_viewer_token(self, room_id: str) -> str +``` +Generates viewer token for livestream rooms + +### create_livestream_streamer_token +```python +def create_livestream_streamer_token(self, room_id: str) -> str +``` +Generates streamer token for livestream rooms + +### subscribe_peer +```python +def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) +``` +Subscribe a peer to all tracks of another peer. + +### subscribe_tracks +```python +def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) +``` +Subscribe a peer to specific tracks of another peer. + +#### Inherited Members +* **Client**: + * `client` +--- +## FishjamNotifier +```python +class FishjamNotifier: +``` +Allows for receiving WebSocket messages from Fishjam. + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create FishjamNotifier instance, providing the fishjam id and management token. + +### on_server_notification +```python +def on_server_notification( + self, + handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] +) +``` +Decorator used for defining handler for Fishjam Notifications + +### connect +```python +def connect(self) +``` +A coroutine which connects FishjamNotifier to Fishjam and listens for +all incoming messages from the Fishjam. + +It runs until the connection isn't closed. + +The incoming messages are handled by the functions defined using the +`on_server_notification` decorator. + +The handler have to be defined before calling `connect`, +otherwise the messages won't be received. + +### wait_ready +```python +def wait_ready(self) -> None +``` +Waits until the notifier is connected and authenticated to Fishjam. + +If already connected, returns immediately. + +--- +## receive_binary +```python +def receive_binary( + binary: bytes +) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +``` +Transform received protobuf notification to adequate notification instance. +The available notifications are listed in `fishjam.events` module. + +--- +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerOptions +```python +class PeerOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + enable_simulcast: bool = True, + metadata: dict[str, typing.Any] | None = None, + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### enable_simulcast +```python +enable_simulcast: : bool = True + +``` +Enables the peer to use simulcast + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Peer metadata + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` +Configuration of peer's subscribing policy + +--- +## RoomOptions +```python +class RoomOptions: +``` +Description of a room options + +### __init__ +```python +def __init__( + max_peers: int | None = None, + video_codec: Optional[Literal['h264', 'vp8']] = None, + webhook_url: str | None = None, + room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', + public: bool = False +) +``` + + +### max_peers +```python +max_peers: : int | None = None + +``` +Maximum amount of peers allowed into the room + +### video_codec +```python +video_codec: : Optional[Literal['h264', 'vp8']] = None + +``` +Enforces video codec for each peer in the room + +### webhook_url +```python +webhook_url: : str | None = None + +``` +URL where Fishjam notifications will be sent + +### room_type +```python +room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' + +``` +The use-case of the room. If not provided, this defaults to conference. + +### public +```python +public: : bool = False + +``` +True if livestream viewers can omit specifying a token. + +--- +## AgentOptions +```python +class AgentOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + output: fishjam.api._fishjam_client.AgentOutputOptions = , + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### output +```python +output: : fishjam.api._fishjam_client.AgentOutputOptions +``` + + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` + + +--- +## AgentOutputOptions +```python +class AgentOutputOptions: +``` +Options of the desired format of audio tracks going from Fishjam to the agent. + +### __init__ +```python +def __init__( + audio_format: Literal['pcm16'] = 'pcm16', + audio_sample_rate: Literal[16000, 24000] = 16000 +) +``` + + +### audio_format +```python +audio_format: : Literal['pcm16'] = 'pcm16' + +``` + + +### audio_sample_rate +```python +audio_sample_rate: : Literal[16000, 24000] = 16000 + +``` + + +--- +## Room +```python +class Room: +``` +Description of the room state + +### __init__ +```python +def __init__( + config: fishjam._openapi_client.models.room_config.RoomConfig, + id: str, + peers: list[fishjam._openapi_client.models.peer.Peer] +) +``` + + +### config +```python +config: : fishjam._openapi_client.models.room_config.RoomConfig +``` +Room configuration + +### id +```python +id: : str +``` +Room ID + +### peers +```python +peers: : list[fishjam._openapi_client.models.peer.Peer] +``` +List of all peers + +--- +## Peer +```python +class Peer: +``` +Describes peer status + +Attributes: + id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. + metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. + status (PeerStatus): Informs about the peer status Example: disconnected. + subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy + subscriptions (Subscriptions): Describes peer's subscriptions in manual mode + tracks (list['Track']): List of all peer's tracks + type_ (PeerType): Peer type Example: webrtc. + +### __init__ +```python +def __init__( + id: str, + metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], + status: fishjam._openapi_client.models.peer_status.PeerStatus, + subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, + subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, + tracks: list[fishjam._openapi_client.models.track.Track], + type_: fishjam._openapi_client.models.peer_type.PeerType +) +``` +Method generated by attrs for class Peer. + +### id +```python +id: : str +``` + + +### metadata +```python +metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +``` + + +### status +```python +status: : fishjam._openapi_client.models.peer_status.PeerStatus +``` + + +### subscribe_mode +```python +subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +``` + + +### subscriptions +```python +subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +``` + + +### tracks +```python +tracks: : list[fishjam._openapi_client.models.track.Track] +``` + + +### type_ +```python +type_: : fishjam._openapi_client.models.peer_type.PeerType +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/agent.md b/versioned_docs/version-0.20.0/api/server-python/fishjam/agent.md new file mode 100644 index 00000000..56cccf28 --- /dev/null +++ b/versioned_docs/version-0.20.0/api/server-python/fishjam/agent.md @@ -0,0 +1,237 @@ +--- +title: agent +sidebar_label: agent +custom_edit_url: null +--- + +# agent + + + +## Agent +```python +class Agent: +``` +Allows for connecting to a Fishjam room as an agent peer. +Provides callbacks for receiving audio. + +### __init__ +```python +def __init__(id: str, room_id: str, token: str, fishjam_url: str) +``` +Create Agent instance, providing the fishjam id and management token. + +This constructor should not be called directly. +Instead, you should call :func:`fishjam.FishjamClient.create_agent`. + +### id +```python +id +``` + + +### room_id +```python +room_id +``` + + +### connect +```python +def connect(self) +``` +Connect the agent to Fishjam to start receiving messages. + +Incoming messages from Fishjam will be routed to handlers +defined with :func:`on_track_data`. + +:raises AgentAuthError: authentication failed + +--- +## AgentError +```python +class AgentError(builtins.Exception): +``` +Base exception class for all agent exceptions + +--- +## AgentSession +```python +class AgentSession: +``` + + +### __init__ +```python +def __init__( + agent: fishjam.agent.agent.Agent, + websocket: websockets.asyncio.client.ClientConnection +) +``` + + +### agent +```python +agent +``` + + +### receive +```python +def receive( + self +) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +``` +Returns an infinite async iterator over the incoming messages from Fishjam to +the agent. + +### add_track +```python +def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) +``` +Adds a track to the connected agent, with the specified options and metadata. + +Returns an instance of :class:`OutgoingTrack`, which can be used to send data +over the added track. + +### disconnect +```python +def disconnect(self) +``` +Ends the agent session by closing the websocket connection. +Useful when you don't use the context manager to obtain the session. + +--- +## AgentAuthError +```python +class AgentAuthError(fishjam.agent.errors.AgentError): +``` +Agent failed to authenticate properly + +### __init__ +```python +def __init__(reason: str) +``` + + +### reason +```python +reason +``` + + +--- +## IncomingTrackData +```python +IncomingTrackData = + +``` + + +--- +## OutgoingTrack +```python +class OutgoingTrack: +``` +Represents an outgoing track of an agent connected to Fishjam, +created by :func:`Agent.add_track`. + +### __init__ +```python +def __init__( + id: str, + session: fishjam.agent.agent.AgentSession, + options: fishjam.agent.agent.OutgoingAudioTrackOptions +) +``` + + +### id +```python +id: : str +``` +The global identifier of the track. + +### session +```python +session: : fishjam.agent.agent.AgentSession +``` +The agent the track belongs to. + +### options +```python +options: : fishjam.agent.agent.OutgoingAudioTrackOptions +``` +The parameters used to create the track. + +### send_chunk +```python +def send_chunk(self, data: bytes) +``` +Send a chunk of audio to Fishjam on this track. + +Peers connected to the room of the agent will receive this data. + +### interrupt +```python +def interrupt(self) +``` +Interrupt current track. + +Any audio that has been sent, but not played +will be cleared and be prevented from playing. + +Audio sent after the interrupt will be played normally. + +--- +## OutgoingAudioTrackOptions +```python +class OutgoingAudioTrackOptions: +``` +Parameters of an outgoing audio track. + +### __init__ +```python +def __init__( + encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + sample_rate: Literal[16000, 24000] = 16000, + channels: Literal[1, 2] = 1, + metadata: dict[str, typing.Any] | None = None +) +``` + + +### encoding +```python +encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = + +``` +The encoding of the audio source. +Defaults to raw 16-bit PCM. + +### sample_rate +```python +sample_rate: : Literal[16000, 24000] = 16000 + +``` +The sample rate of the audio source. +Defaults to 16000. + +### channels +```python +channels: : Literal[1, 2] = 1 + +``` +The number of channels in the audio source. +Supported values are 1 (mono) and 2 (stereo). +Defaults to 1 (mono) + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Custom metadata for the track. +Must be JSON-encodable. + +--- diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/errors.md b/versioned_docs/version-0.20.0/api/server-python/fishjam/errors.md new file mode 100644 index 00000000..0d719368 --- /dev/null +++ b/versioned_docs/version-0.20.0/api/server-python/fishjam/errors.md @@ -0,0 +1,59 @@ +--- +title: errors +sidebar_label: errors +custom_edit_url: null +--- + +# errors + + + +## HTTPError +```python +class HTTPError(builtins.Exception): +``` + + +--- +## BadRequestError +```python +class BadRequestError(HTTPError): +``` + + +--- +## UnauthorizedError +```python +class UnauthorizedError(HTTPError): +``` + + +--- +## NotFoundError +```python +class NotFoundError(HTTPError): +``` + + +--- +## ServiceUnavailableError +```python +class ServiceUnavailableError(HTTPError): +``` + + +--- +## InternalServerError +```python +class InternalServerError(HTTPError): +``` + + +--- +## ConflictError +```python +class ConflictError(HTTPError): +``` + + +--- diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/events.md b/versioned_docs/version-0.20.0/api/server-python/fishjam/events.md new file mode 100644 index 00000000..052ec540 --- /dev/null +++ b/versioned_docs/version-0.20.0/api/server-python/fishjam/events.md @@ -0,0 +1,863 @@ +--- +title: events +sidebar_label: events +custom_edit_url: null +--- + +# events + + + +## ServerMessageRoomCreated +```python +class ServerMessageRoomCreated(betterproto.Message): +``` +Notification sent when a room is created + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomDeleted +```python +class ServerMessageRoomDeleted(betterproto.Message): +``` +Notification sent when a room is deleted + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomCrashed +```python +class ServerMessageRoomCrashed(betterproto.Message): +``` +Notification sent when a room crashes + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerAdded +```python +class ServerMessagePeerAdded(betterproto.Message): +``` +Notification sent when a peer is added + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerConnected +```python +class ServerMessagePeerConnected(betterproto.Message): +``` +Notification sent when a peer connects + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDeleted +```python +class ServerMessagePeerDeleted(betterproto.Message): +``` +Notification sent when a peer is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDisconnected +```python +class ServerMessagePeerDisconnected(betterproto.Message): +``` +Notification sent when a peer disconnects from FJ + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerMetadataUpdated +```python +class ServerMessagePeerMetadataUpdated(betterproto.Message): +``` +Notification sent when peer updates its metadata + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + metadata: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### metadata +```python +metadata: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerCrashed +```python +class ServerMessagePeerCrashed(betterproto.Message): +``` +Notification sent when a peer crashes + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + reason: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### reason +```python +reason: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamConnected +```python +class ServerMessageStreamConnected(betterproto.Message): +``` +Notification sent when streamer successfully connects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamDisconnected +```python +class ServerMessageStreamDisconnected(betterproto.Message): +``` +Notification sent when streamer disconnects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackAdded +```python +class ServerMessageTrackAdded(betterproto.Message): +``` +Notification sent when peer or component adds new track + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackMetadataUpdated +```python +class ServerMessageTrackMetadataUpdated(betterproto.Message): +``` +Notification sent when metadata of a multimedia track is updated + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackRemoved +```python +class ServerMessageTrackRemoved(betterproto.Message): +``` +Notification sent when a track is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerConnected +```python +class ServerMessageViewerConnected(betterproto.Message): +``` +Notification sent when viewer successfully connects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerDisconnected +```python +class ServerMessageViewerDisconnected(betterproto.Message): +``` +Notification sent when viewer disconnects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## Track +```python +class Track(betterproto.Message): +``` +Describes a media track + +### __init__ +```python +def __init__( + id: str = , + type: fishjam.events._protos.fishjam.notifications.TrackType = , + metadata: str = +) +``` + + +### id +```python +id: : str +``` + + +### type +```python +type: : fishjam.events._protos.fishjam.notifications.TrackType +``` + + +### metadata +```python +metadata: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## TrackEncoding +```python +class TrackEncoding(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### TRACK_ENCODING_UNSPECIFIED +```python +TRACK_ENCODING_UNSPECIFIED = + +``` + + +### TRACK_ENCODING_PCM16 +```python +TRACK_ENCODING_PCM16 = + +``` + + +### TRACK_ENCODING_OPUS +```python +TRACK_ENCODING_OPUS = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## TrackType +```python +class TrackType(betterproto.Enum): +``` +Defines types of tracks being published by peers and component + +### TRACK_TYPE_UNSPECIFIED +```python +TRACK_TYPE_UNSPECIFIED = + +``` + + +### TRACK_TYPE_VIDEO +```python +TRACK_TYPE_VIDEO = + +``` + + +### TRACK_TYPE_AUDIO +```python +TRACK_TYPE_AUDIO = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## ServerMessagePeerType +```python +class ServerMessagePeerType(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### PEER_TYPE_UNSPECIFIED +```python +PEER_TYPE_UNSPECIFIED = + +``` + + +### PEER_TYPE_WEBRTC +```python +PEER_TYPE_WEBRTC = + +``` + + +### PEER_TYPE_AGENT +```python +PEER_TYPE_AGENT = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/peer.md b/versioned_docs/version-0.20.0/api/server-python/fishjam/peer.md new file mode 100644 index 00000000..4a5e0fcc --- /dev/null +++ b/versioned_docs/version-0.20.0/api/server-python/fishjam/peer.md @@ -0,0 +1,100 @@ +--- +title: peer +sidebar_label: peer +custom_edit_url: null +--- + +# peer + + + +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerStatus +```python +class PeerStatus(builtins.str, enum.Enum): +``` +Informs about the peer status + +### CONNECTED +```python +CONNECTED = + +``` + + +### DISCONNECTED +```python +DISCONNECTED = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## PeerType +```python +class PeerType(builtins.str, enum.Enum): +``` +Peer type + +### AGENT +```python +AGENT = + +``` + + +### WEBRTC +```python +WEBRTC = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/room.md b/versioned_docs/version-0.20.0/api/server-python/fishjam/room.md new file mode 100644 index 00000000..53847c63 --- /dev/null +++ b/versioned_docs/version-0.20.0/api/server-python/fishjam/room.md @@ -0,0 +1,171 @@ +--- +title: room +sidebar_label: room +custom_edit_url: null +--- + +# room + + + +## RoomConfig +```python +class RoomConfig: +``` +Room configuration + +Attributes: + max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. + public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. + room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to + conference. Default: RoomConfigRoomType.CONFERENCE. + video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: + RoomConfigVideoCodec.H264. + webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: + https://backend.address.com/fishjam-notifications-endpoint. + +### __init__ +```python +def __init__( + max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , + public: Union[fishjam._openapi_client.types.Unset, bool] = False, + room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , + video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = +) +``` +Method generated by attrs for class RoomConfig. + +### max_peers +```python +max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +``` + + +### public +```python +public: : Union[fishjam._openapi_client.types.Unset, bool] +``` + + +### room_type +```python +room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +``` + + +### video_codec +```python +video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +``` + + +### webhook_url +```python +webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## RoomConfigVideoCodec +```python +class RoomConfigVideoCodec(builtins.str, enum.Enum): +``` +Enforces video codec for each peer in the room + +### H264 +```python +H264 = + +``` + + +### VP8 +```python +VP8 = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## RoomConfigRoomType +```python +class RoomConfigRoomType(builtins.str, enum.Enum): +``` +The use-case of the room. If not provided, this defaults to conference. + +### AUDIO_ONLY +```python +AUDIO_ONLY = + +``` + + +### AUDIO_ONLY_LIVESTREAM +```python +AUDIO_ONLY_LIVESTREAM = + +``` + + +### BROADCASTER +```python +BROADCASTER = + +``` + + +### CONFERENCE +```python +CONFERENCE = + +``` + + +### FULL_FEATURE +```python +FULL_FEATURE = + +``` + + +### LIVESTREAM +```python +LIVESTREAM = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam.md b/versioned_docs/version-0.21.0/api/server-python/fishjam.md new file mode 100644 index 00000000..1a6d1da2 --- /dev/null +++ b/versioned_docs/version-0.21.0/api/server-python/fishjam.md @@ -0,0 +1,498 @@ +--- +title: fishjam +sidebar_label: fishjam +custom_edit_url: null +--- + +# fishjam + + +## Submodules +- [events](fishjam/events) +- [errors](fishjam/errors) +- [room](fishjam/room) +- [peer](fishjam/peer) +- [agent](fishjam/agent) + +## FishjamClient +```python +class FishjamClient(fishjam.api._client.Client): +``` +Allows for managing rooms + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create a FishjamClient instance, providing the fishjam id and management token. + +### create_peer +```python +def create_peer( + self, + room_id: str, + options: fishjam.api._fishjam_client.PeerOptions | None = None +) -> tuple[fishjam._openapi_client.models.peer.Peer, str] +``` +Creates peer in the room + +Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer +to authenticate to Fishjam. + +The possible options to pass for peer are `PeerOptions`. + +### create_agent +```python +def create_agent( + self, + room_id: str, + options: fishjam.api._fishjam_client.AgentOptions | None = None +) +``` + + +### create_room +```python +def create_room( + self, + options: fishjam.api._fishjam_client.RoomOptions | None = None +) -> fishjam.api._fishjam_client.Room +``` +Creates a new room +Returns the created `Room` + +### get_all_rooms +```python +def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +``` +Returns list of all rooms + +### get_room +```python +def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +``` +Returns room with the given id + +### delete_peer +```python +def delete_peer(self, room_id: str, peer_id: str) -> None +``` +Deletes peer + +### delete_room +```python +def delete_room(self, room_id: str) -> None +``` +Deletes a room + +### refresh_peer_token +```python +def refresh_peer_token(self, room_id: str, peer_id: str) -> str +``` +Refreshes peer token + +### create_livestream_viewer_token +```python +def create_livestream_viewer_token(self, room_id: str) -> str +``` +Generates viewer token for livestream rooms + +### create_livestream_streamer_token +```python +def create_livestream_streamer_token(self, room_id: str) -> str +``` +Generates streamer token for livestream rooms + +### subscribe_peer +```python +def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) +``` +Subscribe a peer to all tracks of another peer. + +### subscribe_tracks +```python +def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) +``` +Subscribe a peer to specific tracks of another peer. + +#### Inherited Members +* **Client**: + * `client` +--- +## FishjamNotifier +```python +class FishjamNotifier: +``` +Allows for receiving WebSocket messages from Fishjam. + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create FishjamNotifier instance, providing the fishjam id and management token. + +### on_server_notification +```python +def on_server_notification( + self, + handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] +) +``` +Decorator used for defining handler for Fishjam Notifications + +### connect +```python +def connect(self) +``` +A coroutine which connects FishjamNotifier to Fishjam and listens for +all incoming messages from the Fishjam. + +It runs until the connection isn't closed. + +The incoming messages are handled by the functions defined using the +`on_server_notification` decorator. + +The handler have to be defined before calling `connect`, +otherwise the messages won't be received. + +### wait_ready +```python +def wait_ready(self) -> None +``` +Waits until the notifier is connected and authenticated to Fishjam. + +If already connected, returns immediately. + +--- +## receive_binary +```python +def receive_binary( + binary: bytes +) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +``` +Transform received protobuf notification to adequate notification instance. +The available notifications are listed in `fishjam.events` module. + +--- +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerOptions +```python +class PeerOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + enable_simulcast: bool = True, + metadata: dict[str, typing.Any] | None = None, + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### enable_simulcast +```python +enable_simulcast: : bool = True + +``` +Enables the peer to use simulcast + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Peer metadata + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` +Configuration of peer's subscribing policy + +--- +## RoomOptions +```python +class RoomOptions: +``` +Description of a room options + +### __init__ +```python +def __init__( + max_peers: int | None = None, + video_codec: Optional[Literal['h264', 'vp8']] = None, + webhook_url: str | None = None, + room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', + public: bool = False +) +``` + + +### max_peers +```python +max_peers: : int | None = None + +``` +Maximum amount of peers allowed into the room + +### video_codec +```python +video_codec: : Optional[Literal['h264', 'vp8']] = None + +``` +Enforces video codec for each peer in the room + +### webhook_url +```python +webhook_url: : str | None = None + +``` +URL where Fishjam notifications will be sent + +### room_type +```python +room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' + +``` +The use-case of the room. If not provided, this defaults to conference. + +### public +```python +public: : bool = False + +``` +True if livestream viewers can omit specifying a token. + +--- +## AgentOptions +```python +class AgentOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + output: fishjam.api._fishjam_client.AgentOutputOptions = , + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### output +```python +output: : fishjam.api._fishjam_client.AgentOutputOptions +``` + + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` + + +--- +## AgentOutputOptions +```python +class AgentOutputOptions: +``` +Options of the desired format of audio tracks going from Fishjam to the agent. + +### __init__ +```python +def __init__( + audio_format: Literal['pcm16'] = 'pcm16', + audio_sample_rate: Literal[16000, 24000] = 16000 +) +``` + + +### audio_format +```python +audio_format: : Literal['pcm16'] = 'pcm16' + +``` + + +### audio_sample_rate +```python +audio_sample_rate: : Literal[16000, 24000] = 16000 + +``` + + +--- +## Room +```python +class Room: +``` +Description of the room state + +### __init__ +```python +def __init__( + config: fishjam._openapi_client.models.room_config.RoomConfig, + id: str, + peers: list[fishjam._openapi_client.models.peer.Peer] +) +``` + + +### config +```python +config: : fishjam._openapi_client.models.room_config.RoomConfig +``` +Room configuration + +### id +```python +id: : str +``` +Room ID + +### peers +```python +peers: : list[fishjam._openapi_client.models.peer.Peer] +``` +List of all peers + +--- +## Peer +```python +class Peer: +``` +Describes peer status + +Attributes: + id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. + metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. + status (PeerStatus): Informs about the peer status Example: disconnected. + subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy + subscriptions (Subscriptions): Describes peer's subscriptions in manual mode + tracks (list['Track']): List of all peer's tracks + type_ (PeerType): Peer type Example: webrtc. + +### __init__ +```python +def __init__( + id: str, + metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], + status: fishjam._openapi_client.models.peer_status.PeerStatus, + subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, + subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, + tracks: list[fishjam._openapi_client.models.track.Track], + type_: fishjam._openapi_client.models.peer_type.PeerType +) +``` +Method generated by attrs for class Peer. + +### id +```python +id: : str +``` + + +### metadata +```python +metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +``` + + +### status +```python +status: : fishjam._openapi_client.models.peer_status.PeerStatus +``` + + +### subscribe_mode +```python +subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +``` + + +### subscriptions +```python +subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +``` + + +### tracks +```python +tracks: : list[fishjam._openapi_client.models.track.Track] +``` + + +### type_ +```python +type_: : fishjam._openapi_client.models.peer_type.PeerType +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/agent.md b/versioned_docs/version-0.21.0/api/server-python/fishjam/agent.md new file mode 100644 index 00000000..56cccf28 --- /dev/null +++ b/versioned_docs/version-0.21.0/api/server-python/fishjam/agent.md @@ -0,0 +1,237 @@ +--- +title: agent +sidebar_label: agent +custom_edit_url: null +--- + +# agent + + + +## Agent +```python +class Agent: +``` +Allows for connecting to a Fishjam room as an agent peer. +Provides callbacks for receiving audio. + +### __init__ +```python +def __init__(id: str, room_id: str, token: str, fishjam_url: str) +``` +Create Agent instance, providing the fishjam id and management token. + +This constructor should not be called directly. +Instead, you should call :func:`fishjam.FishjamClient.create_agent`. + +### id +```python +id +``` + + +### room_id +```python +room_id +``` + + +### connect +```python +def connect(self) +``` +Connect the agent to Fishjam to start receiving messages. + +Incoming messages from Fishjam will be routed to handlers +defined with :func:`on_track_data`. + +:raises AgentAuthError: authentication failed + +--- +## AgentError +```python +class AgentError(builtins.Exception): +``` +Base exception class for all agent exceptions + +--- +## AgentSession +```python +class AgentSession: +``` + + +### __init__ +```python +def __init__( + agent: fishjam.agent.agent.Agent, + websocket: websockets.asyncio.client.ClientConnection +) +``` + + +### agent +```python +agent +``` + + +### receive +```python +def receive( + self +) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +``` +Returns an infinite async iterator over the incoming messages from Fishjam to +the agent. + +### add_track +```python +def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) +``` +Adds a track to the connected agent, with the specified options and metadata. + +Returns an instance of :class:`OutgoingTrack`, which can be used to send data +over the added track. + +### disconnect +```python +def disconnect(self) +``` +Ends the agent session by closing the websocket connection. +Useful when you don't use the context manager to obtain the session. + +--- +## AgentAuthError +```python +class AgentAuthError(fishjam.agent.errors.AgentError): +``` +Agent failed to authenticate properly + +### __init__ +```python +def __init__(reason: str) +``` + + +### reason +```python +reason +``` + + +--- +## IncomingTrackData +```python +IncomingTrackData = + +``` + + +--- +## OutgoingTrack +```python +class OutgoingTrack: +``` +Represents an outgoing track of an agent connected to Fishjam, +created by :func:`Agent.add_track`. + +### __init__ +```python +def __init__( + id: str, + session: fishjam.agent.agent.AgentSession, + options: fishjam.agent.agent.OutgoingAudioTrackOptions +) +``` + + +### id +```python +id: : str +``` +The global identifier of the track. + +### session +```python +session: : fishjam.agent.agent.AgentSession +``` +The agent the track belongs to. + +### options +```python +options: : fishjam.agent.agent.OutgoingAudioTrackOptions +``` +The parameters used to create the track. + +### send_chunk +```python +def send_chunk(self, data: bytes) +``` +Send a chunk of audio to Fishjam on this track. + +Peers connected to the room of the agent will receive this data. + +### interrupt +```python +def interrupt(self) +``` +Interrupt current track. + +Any audio that has been sent, but not played +will be cleared and be prevented from playing. + +Audio sent after the interrupt will be played normally. + +--- +## OutgoingAudioTrackOptions +```python +class OutgoingAudioTrackOptions: +``` +Parameters of an outgoing audio track. + +### __init__ +```python +def __init__( + encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + sample_rate: Literal[16000, 24000] = 16000, + channels: Literal[1, 2] = 1, + metadata: dict[str, typing.Any] | None = None +) +``` + + +### encoding +```python +encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = + +``` +The encoding of the audio source. +Defaults to raw 16-bit PCM. + +### sample_rate +```python +sample_rate: : Literal[16000, 24000] = 16000 + +``` +The sample rate of the audio source. +Defaults to 16000. + +### channels +```python +channels: : Literal[1, 2] = 1 + +``` +The number of channels in the audio source. +Supported values are 1 (mono) and 2 (stereo). +Defaults to 1 (mono) + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Custom metadata for the track. +Must be JSON-encodable. + +--- diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/errors.md b/versioned_docs/version-0.21.0/api/server-python/fishjam/errors.md new file mode 100644 index 00000000..0d719368 --- /dev/null +++ b/versioned_docs/version-0.21.0/api/server-python/fishjam/errors.md @@ -0,0 +1,59 @@ +--- +title: errors +sidebar_label: errors +custom_edit_url: null +--- + +# errors + + + +## HTTPError +```python +class HTTPError(builtins.Exception): +``` + + +--- +## BadRequestError +```python +class BadRequestError(HTTPError): +``` + + +--- +## UnauthorizedError +```python +class UnauthorizedError(HTTPError): +``` + + +--- +## NotFoundError +```python +class NotFoundError(HTTPError): +``` + + +--- +## ServiceUnavailableError +```python +class ServiceUnavailableError(HTTPError): +``` + + +--- +## InternalServerError +```python +class InternalServerError(HTTPError): +``` + + +--- +## ConflictError +```python +class ConflictError(HTTPError): +``` + + +--- diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/events.md b/versioned_docs/version-0.21.0/api/server-python/fishjam/events.md new file mode 100644 index 00000000..052ec540 --- /dev/null +++ b/versioned_docs/version-0.21.0/api/server-python/fishjam/events.md @@ -0,0 +1,863 @@ +--- +title: events +sidebar_label: events +custom_edit_url: null +--- + +# events + + + +## ServerMessageRoomCreated +```python +class ServerMessageRoomCreated(betterproto.Message): +``` +Notification sent when a room is created + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomDeleted +```python +class ServerMessageRoomDeleted(betterproto.Message): +``` +Notification sent when a room is deleted + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomCrashed +```python +class ServerMessageRoomCrashed(betterproto.Message): +``` +Notification sent when a room crashes + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerAdded +```python +class ServerMessagePeerAdded(betterproto.Message): +``` +Notification sent when a peer is added + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerConnected +```python +class ServerMessagePeerConnected(betterproto.Message): +``` +Notification sent when a peer connects + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDeleted +```python +class ServerMessagePeerDeleted(betterproto.Message): +``` +Notification sent when a peer is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDisconnected +```python +class ServerMessagePeerDisconnected(betterproto.Message): +``` +Notification sent when a peer disconnects from FJ + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerMetadataUpdated +```python +class ServerMessagePeerMetadataUpdated(betterproto.Message): +``` +Notification sent when peer updates its metadata + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + metadata: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### metadata +```python +metadata: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerCrashed +```python +class ServerMessagePeerCrashed(betterproto.Message): +``` +Notification sent when a peer crashes + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + reason: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### reason +```python +reason: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamConnected +```python +class ServerMessageStreamConnected(betterproto.Message): +``` +Notification sent when streamer successfully connects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamDisconnected +```python +class ServerMessageStreamDisconnected(betterproto.Message): +``` +Notification sent when streamer disconnects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackAdded +```python +class ServerMessageTrackAdded(betterproto.Message): +``` +Notification sent when peer or component adds new track + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackMetadataUpdated +```python +class ServerMessageTrackMetadataUpdated(betterproto.Message): +``` +Notification sent when metadata of a multimedia track is updated + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackRemoved +```python +class ServerMessageTrackRemoved(betterproto.Message): +``` +Notification sent when a track is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerConnected +```python +class ServerMessageViewerConnected(betterproto.Message): +``` +Notification sent when viewer successfully connects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerDisconnected +```python +class ServerMessageViewerDisconnected(betterproto.Message): +``` +Notification sent when viewer disconnects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## Track +```python +class Track(betterproto.Message): +``` +Describes a media track + +### __init__ +```python +def __init__( + id: str = , + type: fishjam.events._protos.fishjam.notifications.TrackType = , + metadata: str = +) +``` + + +### id +```python +id: : str +``` + + +### type +```python +type: : fishjam.events._protos.fishjam.notifications.TrackType +``` + + +### metadata +```python +metadata: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## TrackEncoding +```python +class TrackEncoding(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### TRACK_ENCODING_UNSPECIFIED +```python +TRACK_ENCODING_UNSPECIFIED = + +``` + + +### TRACK_ENCODING_PCM16 +```python +TRACK_ENCODING_PCM16 = + +``` + + +### TRACK_ENCODING_OPUS +```python +TRACK_ENCODING_OPUS = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## TrackType +```python +class TrackType(betterproto.Enum): +``` +Defines types of tracks being published by peers and component + +### TRACK_TYPE_UNSPECIFIED +```python +TRACK_TYPE_UNSPECIFIED = + +``` + + +### TRACK_TYPE_VIDEO +```python +TRACK_TYPE_VIDEO = + +``` + + +### TRACK_TYPE_AUDIO +```python +TRACK_TYPE_AUDIO = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## ServerMessagePeerType +```python +class ServerMessagePeerType(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### PEER_TYPE_UNSPECIFIED +```python +PEER_TYPE_UNSPECIFIED = + +``` + + +### PEER_TYPE_WEBRTC +```python +PEER_TYPE_WEBRTC = + +``` + + +### PEER_TYPE_AGENT +```python +PEER_TYPE_AGENT = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/peer.md b/versioned_docs/version-0.21.0/api/server-python/fishjam/peer.md new file mode 100644 index 00000000..4a5e0fcc --- /dev/null +++ b/versioned_docs/version-0.21.0/api/server-python/fishjam/peer.md @@ -0,0 +1,100 @@ +--- +title: peer +sidebar_label: peer +custom_edit_url: null +--- + +# peer + + + +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerStatus +```python +class PeerStatus(builtins.str, enum.Enum): +``` +Informs about the peer status + +### CONNECTED +```python +CONNECTED = + +``` + + +### DISCONNECTED +```python +DISCONNECTED = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## PeerType +```python +class PeerType(builtins.str, enum.Enum): +``` +Peer type + +### AGENT +```python +AGENT = + +``` + + +### WEBRTC +```python +WEBRTC = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/room.md b/versioned_docs/version-0.21.0/api/server-python/fishjam/room.md new file mode 100644 index 00000000..53847c63 --- /dev/null +++ b/versioned_docs/version-0.21.0/api/server-python/fishjam/room.md @@ -0,0 +1,171 @@ +--- +title: room +sidebar_label: room +custom_edit_url: null +--- + +# room + + + +## RoomConfig +```python +class RoomConfig: +``` +Room configuration + +Attributes: + max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. + public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. + room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to + conference. Default: RoomConfigRoomType.CONFERENCE. + video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: + RoomConfigVideoCodec.H264. + webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: + https://backend.address.com/fishjam-notifications-endpoint. + +### __init__ +```python +def __init__( + max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , + public: Union[fishjam._openapi_client.types.Unset, bool] = False, + room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , + video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = +) +``` +Method generated by attrs for class RoomConfig. + +### max_peers +```python +max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +``` + + +### public +```python +public: : Union[fishjam._openapi_client.types.Unset, bool] +``` + + +### room_type +```python +room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +``` + + +### video_codec +```python +video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +``` + + +### webhook_url +```python +webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## RoomConfigVideoCodec +```python +class RoomConfigVideoCodec(builtins.str, enum.Enum): +``` +Enforces video codec for each peer in the room + +### H264 +```python +H264 = + +``` + + +### VP8 +```python +VP8 = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## RoomConfigRoomType +```python +class RoomConfigRoomType(builtins.str, enum.Enum): +``` +The use-case of the room. If not provided, this defaults to conference. + +### AUDIO_ONLY +```python +AUDIO_ONLY = + +``` + + +### AUDIO_ONLY_LIVESTREAM +```python +AUDIO_ONLY_LIVESTREAM = + +``` + + +### BROADCASTER +```python +BROADCASTER = + +``` + + +### CONFERENCE +```python +CONFERENCE = + +``` + + +### FULL_FEATURE +```python +FULL_FEATURE = + +``` + + +### LIVESTREAM +```python +LIVESTREAM = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam.md b/versioned_docs/version-0.22.0/api/server-python/fishjam.md new file mode 100644 index 00000000..1a6d1da2 --- /dev/null +++ b/versioned_docs/version-0.22.0/api/server-python/fishjam.md @@ -0,0 +1,498 @@ +--- +title: fishjam +sidebar_label: fishjam +custom_edit_url: null +--- + +# fishjam + + +## Submodules +- [events](fishjam/events) +- [errors](fishjam/errors) +- [room](fishjam/room) +- [peer](fishjam/peer) +- [agent](fishjam/agent) + +## FishjamClient +```python +class FishjamClient(fishjam.api._client.Client): +``` +Allows for managing rooms + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create a FishjamClient instance, providing the fishjam id and management token. + +### create_peer +```python +def create_peer( + self, + room_id: str, + options: fishjam.api._fishjam_client.PeerOptions | None = None +) -> tuple[fishjam._openapi_client.models.peer.Peer, str] +``` +Creates peer in the room + +Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer +to authenticate to Fishjam. + +The possible options to pass for peer are `PeerOptions`. + +### create_agent +```python +def create_agent( + self, + room_id: str, + options: fishjam.api._fishjam_client.AgentOptions | None = None +) +``` + + +### create_room +```python +def create_room( + self, + options: fishjam.api._fishjam_client.RoomOptions | None = None +) -> fishjam.api._fishjam_client.Room +``` +Creates a new room +Returns the created `Room` + +### get_all_rooms +```python +def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +``` +Returns list of all rooms + +### get_room +```python +def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +``` +Returns room with the given id + +### delete_peer +```python +def delete_peer(self, room_id: str, peer_id: str) -> None +``` +Deletes peer + +### delete_room +```python +def delete_room(self, room_id: str) -> None +``` +Deletes a room + +### refresh_peer_token +```python +def refresh_peer_token(self, room_id: str, peer_id: str) -> str +``` +Refreshes peer token + +### create_livestream_viewer_token +```python +def create_livestream_viewer_token(self, room_id: str) -> str +``` +Generates viewer token for livestream rooms + +### create_livestream_streamer_token +```python +def create_livestream_streamer_token(self, room_id: str) -> str +``` +Generates streamer token for livestream rooms + +### subscribe_peer +```python +def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) +``` +Subscribe a peer to all tracks of another peer. + +### subscribe_tracks +```python +def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) +``` +Subscribe a peer to specific tracks of another peer. + +#### Inherited Members +* **Client**: + * `client` +--- +## FishjamNotifier +```python +class FishjamNotifier: +``` +Allows for receiving WebSocket messages from Fishjam. + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create FishjamNotifier instance, providing the fishjam id and management token. + +### on_server_notification +```python +def on_server_notification( + self, + handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] +) +``` +Decorator used for defining handler for Fishjam Notifications + +### connect +```python +def connect(self) +``` +A coroutine which connects FishjamNotifier to Fishjam and listens for +all incoming messages from the Fishjam. + +It runs until the connection isn't closed. + +The incoming messages are handled by the functions defined using the +`on_server_notification` decorator. + +The handler have to be defined before calling `connect`, +otherwise the messages won't be received. + +### wait_ready +```python +def wait_ready(self) -> None +``` +Waits until the notifier is connected and authenticated to Fishjam. + +If already connected, returns immediately. + +--- +## receive_binary +```python +def receive_binary( + binary: bytes +) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +``` +Transform received protobuf notification to adequate notification instance. +The available notifications are listed in `fishjam.events` module. + +--- +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerOptions +```python +class PeerOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + enable_simulcast: bool = True, + metadata: dict[str, typing.Any] | None = None, + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### enable_simulcast +```python +enable_simulcast: : bool = True + +``` +Enables the peer to use simulcast + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Peer metadata + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` +Configuration of peer's subscribing policy + +--- +## RoomOptions +```python +class RoomOptions: +``` +Description of a room options + +### __init__ +```python +def __init__( + max_peers: int | None = None, + video_codec: Optional[Literal['h264', 'vp8']] = None, + webhook_url: str | None = None, + room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', + public: bool = False +) +``` + + +### max_peers +```python +max_peers: : int | None = None + +``` +Maximum amount of peers allowed into the room + +### video_codec +```python +video_codec: : Optional[Literal['h264', 'vp8']] = None + +``` +Enforces video codec for each peer in the room + +### webhook_url +```python +webhook_url: : str | None = None + +``` +URL where Fishjam notifications will be sent + +### room_type +```python +room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' + +``` +The use-case of the room. If not provided, this defaults to conference. + +### public +```python +public: : bool = False + +``` +True if livestream viewers can omit specifying a token. + +--- +## AgentOptions +```python +class AgentOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + output: fishjam.api._fishjam_client.AgentOutputOptions = , + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### output +```python +output: : fishjam.api._fishjam_client.AgentOutputOptions +``` + + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` + + +--- +## AgentOutputOptions +```python +class AgentOutputOptions: +``` +Options of the desired format of audio tracks going from Fishjam to the agent. + +### __init__ +```python +def __init__( + audio_format: Literal['pcm16'] = 'pcm16', + audio_sample_rate: Literal[16000, 24000] = 16000 +) +``` + + +### audio_format +```python +audio_format: : Literal['pcm16'] = 'pcm16' + +``` + + +### audio_sample_rate +```python +audio_sample_rate: : Literal[16000, 24000] = 16000 + +``` + + +--- +## Room +```python +class Room: +``` +Description of the room state + +### __init__ +```python +def __init__( + config: fishjam._openapi_client.models.room_config.RoomConfig, + id: str, + peers: list[fishjam._openapi_client.models.peer.Peer] +) +``` + + +### config +```python +config: : fishjam._openapi_client.models.room_config.RoomConfig +``` +Room configuration + +### id +```python +id: : str +``` +Room ID + +### peers +```python +peers: : list[fishjam._openapi_client.models.peer.Peer] +``` +List of all peers + +--- +## Peer +```python +class Peer: +``` +Describes peer status + +Attributes: + id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. + metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. + status (PeerStatus): Informs about the peer status Example: disconnected. + subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy + subscriptions (Subscriptions): Describes peer's subscriptions in manual mode + tracks (list['Track']): List of all peer's tracks + type_ (PeerType): Peer type Example: webrtc. + +### __init__ +```python +def __init__( + id: str, + metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], + status: fishjam._openapi_client.models.peer_status.PeerStatus, + subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, + subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, + tracks: list[fishjam._openapi_client.models.track.Track], + type_: fishjam._openapi_client.models.peer_type.PeerType +) +``` +Method generated by attrs for class Peer. + +### id +```python +id: : str +``` + + +### metadata +```python +metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +``` + + +### status +```python +status: : fishjam._openapi_client.models.peer_status.PeerStatus +``` + + +### subscribe_mode +```python +subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +``` + + +### subscriptions +```python +subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +``` + + +### tracks +```python +tracks: : list[fishjam._openapi_client.models.track.Track] +``` + + +### type_ +```python +type_: : fishjam._openapi_client.models.peer_type.PeerType +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/agent.md b/versioned_docs/version-0.22.0/api/server-python/fishjam/agent.md new file mode 100644 index 00000000..56cccf28 --- /dev/null +++ b/versioned_docs/version-0.22.0/api/server-python/fishjam/agent.md @@ -0,0 +1,237 @@ +--- +title: agent +sidebar_label: agent +custom_edit_url: null +--- + +# agent + + + +## Agent +```python +class Agent: +``` +Allows for connecting to a Fishjam room as an agent peer. +Provides callbacks for receiving audio. + +### __init__ +```python +def __init__(id: str, room_id: str, token: str, fishjam_url: str) +``` +Create Agent instance, providing the fishjam id and management token. + +This constructor should not be called directly. +Instead, you should call :func:`fishjam.FishjamClient.create_agent`. + +### id +```python +id +``` + + +### room_id +```python +room_id +``` + + +### connect +```python +def connect(self) +``` +Connect the agent to Fishjam to start receiving messages. + +Incoming messages from Fishjam will be routed to handlers +defined with :func:`on_track_data`. + +:raises AgentAuthError: authentication failed + +--- +## AgentError +```python +class AgentError(builtins.Exception): +``` +Base exception class for all agent exceptions + +--- +## AgentSession +```python +class AgentSession: +``` + + +### __init__ +```python +def __init__( + agent: fishjam.agent.agent.Agent, + websocket: websockets.asyncio.client.ClientConnection +) +``` + + +### agent +```python +agent +``` + + +### receive +```python +def receive( + self +) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +``` +Returns an infinite async iterator over the incoming messages from Fishjam to +the agent. + +### add_track +```python +def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) +``` +Adds a track to the connected agent, with the specified options and metadata. + +Returns an instance of :class:`OutgoingTrack`, which can be used to send data +over the added track. + +### disconnect +```python +def disconnect(self) +``` +Ends the agent session by closing the websocket connection. +Useful when you don't use the context manager to obtain the session. + +--- +## AgentAuthError +```python +class AgentAuthError(fishjam.agent.errors.AgentError): +``` +Agent failed to authenticate properly + +### __init__ +```python +def __init__(reason: str) +``` + + +### reason +```python +reason +``` + + +--- +## IncomingTrackData +```python +IncomingTrackData = + +``` + + +--- +## OutgoingTrack +```python +class OutgoingTrack: +``` +Represents an outgoing track of an agent connected to Fishjam, +created by :func:`Agent.add_track`. + +### __init__ +```python +def __init__( + id: str, + session: fishjam.agent.agent.AgentSession, + options: fishjam.agent.agent.OutgoingAudioTrackOptions +) +``` + + +### id +```python +id: : str +``` +The global identifier of the track. + +### session +```python +session: : fishjam.agent.agent.AgentSession +``` +The agent the track belongs to. + +### options +```python +options: : fishjam.agent.agent.OutgoingAudioTrackOptions +``` +The parameters used to create the track. + +### send_chunk +```python +def send_chunk(self, data: bytes) +``` +Send a chunk of audio to Fishjam on this track. + +Peers connected to the room of the agent will receive this data. + +### interrupt +```python +def interrupt(self) +``` +Interrupt current track. + +Any audio that has been sent, but not played +will be cleared and be prevented from playing. + +Audio sent after the interrupt will be played normally. + +--- +## OutgoingAudioTrackOptions +```python +class OutgoingAudioTrackOptions: +``` +Parameters of an outgoing audio track. + +### __init__ +```python +def __init__( + encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + sample_rate: Literal[16000, 24000] = 16000, + channels: Literal[1, 2] = 1, + metadata: dict[str, typing.Any] | None = None +) +``` + + +### encoding +```python +encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = + +``` +The encoding of the audio source. +Defaults to raw 16-bit PCM. + +### sample_rate +```python +sample_rate: : Literal[16000, 24000] = 16000 + +``` +The sample rate of the audio source. +Defaults to 16000. + +### channels +```python +channels: : Literal[1, 2] = 1 + +``` +The number of channels in the audio source. +Supported values are 1 (mono) and 2 (stereo). +Defaults to 1 (mono) + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Custom metadata for the track. +Must be JSON-encodable. + +--- diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/errors.md b/versioned_docs/version-0.22.0/api/server-python/fishjam/errors.md new file mode 100644 index 00000000..0d719368 --- /dev/null +++ b/versioned_docs/version-0.22.0/api/server-python/fishjam/errors.md @@ -0,0 +1,59 @@ +--- +title: errors +sidebar_label: errors +custom_edit_url: null +--- + +# errors + + + +## HTTPError +```python +class HTTPError(builtins.Exception): +``` + + +--- +## BadRequestError +```python +class BadRequestError(HTTPError): +``` + + +--- +## UnauthorizedError +```python +class UnauthorizedError(HTTPError): +``` + + +--- +## NotFoundError +```python +class NotFoundError(HTTPError): +``` + + +--- +## ServiceUnavailableError +```python +class ServiceUnavailableError(HTTPError): +``` + + +--- +## InternalServerError +```python +class InternalServerError(HTTPError): +``` + + +--- +## ConflictError +```python +class ConflictError(HTTPError): +``` + + +--- diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/events.md b/versioned_docs/version-0.22.0/api/server-python/fishjam/events.md new file mode 100644 index 00000000..052ec540 --- /dev/null +++ b/versioned_docs/version-0.22.0/api/server-python/fishjam/events.md @@ -0,0 +1,863 @@ +--- +title: events +sidebar_label: events +custom_edit_url: null +--- + +# events + + + +## ServerMessageRoomCreated +```python +class ServerMessageRoomCreated(betterproto.Message): +``` +Notification sent when a room is created + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomDeleted +```python +class ServerMessageRoomDeleted(betterproto.Message): +``` +Notification sent when a room is deleted + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomCrashed +```python +class ServerMessageRoomCrashed(betterproto.Message): +``` +Notification sent when a room crashes + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerAdded +```python +class ServerMessagePeerAdded(betterproto.Message): +``` +Notification sent when a peer is added + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerConnected +```python +class ServerMessagePeerConnected(betterproto.Message): +``` +Notification sent when a peer connects + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDeleted +```python +class ServerMessagePeerDeleted(betterproto.Message): +``` +Notification sent when a peer is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDisconnected +```python +class ServerMessagePeerDisconnected(betterproto.Message): +``` +Notification sent when a peer disconnects from FJ + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerMetadataUpdated +```python +class ServerMessagePeerMetadataUpdated(betterproto.Message): +``` +Notification sent when peer updates its metadata + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + metadata: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### metadata +```python +metadata: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerCrashed +```python +class ServerMessagePeerCrashed(betterproto.Message): +``` +Notification sent when a peer crashes + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + reason: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### reason +```python +reason: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamConnected +```python +class ServerMessageStreamConnected(betterproto.Message): +``` +Notification sent when streamer successfully connects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamDisconnected +```python +class ServerMessageStreamDisconnected(betterproto.Message): +``` +Notification sent when streamer disconnects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackAdded +```python +class ServerMessageTrackAdded(betterproto.Message): +``` +Notification sent when peer or component adds new track + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackMetadataUpdated +```python +class ServerMessageTrackMetadataUpdated(betterproto.Message): +``` +Notification sent when metadata of a multimedia track is updated + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackRemoved +```python +class ServerMessageTrackRemoved(betterproto.Message): +``` +Notification sent when a track is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerConnected +```python +class ServerMessageViewerConnected(betterproto.Message): +``` +Notification sent when viewer successfully connects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerDisconnected +```python +class ServerMessageViewerDisconnected(betterproto.Message): +``` +Notification sent when viewer disconnects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## Track +```python +class Track(betterproto.Message): +``` +Describes a media track + +### __init__ +```python +def __init__( + id: str = , + type: fishjam.events._protos.fishjam.notifications.TrackType = , + metadata: str = +) +``` + + +### id +```python +id: : str +``` + + +### type +```python +type: : fishjam.events._protos.fishjam.notifications.TrackType +``` + + +### metadata +```python +metadata: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## TrackEncoding +```python +class TrackEncoding(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### TRACK_ENCODING_UNSPECIFIED +```python +TRACK_ENCODING_UNSPECIFIED = + +``` + + +### TRACK_ENCODING_PCM16 +```python +TRACK_ENCODING_PCM16 = + +``` + + +### TRACK_ENCODING_OPUS +```python +TRACK_ENCODING_OPUS = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## TrackType +```python +class TrackType(betterproto.Enum): +``` +Defines types of tracks being published by peers and component + +### TRACK_TYPE_UNSPECIFIED +```python +TRACK_TYPE_UNSPECIFIED = + +``` + + +### TRACK_TYPE_VIDEO +```python +TRACK_TYPE_VIDEO = + +``` + + +### TRACK_TYPE_AUDIO +```python +TRACK_TYPE_AUDIO = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## ServerMessagePeerType +```python +class ServerMessagePeerType(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### PEER_TYPE_UNSPECIFIED +```python +PEER_TYPE_UNSPECIFIED = + +``` + + +### PEER_TYPE_WEBRTC +```python +PEER_TYPE_WEBRTC = + +``` + + +### PEER_TYPE_AGENT +```python +PEER_TYPE_AGENT = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/peer.md b/versioned_docs/version-0.22.0/api/server-python/fishjam/peer.md new file mode 100644 index 00000000..4a5e0fcc --- /dev/null +++ b/versioned_docs/version-0.22.0/api/server-python/fishjam/peer.md @@ -0,0 +1,100 @@ +--- +title: peer +sidebar_label: peer +custom_edit_url: null +--- + +# peer + + + +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerStatus +```python +class PeerStatus(builtins.str, enum.Enum): +``` +Informs about the peer status + +### CONNECTED +```python +CONNECTED = + +``` + + +### DISCONNECTED +```python +DISCONNECTED = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## PeerType +```python +class PeerType(builtins.str, enum.Enum): +``` +Peer type + +### AGENT +```python +AGENT = + +``` + + +### WEBRTC +```python +WEBRTC = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/room.md b/versioned_docs/version-0.22.0/api/server-python/fishjam/room.md new file mode 100644 index 00000000..53847c63 --- /dev/null +++ b/versioned_docs/version-0.22.0/api/server-python/fishjam/room.md @@ -0,0 +1,171 @@ +--- +title: room +sidebar_label: room +custom_edit_url: null +--- + +# room + + + +## RoomConfig +```python +class RoomConfig: +``` +Room configuration + +Attributes: + max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. + public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. + room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to + conference. Default: RoomConfigRoomType.CONFERENCE. + video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: + RoomConfigVideoCodec.H264. + webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: + https://backend.address.com/fishjam-notifications-endpoint. + +### __init__ +```python +def __init__( + max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , + public: Union[fishjam._openapi_client.types.Unset, bool] = False, + room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , + video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = +) +``` +Method generated by attrs for class RoomConfig. + +### max_peers +```python +max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +``` + + +### public +```python +public: : Union[fishjam._openapi_client.types.Unset, bool] +``` + + +### room_type +```python +room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +``` + + +### video_codec +```python +video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +``` + + +### webhook_url +```python +webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## RoomConfigVideoCodec +```python +class RoomConfigVideoCodec(builtins.str, enum.Enum): +``` +Enforces video codec for each peer in the room + +### H264 +```python +H264 = + +``` + + +### VP8 +```python +VP8 = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## RoomConfigRoomType +```python +class RoomConfigRoomType(builtins.str, enum.Enum): +``` +The use-case of the room. If not provided, this defaults to conference. + +### AUDIO_ONLY +```python +AUDIO_ONLY = + +``` + + +### AUDIO_ONLY_LIVESTREAM +```python +AUDIO_ONLY_LIVESTREAM = + +``` + + +### BROADCASTER +```python +BROADCASTER = + +``` + + +### CONFERENCE +```python +CONFERENCE = + +``` + + +### FULL_FEATURE +```python +FULL_FEATURE = + +``` + + +### LIVESTREAM +```python +LIVESTREAM = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam.md b/versioned_docs/version-0.23.0/api/server-python/fishjam.md new file mode 100644 index 00000000..1a6d1da2 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam.md @@ -0,0 +1,498 @@ +--- +title: fishjam +sidebar_label: fishjam +custom_edit_url: null +--- + +# fishjam + + +## Submodules +- [events](fishjam/events) +- [errors](fishjam/errors) +- [room](fishjam/room) +- [peer](fishjam/peer) +- [agent](fishjam/agent) + +## FishjamClient +```python +class FishjamClient(fishjam.api._client.Client): +``` +Allows for managing rooms + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create a FishjamClient instance, providing the fishjam id and management token. + +### create_peer +```python +def create_peer( + self, + room_id: str, + options: fishjam.api._fishjam_client.PeerOptions | None = None +) -> tuple[fishjam._openapi_client.models.peer.Peer, str] +``` +Creates peer in the room + +Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer +to authenticate to Fishjam. + +The possible options to pass for peer are `PeerOptions`. + +### create_agent +```python +def create_agent( + self, + room_id: str, + options: fishjam.api._fishjam_client.AgentOptions | None = None +) +``` + + +### create_room +```python +def create_room( + self, + options: fishjam.api._fishjam_client.RoomOptions | None = None +) -> fishjam.api._fishjam_client.Room +``` +Creates a new room +Returns the created `Room` + +### get_all_rooms +```python +def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +``` +Returns list of all rooms + +### get_room +```python +def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +``` +Returns room with the given id + +### delete_peer +```python +def delete_peer(self, room_id: str, peer_id: str) -> None +``` +Deletes peer + +### delete_room +```python +def delete_room(self, room_id: str) -> None +``` +Deletes a room + +### refresh_peer_token +```python +def refresh_peer_token(self, room_id: str, peer_id: str) -> str +``` +Refreshes peer token + +### create_livestream_viewer_token +```python +def create_livestream_viewer_token(self, room_id: str) -> str +``` +Generates viewer token for livestream rooms + +### create_livestream_streamer_token +```python +def create_livestream_streamer_token(self, room_id: str) -> str +``` +Generates streamer token for livestream rooms + +### subscribe_peer +```python +def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) +``` +Subscribe a peer to all tracks of another peer. + +### subscribe_tracks +```python +def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) +``` +Subscribe a peer to specific tracks of another peer. + +#### Inherited Members +* **Client**: + * `client` +--- +## FishjamNotifier +```python +class FishjamNotifier: +``` +Allows for receiving WebSocket messages from Fishjam. + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create FishjamNotifier instance, providing the fishjam id and management token. + +### on_server_notification +```python +def on_server_notification( + self, + handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] +) +``` +Decorator used for defining handler for Fishjam Notifications + +### connect +```python +def connect(self) +``` +A coroutine which connects FishjamNotifier to Fishjam and listens for +all incoming messages from the Fishjam. + +It runs until the connection isn't closed. + +The incoming messages are handled by the functions defined using the +`on_server_notification` decorator. + +The handler have to be defined before calling `connect`, +otherwise the messages won't be received. + +### wait_ready +```python +def wait_ready(self) -> None +``` +Waits until the notifier is connected and authenticated to Fishjam. + +If already connected, returns immediately. + +--- +## receive_binary +```python +def receive_binary( + binary: bytes +) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +``` +Transform received protobuf notification to adequate notification instance. +The available notifications are listed in `fishjam.events` module. + +--- +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerOptions +```python +class PeerOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + enable_simulcast: bool = True, + metadata: dict[str, typing.Any] | None = None, + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### enable_simulcast +```python +enable_simulcast: : bool = True + +``` +Enables the peer to use simulcast + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Peer metadata + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` +Configuration of peer's subscribing policy + +--- +## RoomOptions +```python +class RoomOptions: +``` +Description of a room options + +### __init__ +```python +def __init__( + max_peers: int | None = None, + video_codec: Optional[Literal['h264', 'vp8']] = None, + webhook_url: str | None = None, + room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', + public: bool = False +) +``` + + +### max_peers +```python +max_peers: : int | None = None + +``` +Maximum amount of peers allowed into the room + +### video_codec +```python +video_codec: : Optional[Literal['h264', 'vp8']] = None + +``` +Enforces video codec for each peer in the room + +### webhook_url +```python +webhook_url: : str | None = None + +``` +URL where Fishjam notifications will be sent + +### room_type +```python +room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' + +``` +The use-case of the room. If not provided, this defaults to conference. + +### public +```python +public: : bool = False + +``` +True if livestream viewers can omit specifying a token. + +--- +## AgentOptions +```python +class AgentOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + output: fishjam.api._fishjam_client.AgentOutputOptions = , + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### output +```python +output: : fishjam.api._fishjam_client.AgentOutputOptions +``` + + +### subscribe_mode +```python +subscribe_mode: : Literal['auto', 'manual'] = 'auto' + +``` + + +--- +## AgentOutputOptions +```python +class AgentOutputOptions: +``` +Options of the desired format of audio tracks going from Fishjam to the agent. + +### __init__ +```python +def __init__( + audio_format: Literal['pcm16'] = 'pcm16', + audio_sample_rate: Literal[16000, 24000] = 16000 +) +``` + + +### audio_format +```python +audio_format: : Literal['pcm16'] = 'pcm16' + +``` + + +### audio_sample_rate +```python +audio_sample_rate: : Literal[16000, 24000] = 16000 + +``` + + +--- +## Room +```python +class Room: +``` +Description of the room state + +### __init__ +```python +def __init__( + config: fishjam._openapi_client.models.room_config.RoomConfig, + id: str, + peers: list[fishjam._openapi_client.models.peer.Peer] +) +``` + + +### config +```python +config: : fishjam._openapi_client.models.room_config.RoomConfig +``` +Room configuration + +### id +```python +id: : str +``` +Room ID + +### peers +```python +peers: : list[fishjam._openapi_client.models.peer.Peer] +``` +List of all peers + +--- +## Peer +```python +class Peer: +``` +Describes peer status + +Attributes: + id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. + metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. + status (PeerStatus): Informs about the peer status Example: disconnected. + subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy + subscriptions (Subscriptions): Describes peer's subscriptions in manual mode + tracks (list['Track']): List of all peer's tracks + type_ (PeerType): Peer type Example: webrtc. + +### __init__ +```python +def __init__( + id: str, + metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], + status: fishjam._openapi_client.models.peer_status.PeerStatus, + subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, + subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, + tracks: list[fishjam._openapi_client.models.track.Track], + type_: fishjam._openapi_client.models.peer_type.PeerType +) +``` +Method generated by attrs for class Peer. + +### id +```python +id: : str +``` + + +### metadata +```python +metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +``` + + +### status +```python +status: : fishjam._openapi_client.models.peer_status.PeerStatus +``` + + +### subscribe_mode +```python +subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +``` + + +### subscriptions +```python +subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +``` + + +### tracks +```python +tracks: : list[fishjam._openapi_client.models.track.Track] +``` + + +### type_ +```python +type_: : fishjam._openapi_client.models.peer_type.PeerType +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/agent.md b/versioned_docs/version-0.23.0/api/server-python/fishjam/agent.md new file mode 100644 index 00000000..56cccf28 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam/agent.md @@ -0,0 +1,237 @@ +--- +title: agent +sidebar_label: agent +custom_edit_url: null +--- + +# agent + + + +## Agent +```python +class Agent: +``` +Allows for connecting to a Fishjam room as an agent peer. +Provides callbacks for receiving audio. + +### __init__ +```python +def __init__(id: str, room_id: str, token: str, fishjam_url: str) +``` +Create Agent instance, providing the fishjam id and management token. + +This constructor should not be called directly. +Instead, you should call :func:`fishjam.FishjamClient.create_agent`. + +### id +```python +id +``` + + +### room_id +```python +room_id +``` + + +### connect +```python +def connect(self) +``` +Connect the agent to Fishjam to start receiving messages. + +Incoming messages from Fishjam will be routed to handlers +defined with :func:`on_track_data`. + +:raises AgentAuthError: authentication failed + +--- +## AgentError +```python +class AgentError(builtins.Exception): +``` +Base exception class for all agent exceptions + +--- +## AgentSession +```python +class AgentSession: +``` + + +### __init__ +```python +def __init__( + agent: fishjam.agent.agent.Agent, + websocket: websockets.asyncio.client.ClientConnection +) +``` + + +### agent +```python +agent +``` + + +### receive +```python +def receive( + self +) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +``` +Returns an infinite async iterator over the incoming messages from Fishjam to +the agent. + +### add_track +```python +def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) +``` +Adds a track to the connected agent, with the specified options and metadata. + +Returns an instance of :class:`OutgoingTrack`, which can be used to send data +over the added track. + +### disconnect +```python +def disconnect(self) +``` +Ends the agent session by closing the websocket connection. +Useful when you don't use the context manager to obtain the session. + +--- +## AgentAuthError +```python +class AgentAuthError(fishjam.agent.errors.AgentError): +``` +Agent failed to authenticate properly + +### __init__ +```python +def __init__(reason: str) +``` + + +### reason +```python +reason +``` + + +--- +## IncomingTrackData +```python +IncomingTrackData = + +``` + + +--- +## OutgoingTrack +```python +class OutgoingTrack: +``` +Represents an outgoing track of an agent connected to Fishjam, +created by :func:`Agent.add_track`. + +### __init__ +```python +def __init__( + id: str, + session: fishjam.agent.agent.AgentSession, + options: fishjam.agent.agent.OutgoingAudioTrackOptions +) +``` + + +### id +```python +id: : str +``` +The global identifier of the track. + +### session +```python +session: : fishjam.agent.agent.AgentSession +``` +The agent the track belongs to. + +### options +```python +options: : fishjam.agent.agent.OutgoingAudioTrackOptions +``` +The parameters used to create the track. + +### send_chunk +```python +def send_chunk(self, data: bytes) +``` +Send a chunk of audio to Fishjam on this track. + +Peers connected to the room of the agent will receive this data. + +### interrupt +```python +def interrupt(self) +``` +Interrupt current track. + +Any audio that has been sent, but not played +will be cleared and be prevented from playing. + +Audio sent after the interrupt will be played normally. + +--- +## OutgoingAudioTrackOptions +```python +class OutgoingAudioTrackOptions: +``` +Parameters of an outgoing audio track. + +### __init__ +```python +def __init__( + encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + sample_rate: Literal[16000, 24000] = 16000, + channels: Literal[1, 2] = 1, + metadata: dict[str, typing.Any] | None = None +) +``` + + +### encoding +```python +encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = + +``` +The encoding of the audio source. +Defaults to raw 16-bit PCM. + +### sample_rate +```python +sample_rate: : Literal[16000, 24000] = 16000 + +``` +The sample rate of the audio source. +Defaults to 16000. + +### channels +```python +channels: : Literal[1, 2] = 1 + +``` +The number of channels in the audio source. +Supported values are 1 (mono) and 2 (stereo). +Defaults to 1 (mono) + +### metadata +```python +metadata: : dict[str, typing.Any] | None = None + +``` +Custom metadata for the track. +Must be JSON-encodable. + +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/errors.md b/versioned_docs/version-0.23.0/api/server-python/fishjam/errors.md new file mode 100644 index 00000000..0d719368 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam/errors.md @@ -0,0 +1,59 @@ +--- +title: errors +sidebar_label: errors +custom_edit_url: null +--- + +# errors + + + +## HTTPError +```python +class HTTPError(builtins.Exception): +``` + + +--- +## BadRequestError +```python +class BadRequestError(HTTPError): +``` + + +--- +## UnauthorizedError +```python +class UnauthorizedError(HTTPError): +``` + + +--- +## NotFoundError +```python +class NotFoundError(HTTPError): +``` + + +--- +## ServiceUnavailableError +```python +class ServiceUnavailableError(HTTPError): +``` + + +--- +## InternalServerError +```python +class InternalServerError(HTTPError): +``` + + +--- +## ConflictError +```python +class ConflictError(HTTPError): +``` + + +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/events.md b/versioned_docs/version-0.23.0/api/server-python/fishjam/events.md new file mode 100644 index 00000000..052ec540 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam/events.md @@ -0,0 +1,863 @@ +--- +title: events +sidebar_label: events +custom_edit_url: null +--- + +# events + + + +## ServerMessageRoomCreated +```python +class ServerMessageRoomCreated(betterproto.Message): +``` +Notification sent when a room is created + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomDeleted +```python +class ServerMessageRoomDeleted(betterproto.Message): +``` +Notification sent when a room is deleted + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomCrashed +```python +class ServerMessageRoomCrashed(betterproto.Message): +``` +Notification sent when a room crashes + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerAdded +```python +class ServerMessagePeerAdded(betterproto.Message): +``` +Notification sent when a peer is added + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerConnected +```python +class ServerMessagePeerConnected(betterproto.Message): +``` +Notification sent when a peer connects + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDeleted +```python +class ServerMessagePeerDeleted(betterproto.Message): +``` +Notification sent when a peer is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDisconnected +```python +class ServerMessagePeerDisconnected(betterproto.Message): +``` +Notification sent when a peer disconnects from FJ + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerMetadataUpdated +```python +class ServerMessagePeerMetadataUpdated(betterproto.Message): +``` +Notification sent when peer updates its metadata + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + metadata: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### metadata +```python +metadata: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerCrashed +```python +class ServerMessagePeerCrashed(betterproto.Message): +``` +Notification sent when a peer crashes + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + reason: str = , + peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### reason +```python +reason: : str +``` + + +### peer_type +```python +peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamConnected +```python +class ServerMessageStreamConnected(betterproto.Message): +``` +Notification sent when streamer successfully connects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamDisconnected +```python +class ServerMessageStreamDisconnected(betterproto.Message): +``` +Notification sent when streamer disconnects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackAdded +```python +class ServerMessageTrackAdded(betterproto.Message): +``` +Notification sent when peer or component adds new track + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackMetadataUpdated +```python +class ServerMessageTrackMetadataUpdated(betterproto.Message): +``` +Notification sent when metadata of a multimedia track is updated + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackRemoved +```python +class ServerMessageTrackRemoved(betterproto.Message): +``` +Notification sent when a track is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: fishjam.events._protos.fishjam.notifications.Track = +) +``` + + +### room_id +```python +room_id: : str +``` + + +### peer_id +```python +peer_id: : str +``` + + +### component_id +```python +component_id: : str +``` + + +### track +```python +track: : fishjam.events._protos.fishjam.notifications.Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerConnected +```python +class ServerMessageViewerConnected(betterproto.Message): +``` +Notification sent when viewer successfully connects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerDisconnected +```python +class ServerMessageViewerDisconnected(betterproto.Message): +``` +Notification sent when viewer disconnects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: : str +``` + + +### viewer_id +```python +viewer_id: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## Track +```python +class Track(betterproto.Message): +``` +Describes a media track + +### __init__ +```python +def __init__( + id: str = , + type: fishjam.events._protos.fishjam.notifications.TrackType = , + metadata: str = +) +``` + + +### id +```python +id: : str +``` + + +### type +```python +type: : fishjam.events._protos.fishjam.notifications.TrackType +``` + + +### metadata +```python +metadata: : str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## TrackEncoding +```python +class TrackEncoding(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### TRACK_ENCODING_UNSPECIFIED +```python +TRACK_ENCODING_UNSPECIFIED = + +``` + + +### TRACK_ENCODING_PCM16 +```python +TRACK_ENCODING_PCM16 = + +``` + + +### TRACK_ENCODING_OPUS +```python +TRACK_ENCODING_OPUS = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## TrackType +```python +class TrackType(betterproto.Enum): +``` +Defines types of tracks being published by peers and component + +### TRACK_TYPE_UNSPECIFIED +```python +TRACK_TYPE_UNSPECIFIED = + +``` + + +### TRACK_TYPE_VIDEO +```python +TRACK_TYPE_VIDEO = + +``` + + +### TRACK_TYPE_AUDIO +```python +TRACK_TYPE_AUDIO = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## ServerMessagePeerType +```python +class ServerMessagePeerType(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### PEER_TYPE_UNSPECIFIED +```python +PEER_TYPE_UNSPECIFIED = + +``` + + +### PEER_TYPE_WEBRTC +```python +PEER_TYPE_WEBRTC = + +``` + + +### PEER_TYPE_AGENT +```python +PEER_TYPE_AGENT = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/peer.md b/versioned_docs/version-0.23.0/api/server-python/fishjam/peer.md new file mode 100644 index 00000000..4a5e0fcc --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam/peer.md @@ -0,0 +1,100 @@ +--- +title: peer +sidebar_label: peer +custom_edit_url: null +--- + +# peer + + + +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## PeerStatus +```python +class PeerStatus(builtins.str, enum.Enum): +``` +Informs about the peer status + +### CONNECTED +```python +CONNECTED = + +``` + + +### DISCONNECTED +```python +DISCONNECTED = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## PeerType +```python +class PeerType(builtins.str, enum.Enum): +``` +Peer type + +### AGENT +```python +AGENT = + +``` + + +### WEBRTC +```python +WEBRTC = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/room.md b/versioned_docs/version-0.23.0/api/server-python/fishjam/room.md new file mode 100644 index 00000000..53847c63 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam/room.md @@ -0,0 +1,171 @@ +--- +title: room +sidebar_label: room +custom_edit_url: null +--- + +# room + + + +## RoomConfig +```python +class RoomConfig: +``` +Room configuration + +Attributes: + max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. + public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. + room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to + conference. Default: RoomConfigRoomType.CONFERENCE. + video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: + RoomConfigVideoCodec.H264. + webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: + https://backend.address.com/fishjam-notifications-endpoint. + +### __init__ +```python +def __init__( + max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , + public: Union[fishjam._openapi_client.types.Unset, bool] = False, + room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , + video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = +) +``` +Method generated by attrs for class RoomConfig. + +### max_peers +```python +max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +``` + + +### public +```python +public: : Union[fishjam._openapi_client.types.Unset, bool] +``` + + +### room_type +```python +room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +``` + + +### video_codec +```python +video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +``` + + +### webhook_url +```python +webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +``` + + +### additional_properties +```python +additional_properties: : dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: : list[str] +``` + + +--- +## RoomConfigVideoCodec +```python +class RoomConfigVideoCodec(builtins.str, enum.Enum): +``` +Enforces video codec for each peer in the room + +### H264 +```python +H264 = + +``` + + +### VP8 +```python +VP8 = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## RoomConfigRoomType +```python +class RoomConfigRoomType(builtins.str, enum.Enum): +``` +The use-case of the room. If not provided, this defaults to conference. + +### AUDIO_ONLY +```python +AUDIO_ONLY = + +``` + + +### AUDIO_ONLY_LIVESTREAM +```python +AUDIO_ONLY_LIVESTREAM = + +``` + + +### BROADCASTER +```python +BROADCASTER = + +``` + + +### CONFERENCE +```python +CONFERENCE = + +``` + + +### FULL_FEATURE +```python +FULL_FEATURE = + +``` + + +### LIVESTREAM +```python +LIVESTREAM = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- From e7e79f31894bf853842e1e949a5a24ee35808a66 Mon Sep 17 00:00:00 2001 From: p1003 Date: Thu, 4 Dec 2025 11:18:51 +0100 Subject: [PATCH 2/4] add python-server-sdk --- packages/python-server-sdk | 1 + 1 file changed, 1 insertion(+) create mode 160000 packages/python-server-sdk diff --git a/packages/python-server-sdk b/packages/python-server-sdk new file mode 160000 index 00000000..3ad5bbeb --- /dev/null +++ b/packages/python-server-sdk @@ -0,0 +1 @@ +Subproject commit 3ad5bbeb667f7aa687f948023f804ab60a49db39 From e2a327f35a0357dc510f86429d8f7e5e2d8c4f21 Mon Sep 17 00:00:00 2001 From: p1003 Date: Thu, 4 Dec 2025 11:26:22 +0100 Subject: [PATCH 3/4] add server-python docs --- .gitignore | 3 +- docs/api/server-python/fishjam.md | 498 ++++++++++ .../api/server-python/submodules}/agent.md | 22 +- .../api/server-python/submodules}/errors.md | 2 +- .../api/server-python/submodules}/events.md | 126 +-- .../api/server-python/submodules}/peer.md | 16 +- .../api/server-python/submodules}/room.md | 44 +- .../api/server-python/fishjam.md | 100 +- .../api/server-python/submodules}/agent.md | 22 +- .../{fishjam => submodules}/errors.md | 2 +- .../api/server-python/submodules}/events.md | 126 +-- .../api/server-python/submodules}/peer.md | 16 +- .../{fishjam => submodules}/room.md | 44 +- .../api/server-python/fishjam.md | 100 +- .../{fishjam => submodules}/agent.md | 22 +- .../api/server-python/submodules}/errors.md | 2 +- .../api/server-python/submodules}/events.md | 126 +-- .../{fishjam => submodules}/peer.md | 16 +- .../api/server-python/submodules}/room.md | 44 +- .../api/server-python/fishjam.md | 100 +- .../api/server-python/submodules}/agent.md | 22 +- .../api/server-python/submodules}/errors.md | 2 +- .../api/server-python/submodules}/events.md | 126 +-- .../api/server-python/submodules}/peer.md | 16 +- .../api/server-python/submodules}/room.md | 44 +- .../api/server-python/fishjam.md | 100 +- .../api/server-python/submodules/agent.md | 237 +++++ .../api/server-python/submodules/errors.md | 59 ++ .../api/server-python/submodules/events.md | 863 ++++++++++++++++++ .../api/server-python/submodules/peer.md | 100 ++ .../api/server-python/submodules/room.md | 171 ++++ 31 files changed, 2550 insertions(+), 621 deletions(-) create mode 100644 docs/api/server-python/fishjam.md rename {versioned_docs/version-0.20.0/api/server-python/fishjam => docs/api/server-python/submodules}/agent.md (83%) rename {versioned_docs/version-0.21.0/api/server-python/fishjam => docs/api/server-python/submodules}/errors.md (93%) rename {versioned_docs/version-0.21.0/api/server-python/fishjam => docs/api/server-python/submodules}/events.md (80%) rename {versioned_docs/version-0.22.0/api/server-python/fishjam => docs/api/server-python/submodules}/peer.md (70%) rename {versioned_docs/version-0.22.0/api/server-python/fishjam => docs/api/server-python/submodules}/room.md (50%) rename versioned_docs/{version-0.22.0/api/server-python/fishjam => version-0.20.0/api/server-python/submodules}/agent.md (83%) rename versioned_docs/version-0.20.0/api/server-python/{fishjam => submodules}/errors.md (93%) rename versioned_docs/{version-0.22.0/api/server-python/fishjam => version-0.20.0/api/server-python/submodules}/events.md (80%) rename versioned_docs/{version-0.23.0/api/server-python/fishjam => version-0.20.0/api/server-python/submodules}/peer.md (70%) rename versioned_docs/version-0.20.0/api/server-python/{fishjam => submodules}/room.md (50%) rename versioned_docs/version-0.21.0/api/server-python/{fishjam => submodules}/agent.md (83%) rename versioned_docs/{version-0.22.0/api/server-python/fishjam => version-0.21.0/api/server-python/submodules}/errors.md (93%) rename versioned_docs/{version-0.20.0/api/server-python/fishjam => version-0.21.0/api/server-python/submodules}/events.md (80%) rename versioned_docs/version-0.21.0/api/server-python/{fishjam => submodules}/peer.md (70%) rename versioned_docs/{version-0.23.0/api/server-python/fishjam => version-0.21.0/api/server-python/submodules}/room.md (50%) rename versioned_docs/{version-0.23.0/api/server-python/fishjam => version-0.22.0/api/server-python/submodules}/agent.md (83%) rename versioned_docs/{version-0.23.0/api/server-python/fishjam => version-0.22.0/api/server-python/submodules}/errors.md (93%) rename versioned_docs/{version-0.23.0/api/server-python/fishjam => version-0.22.0/api/server-python/submodules}/events.md (80%) rename versioned_docs/{version-0.20.0/api/server-python/fishjam => version-0.22.0/api/server-python/submodules}/peer.md (70%) rename versioned_docs/{version-0.21.0/api/server-python/fishjam => version-0.22.0/api/server-python/submodules}/room.md (50%) create mode 100644 versioned_docs/version-0.23.0/api/server-python/submodules/agent.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/submodules/errors.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/submodules/events.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/submodules/peer.md create mode 100644 versioned_docs/version-0.23.0/api/server-python/submodules/room.md diff --git a/.gitignore b/.gitignore index e867858d..25cb6574 100644 --- a/.gitignore +++ b/.gitignore @@ -137,6 +137,7 @@ build docs/api/mobile/** docs/api/web/** docs/api/server/** -docs/api/server-python/** +# TODO: remove this after https://github.com/fishjam-cloud/python-server-sdk/pull/51 is merged +# docs/api/server-python/** .cursor/ diff --git a/docs/api/server-python/fishjam.md b/docs/api/server-python/fishjam.md new file mode 100644 index 00000000..f0c4dcd2 --- /dev/null +++ b/docs/api/server-python/fishjam.md @@ -0,0 +1,498 @@ +--- +title: fishjam +sidebar_label: fishjam +custom_edit_url: null +--- + +# fishjam + + +## Submodules +- [events](submodules/events) +- [errors](submodules/errors) +- [room](submodules/room) +- [peer](submodules/peer) +- [agent](submodules/agent) + +## FishjamClient +```python +class FishjamClient(Client): +``` +Allows for managing rooms + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create a FishjamClient instance, providing the fishjam id and management token. + +### create_peer +```python +def create_peer( + self, + room_id: str, + options: PeerOptions | None = None +) -> tuple[Peer, str] +``` +Creates peer in the room + +Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer +to authenticate to Fishjam. + +The possible options to pass for peer are `PeerOptions`. + +### create_agent +```python +def create_agent( + self, + room_id: str, + options: AgentOptions | None = None +) +``` + + +### create_room +```python +def create_room( + self, + options: RoomOptions | None = None +) -> Room +``` +Creates a new room +Returns the created `Room` + +### get_all_rooms +```python +def get_all_rooms(self) -> list[Room] +``` +Returns list of all rooms + +### get_room +```python +def get_room(self, room_id: str) -> Room +``` +Returns room with the given id + +### delete_peer +```python +def delete_peer(self, room_id: str, peer_id: str) -> None +``` +Deletes peer + +### delete_room +```python +def delete_room(self, room_id: str) -> None +``` +Deletes a room + +### refresh_peer_token +```python +def refresh_peer_token(self, room_id: str, peer_id: str) -> str +``` +Refreshes peer token + +### create_livestream_viewer_token +```python +def create_livestream_viewer_token(self, room_id: str) -> str +``` +Generates viewer token for livestream rooms + +### create_livestream_streamer_token +```python +def create_livestream_streamer_token(self, room_id: str) -> str +``` +Generates streamer token for livestream rooms + +### subscribe_peer +```python +def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) +``` +Subscribe a peer to all tracks of another peer. + +### subscribe_tracks +```python +def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) +``` +Subscribe a peer to specific tracks of another peer. + +#### Inherited Members +* **Client**: + * `client` +--- +## FishjamNotifier +```python +class FishjamNotifier: +``` +Allows for receiving WebSocket messages from Fishjam. + +### __init__ +```python +def __init__(fishjam_id: str, management_token: str) +``` +Create FishjamNotifier instance, providing the fishjam id and management token. + +### on_server_notification +```python +def on_server_notification( + self, + handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] +) +``` +Decorator used for defining handler for Fishjam Notifications + +### connect +```python +def connect(self) +``` +A coroutine which connects FishjamNotifier to Fishjam and listens for +all incoming messages from the Fishjam. + +It runs until the connection isn't closed. + +The incoming messages are handled by the functions defined using the +`on_server_notification` decorator. + +The handler have to be defined before calling `connect`, +otherwise the messages won't be received. + +### wait_ready +```python +def wait_ready(self) -> None +``` +Waits until the notifier is connected and authenticated to Fishjam. + +If already connected, returns immediately. + +--- +## receive_binary +```python +def receive_binary( + binary: bytes +) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] +``` +Transform received protobuf notification to adequate notification instance. +The available notifications are listed in `fishjam.events` module. + +--- +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: list[str] +``` + + +--- +## PeerOptions +```python +class PeerOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + enable_simulcast: bool = True, + metadata: dict[str, typing.Any] | None = None, + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### enable_simulcast +```python +enable_simulcast: bool = True + +``` +Enables the peer to use simulcast + +### metadata +```python +metadata: dict[str, typing.Any] | None = None + +``` +Peer metadata + +### subscribe_mode +```python +subscribe_mode: Literal['auto', 'manual'] = 'auto' + +``` +Configuration of peer's subscribing policy + +--- +## RoomOptions +```python +class RoomOptions: +``` +Description of a room options + +### __init__ +```python +def __init__( + max_peers: int | None = None, + video_codec: Optional[Literal['h264', 'vp8']] = None, + webhook_url: str | None = None, + room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', + public: bool = False +) +``` + + +### max_peers +```python +max_peers: int | None = None + +``` +Maximum amount of peers allowed into the room + +### video_codec +```python +video_codec: Optional[Literal['h264', 'vp8']] = None + +``` +Enforces video codec for each peer in the room + +### webhook_url +```python +webhook_url: str | None = None + +``` +URL where Fishjam notifications will be sent + +### room_type +```python +room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' + +``` +The use-case of the room. If not provided, this defaults to conference. + +### public +```python +public: bool = False + +``` +True if livestream viewers can omit specifying a token. + +--- +## AgentOptions +```python +class AgentOptions: +``` +Options specific to a WebRTC Peer + +### __init__ +```python +def __init__( + output: AgentOutputOptions = , + subscribe_mode: Literal['auto', 'manual'] = 'auto' +) +``` + + +### output +```python +output: AgentOutputOptions +``` + + +### subscribe_mode +```python +subscribe_mode: Literal['auto', 'manual'] = 'auto' + +``` + + +--- +## AgentOutputOptions +```python +class AgentOutputOptions: +``` +Options of the desired format of audio tracks going from Fishjam to the agent. + +### __init__ +```python +def __init__( + audio_format: Literal['pcm16'] = 'pcm16', + audio_sample_rate: Literal[16000, 24000] = 16000 +) +``` + + +### audio_format +```python +audio_format: Literal['pcm16'] = 'pcm16' + +``` + + +### audio_sample_rate +```python +audio_sample_rate: Literal[16000, 24000] = 16000 + +``` + + +--- +## Room +```python +class Room: +``` +Description of the room state + +### __init__ +```python +def __init__( + config: RoomConfig, + id: str, + peers: list[Peer] +) +``` + + +### config +```python +config: RoomConfig +``` +Room configuration + +### id +```python +id: str +``` +Room ID + +### peers +```python +peers: list[Peer] +``` +List of all peers + +--- +## Peer +```python +class Peer: +``` +Describes peer status + +Attributes: + id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. + metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. + status (PeerStatus): Informs about the peer status Example: disconnected. + subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy + subscriptions (Subscriptions): Describes peer's subscriptions in manual mode + tracks (list['Track']): List of all peer's tracks + type_ (PeerType): Peer type Example: webrtc. + +### __init__ +```python +def __init__( + id: str, + metadata: Optional[PeerMetadata], + status: PeerStatus, + subscribe_mode: SubscribeMode, + subscriptions: Subscriptions, + tracks: list[Track], + type_: PeerType +) +``` +Method generated by attrs for class Peer. + +### id +```python +id: str +``` + + +### metadata +```python +metadata: Optional[PeerMetadata] +``` + + +### status +```python +status: PeerStatus +``` + + +### subscribe_mode +```python +subscribe_mode: SubscribeMode +``` + + +### subscriptions +```python +subscriptions: Subscriptions +``` + + +### tracks +```python +tracks: list[Track] +``` + + +### type_ +```python +type_: PeerType +``` + + +### additional_properties +```python +additional_properties: dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: list[str] +``` + + +--- diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/agent.md b/docs/api/server-python/submodules/agent.md similarity index 83% rename from versioned_docs/version-0.20.0/api/server-python/fishjam/agent.md rename to docs/api/server-python/submodules/agent.md index 56cccf28..3fae055c 100644 --- a/versioned_docs/version-0.20.0/api/server-python/fishjam/agent.md +++ b/docs/api/server-python/submodules/agent.md @@ -50,7 +50,7 @@ defined with :func:`on_track_data`. --- ## AgentError ```python -class AgentError(builtins.Exception): +class AgentError(Exception): ``` Base exception class for all agent exceptions @@ -80,7 +80,7 @@ agent ```python def receive( self -) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +) -> AsyncIterator[AgentResponseTrackData] ``` Returns an infinite async iterator over the incoming messages from Fishjam to the agent. @@ -123,7 +123,7 @@ reason --- ## IncomingTrackData ```python -IncomingTrackData = +IncomingTrackData = ``` @@ -148,19 +148,19 @@ def __init__( ### id ```python -id: : str +id: str ``` The global identifier of the track. ### session ```python -session: : fishjam.agent.agent.AgentSession +session: fishjam.agent.agent.AgentSession ``` The agent the track belongs to. ### options ```python -options: : fishjam.agent.agent.OutgoingAudioTrackOptions +options: fishjam.agent.agent.OutgoingAudioTrackOptions ``` The parameters used to create the track. @@ -193,7 +193,7 @@ Parameters of an outgoing audio track. ### __init__ ```python def __init__( - encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + encoding: TrackEncoding = , sample_rate: Literal[16000, 24000] = 16000, channels: Literal[1, 2] = 1, metadata: dict[str, typing.Any] | None = None @@ -203,7 +203,7 @@ def __init__( ### encoding ```python -encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = +encoding: TrackEncoding = ``` The encoding of the audio source. @@ -211,7 +211,7 @@ Defaults to raw 16-bit PCM. ### sample_rate ```python -sample_rate: : Literal[16000, 24000] = 16000 +sample_rate: Literal[16000, 24000] = 16000 ``` The sample rate of the audio source. @@ -219,7 +219,7 @@ Defaults to 16000. ### channels ```python -channels: : Literal[1, 2] = 1 +channels: Literal[1, 2] = 1 ``` The number of channels in the audio source. @@ -228,7 +228,7 @@ Defaults to 1 (mono) ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Custom metadata for the track. diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/errors.md b/docs/api/server-python/submodules/errors.md similarity index 93% rename from versioned_docs/version-0.21.0/api/server-python/fishjam/errors.md rename to docs/api/server-python/submodules/errors.md index 0d719368..41f7cc57 100644 --- a/versioned_docs/version-0.21.0/api/server-python/fishjam/errors.md +++ b/docs/api/server-python/submodules/errors.md @@ -10,7 +10,7 @@ custom_edit_url: null ## HTTPError ```python -class HTTPError(builtins.Exception): +class HTTPError(Exception): ``` diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/events.md b/docs/api/server-python/submodules/events.md similarity index 80% rename from versioned_docs/version-0.21.0/api/server-python/fishjam/events.md rename to docs/api/server-python/submodules/events.md index 052ec540..b36fd45a 100644 --- a/versioned_docs/version-0.21.0/api/server-python/fishjam/events.md +++ b/docs/api/server-python/submodules/events.md @@ -22,7 +22,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -53,7 +53,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -84,7 +84,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -112,26 +112,26 @@ Notification sent when a peer is added def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -159,26 +159,26 @@ Notification sent when a peer connects def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -206,26 +206,26 @@ Notification sent when a peer is removed def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -253,26 +253,26 @@ Notification sent when a peer disconnects from FJ def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -301,32 +301,32 @@ def __init__( room_id: str = , peer_id: str = , metadata: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### metadata ```python -metadata: : str +metadata: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -355,32 +355,32 @@ def __init__( room_id: str = , peer_id: str = , reason: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### reason ```python -reason: : str +reason: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -411,7 +411,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -442,7 +442,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -471,32 +471,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -525,32 +525,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -579,32 +579,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -635,13 +635,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -672,13 +672,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -705,7 +705,7 @@ Describes a media track ```python def __init__( id: str = , - type: fishjam.events._protos.fishjam.notifications.TrackType = , + type: TrackType = , metadata: str = ) ``` @@ -713,19 +713,19 @@ def __init__( ### id ```python -id: : str +id: str ``` ### type ```python -type: : fishjam.events._protos.fishjam.notifications.TrackType +type: TrackType ``` ### metadata ```python -metadata: : str +metadata: str ``` @@ -751,21 +751,21 @@ from this. Bases :class:`enum.IntEnum`. ### TRACK_ENCODING_UNSPECIFIED ```python -TRACK_ENCODING_UNSPECIFIED = +TRACK_ENCODING_UNSPECIFIED = ``` ### TRACK_ENCODING_PCM16 ```python -TRACK_ENCODING_PCM16 = +TRACK_ENCODING_PCM16 = ``` ### TRACK_ENCODING_OPUS ```python -TRACK_ENCODING_OPUS = +TRACK_ENCODING_OPUS = ``` @@ -790,21 +790,21 @@ Defines types of tracks being published by peers and component ### TRACK_TYPE_UNSPECIFIED ```python -TRACK_TYPE_UNSPECIFIED = +TRACK_TYPE_UNSPECIFIED = ``` ### TRACK_TYPE_VIDEO ```python -TRACK_TYPE_VIDEO = +TRACK_TYPE_VIDEO = ``` ### TRACK_TYPE_AUDIO ```python -TRACK_TYPE_AUDIO = +TRACK_TYPE_AUDIO = ``` @@ -830,21 +830,21 @@ from this. Bases :class:`enum.IntEnum`. ### PEER_TYPE_UNSPECIFIED ```python -PEER_TYPE_UNSPECIFIED = +PEER_TYPE_UNSPECIFIED = ``` ### PEER_TYPE_WEBRTC ```python -PEER_TYPE_WEBRTC = +PEER_TYPE_WEBRTC = ``` ### PEER_TYPE_AGENT ```python -PEER_TYPE_AGENT = +PEER_TYPE_AGENT = ``` diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/peer.md b/docs/api/server-python/submodules/peer.md similarity index 70% rename from versioned_docs/version-0.22.0/api/server-python/fishjam/peer.md rename to docs/api/server-python/submodules/peer.md index 4a5e0fcc..c1bfb405 100644 --- a/versioned_docs/version-0.22.0/api/server-python/fishjam/peer.md +++ b/docs/api/server-python/submodules/peer.md @@ -25,7 +25,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -43,27 +43,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## PeerStatus ```python -class PeerStatus(builtins.str, enum.Enum): +class PeerStatus(str, enum.Enum): ``` Informs about the peer status ### CONNECTED ```python -CONNECTED = +CONNECTED = ``` ### DISCONNECTED ```python -DISCONNECTED = +DISCONNECTED = ``` @@ -75,20 +75,20 @@ DISCONNECTED = --- ## PeerType ```python -class PeerType(builtins.str, enum.Enum): +class PeerType(str, enum.Enum): ``` Peer type ### AGENT ```python -AGENT = +AGENT = ``` ### WEBRTC ```python -WEBRTC = +WEBRTC = ``` diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/room.md b/docs/api/server-python/submodules/room.md similarity index 50% rename from versioned_docs/version-0.22.0/api/server-python/fishjam/room.md rename to docs/api/server-python/submodules/room.md index 53847c63..6459e895 100644 --- a/versioned_docs/version-0.22.0/api/server-python/fishjam/room.md +++ b/docs/api/server-python/submodules/room.md @@ -27,48 +27,48 @@ Attributes: ### __init__ ```python def __init__( - max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , - public: Union[fishjam._openapi_client.types.Unset, bool] = False, - room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , - video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = + max_peers: Union[NoneType, Unset, int] = , + public: Union[Unset, bool] = False, + room_type: Union[Unset, RoomConfigRoomType] = , + video_codec: Union[Unset, RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, Unset, str] = ) ``` Method generated by attrs for class RoomConfig. ### max_peers ```python -max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +max_peers: Union[NoneType, Unset, int] ``` ### public ```python -public: : Union[fishjam._openapi_client.types.Unset, bool] +public: Union[Unset, bool] ``` ### room_type ```python -room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +room_type: Union[Unset, RoomConfigRoomType] ``` ### video_codec ```python -video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +video_codec: Union[Unset, RoomConfigVideoCodec] ``` ### webhook_url ```python -webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +webhook_url: Union[NoneType, Unset, str] ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -86,27 +86,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## RoomConfigVideoCodec ```python -class RoomConfigVideoCodec(builtins.str, enum.Enum): +class RoomConfigVideoCodec(str, enum.Enum): ``` Enforces video codec for each peer in the room ### H264 ```python -H264 = +H264 = ``` ### VP8 ```python -VP8 = +VP8 = ``` @@ -118,48 +118,48 @@ VP8 = --- ## RoomConfigRoomType ```python -class RoomConfigRoomType(builtins.str, enum.Enum): +class RoomConfigRoomType(str, enum.Enum): ``` The use-case of the room. If not provided, this defaults to conference. ### AUDIO_ONLY ```python -AUDIO_ONLY = +AUDIO_ONLY = ``` ### AUDIO_ONLY_LIVESTREAM ```python -AUDIO_ONLY_LIVESTREAM = +AUDIO_ONLY_LIVESTREAM = ``` ### BROADCASTER ```python -BROADCASTER = +BROADCASTER = ``` ### CONFERENCE ```python -CONFERENCE = +CONFERENCE = ``` ### FULL_FEATURE ```python -FULL_FEATURE = +FULL_FEATURE = ``` ### LIVESTREAM ```python -LIVESTREAM = +LIVESTREAM = ``` diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam.md b/versioned_docs/version-0.20.0/api/server-python/fishjam.md index 1a6d1da2..f0c4dcd2 100644 --- a/versioned_docs/version-0.20.0/api/server-python/fishjam.md +++ b/versioned_docs/version-0.20.0/api/server-python/fishjam.md @@ -8,15 +8,15 @@ custom_edit_url: null ## Submodules -- [events](fishjam/events) -- [errors](fishjam/errors) -- [room](fishjam/room) -- [peer](fishjam/peer) -- [agent](fishjam/agent) +- [events](submodules/events) +- [errors](submodules/errors) +- [room](submodules/room) +- [peer](submodules/peer) +- [agent](submodules/agent) ## FishjamClient ```python -class FishjamClient(fishjam.api._client.Client): +class FishjamClient(Client): ``` Allows for managing rooms @@ -31,8 +31,8 @@ Create a FishjamClient instance, providing the fishjam id and management token. def create_peer( self, room_id: str, - options: fishjam.api._fishjam_client.PeerOptions | None = None -) -> tuple[fishjam._openapi_client.models.peer.Peer, str] + options: PeerOptions | None = None +) -> tuple[Peer, str] ``` Creates peer in the room @@ -46,7 +46,7 @@ The possible options to pass for peer are `PeerOptions`. def create_agent( self, room_id: str, - options: fishjam.api._fishjam_client.AgentOptions | None = None + options: AgentOptions | None = None ) ``` @@ -55,21 +55,21 @@ def create_agent( ```python def create_room( self, - options: fishjam.api._fishjam_client.RoomOptions | None = None -) -> fishjam.api._fishjam_client.Room + options: RoomOptions | None = None +) -> Room ``` Creates a new room Returns the created `Room` ### get_all_rooms ```python -def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +def get_all_rooms(self) -> list[Room] ``` Returns list of all rooms ### get_room ```python -def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +def get_room(self, room_id: str) -> Room ``` Returns room with the given id @@ -135,7 +135,7 @@ Create FishjamNotifier instance, providing the fishjam id and management token. ```python def on_server_notification( self, - handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] + handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] ) ``` Decorator used for defining handler for Fishjam Notifications @@ -168,7 +168,7 @@ If already connected, returns immediately. ```python def receive_binary( binary: bytes -) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] ``` Transform received protobuf notification to adequate notification instance. The available notifications are listed in `fishjam.events` module. @@ -191,7 +191,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -209,7 +209,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` @@ -232,21 +232,21 @@ def __init__( ### enable_simulcast ```python -enable_simulcast: : bool = True +enable_simulcast: bool = True ``` Enables the peer to use simulcast ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Peer metadata ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` Configuration of peer's subscribing policy @@ -272,35 +272,35 @@ def __init__( ### max_peers ```python -max_peers: : int | None = None +max_peers: int | None = None ``` Maximum amount of peers allowed into the room ### video_codec ```python -video_codec: : Optional[Literal['h264', 'vp8']] = None +video_codec: Optional[Literal['h264', 'vp8']] = None ``` Enforces video codec for each peer in the room ### webhook_url ```python -webhook_url: : str | None = None +webhook_url: str | None = None ``` URL where Fishjam notifications will be sent ### room_type ```python -room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' +room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' ``` The use-case of the room. If not provided, this defaults to conference. ### public ```python -public: : bool = False +public: bool = False ``` True if livestream viewers can omit specifying a token. @@ -315,7 +315,7 @@ Options specific to a WebRTC Peer ### __init__ ```python def __init__( - output: fishjam.api._fishjam_client.AgentOutputOptions = , + output: AgentOutputOptions = , subscribe_mode: Literal['auto', 'manual'] = 'auto' ) ``` @@ -323,13 +323,13 @@ def __init__( ### output ```python -output: : fishjam.api._fishjam_client.AgentOutputOptions +output: AgentOutputOptions ``` ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` @@ -352,14 +352,14 @@ def __init__( ### audio_format ```python -audio_format: : Literal['pcm16'] = 'pcm16' +audio_format: Literal['pcm16'] = 'pcm16' ``` ### audio_sample_rate ```python -audio_sample_rate: : Literal[16000, 24000] = 16000 +audio_sample_rate: Literal[16000, 24000] = 16000 ``` @@ -374,28 +374,28 @@ Description of the room state ### __init__ ```python def __init__( - config: fishjam._openapi_client.models.room_config.RoomConfig, + config: RoomConfig, id: str, - peers: list[fishjam._openapi_client.models.peer.Peer] + peers: list[Peer] ) ``` ### config ```python -config: : fishjam._openapi_client.models.room_config.RoomConfig +config: RoomConfig ``` Room configuration ### id ```python -id: : str +id: str ``` Room ID ### peers ```python -peers: : list[fishjam._openapi_client.models.peer.Peer] +peers: list[Peer] ``` List of all peers @@ -419,61 +419,61 @@ Attributes: ```python def __init__( id: str, - metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], - status: fishjam._openapi_client.models.peer_status.PeerStatus, - subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, - subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, - tracks: list[fishjam._openapi_client.models.track.Track], - type_: fishjam._openapi_client.models.peer_type.PeerType + metadata: Optional[PeerMetadata], + status: PeerStatus, + subscribe_mode: SubscribeMode, + subscriptions: Subscriptions, + tracks: list[Track], + type_: PeerType ) ``` Method generated by attrs for class Peer. ### id ```python -id: : str +id: str ``` ### metadata ```python -metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +metadata: Optional[PeerMetadata] ``` ### status ```python -status: : fishjam._openapi_client.models.peer_status.PeerStatus +status: PeerStatus ``` ### subscribe_mode ```python -subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +subscribe_mode: SubscribeMode ``` ### subscriptions ```python -subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +subscriptions: Subscriptions ``` ### tracks ```python -tracks: : list[fishjam._openapi_client.models.track.Track] +tracks: list[Track] ``` ### type_ ```python -type_: : fishjam._openapi_client.models.peer_type.PeerType +type_: PeerType ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -491,7 +491,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/agent.md b/versioned_docs/version-0.20.0/api/server-python/submodules/agent.md similarity index 83% rename from versioned_docs/version-0.22.0/api/server-python/fishjam/agent.md rename to versioned_docs/version-0.20.0/api/server-python/submodules/agent.md index 56cccf28..3fae055c 100644 --- a/versioned_docs/version-0.22.0/api/server-python/fishjam/agent.md +++ b/versioned_docs/version-0.20.0/api/server-python/submodules/agent.md @@ -50,7 +50,7 @@ defined with :func:`on_track_data`. --- ## AgentError ```python -class AgentError(builtins.Exception): +class AgentError(Exception): ``` Base exception class for all agent exceptions @@ -80,7 +80,7 @@ agent ```python def receive( self -) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +) -> AsyncIterator[AgentResponseTrackData] ``` Returns an infinite async iterator over the incoming messages from Fishjam to the agent. @@ -123,7 +123,7 @@ reason --- ## IncomingTrackData ```python -IncomingTrackData = +IncomingTrackData = ``` @@ -148,19 +148,19 @@ def __init__( ### id ```python -id: : str +id: str ``` The global identifier of the track. ### session ```python -session: : fishjam.agent.agent.AgentSession +session: fishjam.agent.agent.AgentSession ``` The agent the track belongs to. ### options ```python -options: : fishjam.agent.agent.OutgoingAudioTrackOptions +options: fishjam.agent.agent.OutgoingAudioTrackOptions ``` The parameters used to create the track. @@ -193,7 +193,7 @@ Parameters of an outgoing audio track. ### __init__ ```python def __init__( - encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + encoding: TrackEncoding = , sample_rate: Literal[16000, 24000] = 16000, channels: Literal[1, 2] = 1, metadata: dict[str, typing.Any] | None = None @@ -203,7 +203,7 @@ def __init__( ### encoding ```python -encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = +encoding: TrackEncoding = ``` The encoding of the audio source. @@ -211,7 +211,7 @@ Defaults to raw 16-bit PCM. ### sample_rate ```python -sample_rate: : Literal[16000, 24000] = 16000 +sample_rate: Literal[16000, 24000] = 16000 ``` The sample rate of the audio source. @@ -219,7 +219,7 @@ Defaults to 16000. ### channels ```python -channels: : Literal[1, 2] = 1 +channels: Literal[1, 2] = 1 ``` The number of channels in the audio source. @@ -228,7 +228,7 @@ Defaults to 1 (mono) ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Custom metadata for the track. diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/errors.md b/versioned_docs/version-0.20.0/api/server-python/submodules/errors.md similarity index 93% rename from versioned_docs/version-0.20.0/api/server-python/fishjam/errors.md rename to versioned_docs/version-0.20.0/api/server-python/submodules/errors.md index 0d719368..41f7cc57 100644 --- a/versioned_docs/version-0.20.0/api/server-python/fishjam/errors.md +++ b/versioned_docs/version-0.20.0/api/server-python/submodules/errors.md @@ -10,7 +10,7 @@ custom_edit_url: null ## HTTPError ```python -class HTTPError(builtins.Exception): +class HTTPError(Exception): ``` diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/events.md b/versioned_docs/version-0.20.0/api/server-python/submodules/events.md similarity index 80% rename from versioned_docs/version-0.22.0/api/server-python/fishjam/events.md rename to versioned_docs/version-0.20.0/api/server-python/submodules/events.md index 052ec540..b36fd45a 100644 --- a/versioned_docs/version-0.22.0/api/server-python/fishjam/events.md +++ b/versioned_docs/version-0.20.0/api/server-python/submodules/events.md @@ -22,7 +22,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -53,7 +53,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -84,7 +84,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -112,26 +112,26 @@ Notification sent when a peer is added def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -159,26 +159,26 @@ Notification sent when a peer connects def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -206,26 +206,26 @@ Notification sent when a peer is removed def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -253,26 +253,26 @@ Notification sent when a peer disconnects from FJ def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -301,32 +301,32 @@ def __init__( room_id: str = , peer_id: str = , metadata: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### metadata ```python -metadata: : str +metadata: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -355,32 +355,32 @@ def __init__( room_id: str = , peer_id: str = , reason: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### reason ```python -reason: : str +reason: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -411,7 +411,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -442,7 +442,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -471,32 +471,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -525,32 +525,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -579,32 +579,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -635,13 +635,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -672,13 +672,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -705,7 +705,7 @@ Describes a media track ```python def __init__( id: str = , - type: fishjam.events._protos.fishjam.notifications.TrackType = , + type: TrackType = , metadata: str = ) ``` @@ -713,19 +713,19 @@ def __init__( ### id ```python -id: : str +id: str ``` ### type ```python -type: : fishjam.events._protos.fishjam.notifications.TrackType +type: TrackType ``` ### metadata ```python -metadata: : str +metadata: str ``` @@ -751,21 +751,21 @@ from this. Bases :class:`enum.IntEnum`. ### TRACK_ENCODING_UNSPECIFIED ```python -TRACK_ENCODING_UNSPECIFIED = +TRACK_ENCODING_UNSPECIFIED = ``` ### TRACK_ENCODING_PCM16 ```python -TRACK_ENCODING_PCM16 = +TRACK_ENCODING_PCM16 = ``` ### TRACK_ENCODING_OPUS ```python -TRACK_ENCODING_OPUS = +TRACK_ENCODING_OPUS = ``` @@ -790,21 +790,21 @@ Defines types of tracks being published by peers and component ### TRACK_TYPE_UNSPECIFIED ```python -TRACK_TYPE_UNSPECIFIED = +TRACK_TYPE_UNSPECIFIED = ``` ### TRACK_TYPE_VIDEO ```python -TRACK_TYPE_VIDEO = +TRACK_TYPE_VIDEO = ``` ### TRACK_TYPE_AUDIO ```python -TRACK_TYPE_AUDIO = +TRACK_TYPE_AUDIO = ``` @@ -830,21 +830,21 @@ from this. Bases :class:`enum.IntEnum`. ### PEER_TYPE_UNSPECIFIED ```python -PEER_TYPE_UNSPECIFIED = +PEER_TYPE_UNSPECIFIED = ``` ### PEER_TYPE_WEBRTC ```python -PEER_TYPE_WEBRTC = +PEER_TYPE_WEBRTC = ``` ### PEER_TYPE_AGENT ```python -PEER_TYPE_AGENT = +PEER_TYPE_AGENT = ``` diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/peer.md b/versioned_docs/version-0.20.0/api/server-python/submodules/peer.md similarity index 70% rename from versioned_docs/version-0.23.0/api/server-python/fishjam/peer.md rename to versioned_docs/version-0.20.0/api/server-python/submodules/peer.md index 4a5e0fcc..c1bfb405 100644 --- a/versioned_docs/version-0.23.0/api/server-python/fishjam/peer.md +++ b/versioned_docs/version-0.20.0/api/server-python/submodules/peer.md @@ -25,7 +25,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -43,27 +43,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## PeerStatus ```python -class PeerStatus(builtins.str, enum.Enum): +class PeerStatus(str, enum.Enum): ``` Informs about the peer status ### CONNECTED ```python -CONNECTED = +CONNECTED = ``` ### DISCONNECTED ```python -DISCONNECTED = +DISCONNECTED = ``` @@ -75,20 +75,20 @@ DISCONNECTED = --- ## PeerType ```python -class PeerType(builtins.str, enum.Enum): +class PeerType(str, enum.Enum): ``` Peer type ### AGENT ```python -AGENT = +AGENT = ``` ### WEBRTC ```python -WEBRTC = +WEBRTC = ``` diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/room.md b/versioned_docs/version-0.20.0/api/server-python/submodules/room.md similarity index 50% rename from versioned_docs/version-0.20.0/api/server-python/fishjam/room.md rename to versioned_docs/version-0.20.0/api/server-python/submodules/room.md index 53847c63..6459e895 100644 --- a/versioned_docs/version-0.20.0/api/server-python/fishjam/room.md +++ b/versioned_docs/version-0.20.0/api/server-python/submodules/room.md @@ -27,48 +27,48 @@ Attributes: ### __init__ ```python def __init__( - max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , - public: Union[fishjam._openapi_client.types.Unset, bool] = False, - room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , - video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = + max_peers: Union[NoneType, Unset, int] = , + public: Union[Unset, bool] = False, + room_type: Union[Unset, RoomConfigRoomType] = , + video_codec: Union[Unset, RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, Unset, str] = ) ``` Method generated by attrs for class RoomConfig. ### max_peers ```python -max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +max_peers: Union[NoneType, Unset, int] ``` ### public ```python -public: : Union[fishjam._openapi_client.types.Unset, bool] +public: Union[Unset, bool] ``` ### room_type ```python -room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +room_type: Union[Unset, RoomConfigRoomType] ``` ### video_codec ```python -video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +video_codec: Union[Unset, RoomConfigVideoCodec] ``` ### webhook_url ```python -webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +webhook_url: Union[NoneType, Unset, str] ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -86,27 +86,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## RoomConfigVideoCodec ```python -class RoomConfigVideoCodec(builtins.str, enum.Enum): +class RoomConfigVideoCodec(str, enum.Enum): ``` Enforces video codec for each peer in the room ### H264 ```python -H264 = +H264 = ``` ### VP8 ```python -VP8 = +VP8 = ``` @@ -118,48 +118,48 @@ VP8 = --- ## RoomConfigRoomType ```python -class RoomConfigRoomType(builtins.str, enum.Enum): +class RoomConfigRoomType(str, enum.Enum): ``` The use-case of the room. If not provided, this defaults to conference. ### AUDIO_ONLY ```python -AUDIO_ONLY = +AUDIO_ONLY = ``` ### AUDIO_ONLY_LIVESTREAM ```python -AUDIO_ONLY_LIVESTREAM = +AUDIO_ONLY_LIVESTREAM = ``` ### BROADCASTER ```python -BROADCASTER = +BROADCASTER = ``` ### CONFERENCE ```python -CONFERENCE = +CONFERENCE = ``` ### FULL_FEATURE ```python -FULL_FEATURE = +FULL_FEATURE = ``` ### LIVESTREAM ```python -LIVESTREAM = +LIVESTREAM = ``` diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam.md b/versioned_docs/version-0.21.0/api/server-python/fishjam.md index 1a6d1da2..f0c4dcd2 100644 --- a/versioned_docs/version-0.21.0/api/server-python/fishjam.md +++ b/versioned_docs/version-0.21.0/api/server-python/fishjam.md @@ -8,15 +8,15 @@ custom_edit_url: null ## Submodules -- [events](fishjam/events) -- [errors](fishjam/errors) -- [room](fishjam/room) -- [peer](fishjam/peer) -- [agent](fishjam/agent) +- [events](submodules/events) +- [errors](submodules/errors) +- [room](submodules/room) +- [peer](submodules/peer) +- [agent](submodules/agent) ## FishjamClient ```python -class FishjamClient(fishjam.api._client.Client): +class FishjamClient(Client): ``` Allows for managing rooms @@ -31,8 +31,8 @@ Create a FishjamClient instance, providing the fishjam id and management token. def create_peer( self, room_id: str, - options: fishjam.api._fishjam_client.PeerOptions | None = None -) -> tuple[fishjam._openapi_client.models.peer.Peer, str] + options: PeerOptions | None = None +) -> tuple[Peer, str] ``` Creates peer in the room @@ -46,7 +46,7 @@ The possible options to pass for peer are `PeerOptions`. def create_agent( self, room_id: str, - options: fishjam.api._fishjam_client.AgentOptions | None = None + options: AgentOptions | None = None ) ``` @@ -55,21 +55,21 @@ def create_agent( ```python def create_room( self, - options: fishjam.api._fishjam_client.RoomOptions | None = None -) -> fishjam.api._fishjam_client.Room + options: RoomOptions | None = None +) -> Room ``` Creates a new room Returns the created `Room` ### get_all_rooms ```python -def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +def get_all_rooms(self) -> list[Room] ``` Returns list of all rooms ### get_room ```python -def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +def get_room(self, room_id: str) -> Room ``` Returns room with the given id @@ -135,7 +135,7 @@ Create FishjamNotifier instance, providing the fishjam id and management token. ```python def on_server_notification( self, - handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] + handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] ) ``` Decorator used for defining handler for Fishjam Notifications @@ -168,7 +168,7 @@ If already connected, returns immediately. ```python def receive_binary( binary: bytes -) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] ``` Transform received protobuf notification to adequate notification instance. The available notifications are listed in `fishjam.events` module. @@ -191,7 +191,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -209,7 +209,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` @@ -232,21 +232,21 @@ def __init__( ### enable_simulcast ```python -enable_simulcast: : bool = True +enable_simulcast: bool = True ``` Enables the peer to use simulcast ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Peer metadata ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` Configuration of peer's subscribing policy @@ -272,35 +272,35 @@ def __init__( ### max_peers ```python -max_peers: : int | None = None +max_peers: int | None = None ``` Maximum amount of peers allowed into the room ### video_codec ```python -video_codec: : Optional[Literal['h264', 'vp8']] = None +video_codec: Optional[Literal['h264', 'vp8']] = None ``` Enforces video codec for each peer in the room ### webhook_url ```python -webhook_url: : str | None = None +webhook_url: str | None = None ``` URL where Fishjam notifications will be sent ### room_type ```python -room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' +room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' ``` The use-case of the room. If not provided, this defaults to conference. ### public ```python -public: : bool = False +public: bool = False ``` True if livestream viewers can omit specifying a token. @@ -315,7 +315,7 @@ Options specific to a WebRTC Peer ### __init__ ```python def __init__( - output: fishjam.api._fishjam_client.AgentOutputOptions = , + output: AgentOutputOptions = , subscribe_mode: Literal['auto', 'manual'] = 'auto' ) ``` @@ -323,13 +323,13 @@ def __init__( ### output ```python -output: : fishjam.api._fishjam_client.AgentOutputOptions +output: AgentOutputOptions ``` ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` @@ -352,14 +352,14 @@ def __init__( ### audio_format ```python -audio_format: : Literal['pcm16'] = 'pcm16' +audio_format: Literal['pcm16'] = 'pcm16' ``` ### audio_sample_rate ```python -audio_sample_rate: : Literal[16000, 24000] = 16000 +audio_sample_rate: Literal[16000, 24000] = 16000 ``` @@ -374,28 +374,28 @@ Description of the room state ### __init__ ```python def __init__( - config: fishjam._openapi_client.models.room_config.RoomConfig, + config: RoomConfig, id: str, - peers: list[fishjam._openapi_client.models.peer.Peer] + peers: list[Peer] ) ``` ### config ```python -config: : fishjam._openapi_client.models.room_config.RoomConfig +config: RoomConfig ``` Room configuration ### id ```python -id: : str +id: str ``` Room ID ### peers ```python -peers: : list[fishjam._openapi_client.models.peer.Peer] +peers: list[Peer] ``` List of all peers @@ -419,61 +419,61 @@ Attributes: ```python def __init__( id: str, - metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], - status: fishjam._openapi_client.models.peer_status.PeerStatus, - subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, - subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, - tracks: list[fishjam._openapi_client.models.track.Track], - type_: fishjam._openapi_client.models.peer_type.PeerType + metadata: Optional[PeerMetadata], + status: PeerStatus, + subscribe_mode: SubscribeMode, + subscriptions: Subscriptions, + tracks: list[Track], + type_: PeerType ) ``` Method generated by attrs for class Peer. ### id ```python -id: : str +id: str ``` ### metadata ```python -metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +metadata: Optional[PeerMetadata] ``` ### status ```python -status: : fishjam._openapi_client.models.peer_status.PeerStatus +status: PeerStatus ``` ### subscribe_mode ```python -subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +subscribe_mode: SubscribeMode ``` ### subscriptions ```python -subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +subscriptions: Subscriptions ``` ### tracks ```python -tracks: : list[fishjam._openapi_client.models.track.Track] +tracks: list[Track] ``` ### type_ ```python -type_: : fishjam._openapi_client.models.peer_type.PeerType +type_: PeerType ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -491,7 +491,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/agent.md b/versioned_docs/version-0.21.0/api/server-python/submodules/agent.md similarity index 83% rename from versioned_docs/version-0.21.0/api/server-python/fishjam/agent.md rename to versioned_docs/version-0.21.0/api/server-python/submodules/agent.md index 56cccf28..3fae055c 100644 --- a/versioned_docs/version-0.21.0/api/server-python/fishjam/agent.md +++ b/versioned_docs/version-0.21.0/api/server-python/submodules/agent.md @@ -50,7 +50,7 @@ defined with :func:`on_track_data`. --- ## AgentError ```python -class AgentError(builtins.Exception): +class AgentError(Exception): ``` Base exception class for all agent exceptions @@ -80,7 +80,7 @@ agent ```python def receive( self -) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +) -> AsyncIterator[AgentResponseTrackData] ``` Returns an infinite async iterator over the incoming messages from Fishjam to the agent. @@ -123,7 +123,7 @@ reason --- ## IncomingTrackData ```python -IncomingTrackData = +IncomingTrackData = ``` @@ -148,19 +148,19 @@ def __init__( ### id ```python -id: : str +id: str ``` The global identifier of the track. ### session ```python -session: : fishjam.agent.agent.AgentSession +session: fishjam.agent.agent.AgentSession ``` The agent the track belongs to. ### options ```python -options: : fishjam.agent.agent.OutgoingAudioTrackOptions +options: fishjam.agent.agent.OutgoingAudioTrackOptions ``` The parameters used to create the track. @@ -193,7 +193,7 @@ Parameters of an outgoing audio track. ### __init__ ```python def __init__( - encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + encoding: TrackEncoding = , sample_rate: Literal[16000, 24000] = 16000, channels: Literal[1, 2] = 1, metadata: dict[str, typing.Any] | None = None @@ -203,7 +203,7 @@ def __init__( ### encoding ```python -encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = +encoding: TrackEncoding = ``` The encoding of the audio source. @@ -211,7 +211,7 @@ Defaults to raw 16-bit PCM. ### sample_rate ```python -sample_rate: : Literal[16000, 24000] = 16000 +sample_rate: Literal[16000, 24000] = 16000 ``` The sample rate of the audio source. @@ -219,7 +219,7 @@ Defaults to 16000. ### channels ```python -channels: : Literal[1, 2] = 1 +channels: Literal[1, 2] = 1 ``` The number of channels in the audio source. @@ -228,7 +228,7 @@ Defaults to 1 (mono) ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Custom metadata for the track. diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam/errors.md b/versioned_docs/version-0.21.0/api/server-python/submodules/errors.md similarity index 93% rename from versioned_docs/version-0.22.0/api/server-python/fishjam/errors.md rename to versioned_docs/version-0.21.0/api/server-python/submodules/errors.md index 0d719368..41f7cc57 100644 --- a/versioned_docs/version-0.22.0/api/server-python/fishjam/errors.md +++ b/versioned_docs/version-0.21.0/api/server-python/submodules/errors.md @@ -10,7 +10,7 @@ custom_edit_url: null ## HTTPError ```python -class HTTPError(builtins.Exception): +class HTTPError(Exception): ``` diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/events.md b/versioned_docs/version-0.21.0/api/server-python/submodules/events.md similarity index 80% rename from versioned_docs/version-0.20.0/api/server-python/fishjam/events.md rename to versioned_docs/version-0.21.0/api/server-python/submodules/events.md index 052ec540..b36fd45a 100644 --- a/versioned_docs/version-0.20.0/api/server-python/fishjam/events.md +++ b/versioned_docs/version-0.21.0/api/server-python/submodules/events.md @@ -22,7 +22,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -53,7 +53,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -84,7 +84,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -112,26 +112,26 @@ Notification sent when a peer is added def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -159,26 +159,26 @@ Notification sent when a peer connects def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -206,26 +206,26 @@ Notification sent when a peer is removed def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -253,26 +253,26 @@ Notification sent when a peer disconnects from FJ def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -301,32 +301,32 @@ def __init__( room_id: str = , peer_id: str = , metadata: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### metadata ```python -metadata: : str +metadata: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -355,32 +355,32 @@ def __init__( room_id: str = , peer_id: str = , reason: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### reason ```python -reason: : str +reason: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -411,7 +411,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -442,7 +442,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -471,32 +471,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -525,32 +525,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -579,32 +579,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -635,13 +635,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -672,13 +672,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -705,7 +705,7 @@ Describes a media track ```python def __init__( id: str = , - type: fishjam.events._protos.fishjam.notifications.TrackType = , + type: TrackType = , metadata: str = ) ``` @@ -713,19 +713,19 @@ def __init__( ### id ```python -id: : str +id: str ``` ### type ```python -type: : fishjam.events._protos.fishjam.notifications.TrackType +type: TrackType ``` ### metadata ```python -metadata: : str +metadata: str ``` @@ -751,21 +751,21 @@ from this. Bases :class:`enum.IntEnum`. ### TRACK_ENCODING_UNSPECIFIED ```python -TRACK_ENCODING_UNSPECIFIED = +TRACK_ENCODING_UNSPECIFIED = ``` ### TRACK_ENCODING_PCM16 ```python -TRACK_ENCODING_PCM16 = +TRACK_ENCODING_PCM16 = ``` ### TRACK_ENCODING_OPUS ```python -TRACK_ENCODING_OPUS = +TRACK_ENCODING_OPUS = ``` @@ -790,21 +790,21 @@ Defines types of tracks being published by peers and component ### TRACK_TYPE_UNSPECIFIED ```python -TRACK_TYPE_UNSPECIFIED = +TRACK_TYPE_UNSPECIFIED = ``` ### TRACK_TYPE_VIDEO ```python -TRACK_TYPE_VIDEO = +TRACK_TYPE_VIDEO = ``` ### TRACK_TYPE_AUDIO ```python -TRACK_TYPE_AUDIO = +TRACK_TYPE_AUDIO = ``` @@ -830,21 +830,21 @@ from this. Bases :class:`enum.IntEnum`. ### PEER_TYPE_UNSPECIFIED ```python -PEER_TYPE_UNSPECIFIED = +PEER_TYPE_UNSPECIFIED = ``` ### PEER_TYPE_WEBRTC ```python -PEER_TYPE_WEBRTC = +PEER_TYPE_WEBRTC = ``` ### PEER_TYPE_AGENT ```python -PEER_TYPE_AGENT = +PEER_TYPE_AGENT = ``` diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/peer.md b/versioned_docs/version-0.21.0/api/server-python/submodules/peer.md similarity index 70% rename from versioned_docs/version-0.21.0/api/server-python/fishjam/peer.md rename to versioned_docs/version-0.21.0/api/server-python/submodules/peer.md index 4a5e0fcc..c1bfb405 100644 --- a/versioned_docs/version-0.21.0/api/server-python/fishjam/peer.md +++ b/versioned_docs/version-0.21.0/api/server-python/submodules/peer.md @@ -25,7 +25,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -43,27 +43,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## PeerStatus ```python -class PeerStatus(builtins.str, enum.Enum): +class PeerStatus(str, enum.Enum): ``` Informs about the peer status ### CONNECTED ```python -CONNECTED = +CONNECTED = ``` ### DISCONNECTED ```python -DISCONNECTED = +DISCONNECTED = ``` @@ -75,20 +75,20 @@ DISCONNECTED = --- ## PeerType ```python -class PeerType(builtins.str, enum.Enum): +class PeerType(str, enum.Enum): ``` Peer type ### AGENT ```python -AGENT = +AGENT = ``` ### WEBRTC ```python -WEBRTC = +WEBRTC = ``` diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/room.md b/versioned_docs/version-0.21.0/api/server-python/submodules/room.md similarity index 50% rename from versioned_docs/version-0.23.0/api/server-python/fishjam/room.md rename to versioned_docs/version-0.21.0/api/server-python/submodules/room.md index 53847c63..6459e895 100644 --- a/versioned_docs/version-0.23.0/api/server-python/fishjam/room.md +++ b/versioned_docs/version-0.21.0/api/server-python/submodules/room.md @@ -27,48 +27,48 @@ Attributes: ### __init__ ```python def __init__( - max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , - public: Union[fishjam._openapi_client.types.Unset, bool] = False, - room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , - video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = + max_peers: Union[NoneType, Unset, int] = , + public: Union[Unset, bool] = False, + room_type: Union[Unset, RoomConfigRoomType] = , + video_codec: Union[Unset, RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, Unset, str] = ) ``` Method generated by attrs for class RoomConfig. ### max_peers ```python -max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +max_peers: Union[NoneType, Unset, int] ``` ### public ```python -public: : Union[fishjam._openapi_client.types.Unset, bool] +public: Union[Unset, bool] ``` ### room_type ```python -room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +room_type: Union[Unset, RoomConfigRoomType] ``` ### video_codec ```python -video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +video_codec: Union[Unset, RoomConfigVideoCodec] ``` ### webhook_url ```python -webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +webhook_url: Union[NoneType, Unset, str] ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -86,27 +86,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## RoomConfigVideoCodec ```python -class RoomConfigVideoCodec(builtins.str, enum.Enum): +class RoomConfigVideoCodec(str, enum.Enum): ``` Enforces video codec for each peer in the room ### H264 ```python -H264 = +H264 = ``` ### VP8 ```python -VP8 = +VP8 = ``` @@ -118,48 +118,48 @@ VP8 = --- ## RoomConfigRoomType ```python -class RoomConfigRoomType(builtins.str, enum.Enum): +class RoomConfigRoomType(str, enum.Enum): ``` The use-case of the room. If not provided, this defaults to conference. ### AUDIO_ONLY ```python -AUDIO_ONLY = +AUDIO_ONLY = ``` ### AUDIO_ONLY_LIVESTREAM ```python -AUDIO_ONLY_LIVESTREAM = +AUDIO_ONLY_LIVESTREAM = ``` ### BROADCASTER ```python -BROADCASTER = +BROADCASTER = ``` ### CONFERENCE ```python -CONFERENCE = +CONFERENCE = ``` ### FULL_FEATURE ```python -FULL_FEATURE = +FULL_FEATURE = ``` ### LIVESTREAM ```python -LIVESTREAM = +LIVESTREAM = ``` diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam.md b/versioned_docs/version-0.22.0/api/server-python/fishjam.md index 1a6d1da2..f0c4dcd2 100644 --- a/versioned_docs/version-0.22.0/api/server-python/fishjam.md +++ b/versioned_docs/version-0.22.0/api/server-python/fishjam.md @@ -8,15 +8,15 @@ custom_edit_url: null ## Submodules -- [events](fishjam/events) -- [errors](fishjam/errors) -- [room](fishjam/room) -- [peer](fishjam/peer) -- [agent](fishjam/agent) +- [events](submodules/events) +- [errors](submodules/errors) +- [room](submodules/room) +- [peer](submodules/peer) +- [agent](submodules/agent) ## FishjamClient ```python -class FishjamClient(fishjam.api._client.Client): +class FishjamClient(Client): ``` Allows for managing rooms @@ -31,8 +31,8 @@ Create a FishjamClient instance, providing the fishjam id and management token. def create_peer( self, room_id: str, - options: fishjam.api._fishjam_client.PeerOptions | None = None -) -> tuple[fishjam._openapi_client.models.peer.Peer, str] + options: PeerOptions | None = None +) -> tuple[Peer, str] ``` Creates peer in the room @@ -46,7 +46,7 @@ The possible options to pass for peer are `PeerOptions`. def create_agent( self, room_id: str, - options: fishjam.api._fishjam_client.AgentOptions | None = None + options: AgentOptions | None = None ) ``` @@ -55,21 +55,21 @@ def create_agent( ```python def create_room( self, - options: fishjam.api._fishjam_client.RoomOptions | None = None -) -> fishjam.api._fishjam_client.Room + options: RoomOptions | None = None +) -> Room ``` Creates a new room Returns the created `Room` ### get_all_rooms ```python -def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +def get_all_rooms(self) -> list[Room] ``` Returns list of all rooms ### get_room ```python -def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +def get_room(self, room_id: str) -> Room ``` Returns room with the given id @@ -135,7 +135,7 @@ Create FishjamNotifier instance, providing the fishjam id and management token. ```python def on_server_notification( self, - handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] + handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] ) ``` Decorator used for defining handler for Fishjam Notifications @@ -168,7 +168,7 @@ If already connected, returns immediately. ```python def receive_binary( binary: bytes -) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] ``` Transform received protobuf notification to adequate notification instance. The available notifications are listed in `fishjam.events` module. @@ -191,7 +191,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -209,7 +209,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` @@ -232,21 +232,21 @@ def __init__( ### enable_simulcast ```python -enable_simulcast: : bool = True +enable_simulcast: bool = True ``` Enables the peer to use simulcast ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Peer metadata ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` Configuration of peer's subscribing policy @@ -272,35 +272,35 @@ def __init__( ### max_peers ```python -max_peers: : int | None = None +max_peers: int | None = None ``` Maximum amount of peers allowed into the room ### video_codec ```python -video_codec: : Optional[Literal['h264', 'vp8']] = None +video_codec: Optional[Literal['h264', 'vp8']] = None ``` Enforces video codec for each peer in the room ### webhook_url ```python -webhook_url: : str | None = None +webhook_url: str | None = None ``` URL where Fishjam notifications will be sent ### room_type ```python -room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' +room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' ``` The use-case of the room. If not provided, this defaults to conference. ### public ```python -public: : bool = False +public: bool = False ``` True if livestream viewers can omit specifying a token. @@ -315,7 +315,7 @@ Options specific to a WebRTC Peer ### __init__ ```python def __init__( - output: fishjam.api._fishjam_client.AgentOutputOptions = , + output: AgentOutputOptions = , subscribe_mode: Literal['auto', 'manual'] = 'auto' ) ``` @@ -323,13 +323,13 @@ def __init__( ### output ```python -output: : fishjam.api._fishjam_client.AgentOutputOptions +output: AgentOutputOptions ``` ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` @@ -352,14 +352,14 @@ def __init__( ### audio_format ```python -audio_format: : Literal['pcm16'] = 'pcm16' +audio_format: Literal['pcm16'] = 'pcm16' ``` ### audio_sample_rate ```python -audio_sample_rate: : Literal[16000, 24000] = 16000 +audio_sample_rate: Literal[16000, 24000] = 16000 ``` @@ -374,28 +374,28 @@ Description of the room state ### __init__ ```python def __init__( - config: fishjam._openapi_client.models.room_config.RoomConfig, + config: RoomConfig, id: str, - peers: list[fishjam._openapi_client.models.peer.Peer] + peers: list[Peer] ) ``` ### config ```python -config: : fishjam._openapi_client.models.room_config.RoomConfig +config: RoomConfig ``` Room configuration ### id ```python -id: : str +id: str ``` Room ID ### peers ```python -peers: : list[fishjam._openapi_client.models.peer.Peer] +peers: list[Peer] ``` List of all peers @@ -419,61 +419,61 @@ Attributes: ```python def __init__( id: str, - metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], - status: fishjam._openapi_client.models.peer_status.PeerStatus, - subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, - subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, - tracks: list[fishjam._openapi_client.models.track.Track], - type_: fishjam._openapi_client.models.peer_type.PeerType + metadata: Optional[PeerMetadata], + status: PeerStatus, + subscribe_mode: SubscribeMode, + subscriptions: Subscriptions, + tracks: list[Track], + type_: PeerType ) ``` Method generated by attrs for class Peer. ### id ```python -id: : str +id: str ``` ### metadata ```python -metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +metadata: Optional[PeerMetadata] ``` ### status ```python -status: : fishjam._openapi_client.models.peer_status.PeerStatus +status: PeerStatus ``` ### subscribe_mode ```python -subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +subscribe_mode: SubscribeMode ``` ### subscriptions ```python -subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +subscriptions: Subscriptions ``` ### tracks ```python -tracks: : list[fishjam._openapi_client.models.track.Track] +tracks: list[Track] ``` ### type_ ```python -type_: : fishjam._openapi_client.models.peer_type.PeerType +type_: PeerType ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -491,7 +491,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/agent.md b/versioned_docs/version-0.22.0/api/server-python/submodules/agent.md similarity index 83% rename from versioned_docs/version-0.23.0/api/server-python/fishjam/agent.md rename to versioned_docs/version-0.22.0/api/server-python/submodules/agent.md index 56cccf28..3fae055c 100644 --- a/versioned_docs/version-0.23.0/api/server-python/fishjam/agent.md +++ b/versioned_docs/version-0.22.0/api/server-python/submodules/agent.md @@ -50,7 +50,7 @@ defined with :func:`on_track_data`. --- ## AgentError ```python -class AgentError(builtins.Exception): +class AgentError(Exception): ``` Base exception class for all agent exceptions @@ -80,7 +80,7 @@ agent ```python def receive( self -) -> AsyncIterator[fishjam.events._protos.fishjam.AgentResponseTrackData] +) -> AsyncIterator[AgentResponseTrackData] ``` Returns an infinite async iterator over the incoming messages from Fishjam to the agent. @@ -123,7 +123,7 @@ reason --- ## IncomingTrackData ```python -IncomingTrackData = +IncomingTrackData = ``` @@ -148,19 +148,19 @@ def __init__( ### id ```python -id: : str +id: str ``` The global identifier of the track. ### session ```python -session: : fishjam.agent.agent.AgentSession +session: fishjam.agent.agent.AgentSession ``` The agent the track belongs to. ### options ```python -options: : fishjam.agent.agent.OutgoingAudioTrackOptions +options: fishjam.agent.agent.OutgoingAudioTrackOptions ``` The parameters used to create the track. @@ -193,7 +193,7 @@ Parameters of an outgoing audio track. ### __init__ ```python def __init__( - encoding: fishjam.events._protos.fishjam.notifications.TrackEncoding = , + encoding: TrackEncoding = , sample_rate: Literal[16000, 24000] = 16000, channels: Literal[1, 2] = 1, metadata: dict[str, typing.Any] | None = None @@ -203,7 +203,7 @@ def __init__( ### encoding ```python -encoding: : fishjam.events._protos.fishjam.notifications.TrackEncoding = +encoding: TrackEncoding = ``` The encoding of the audio source. @@ -211,7 +211,7 @@ Defaults to raw 16-bit PCM. ### sample_rate ```python -sample_rate: : Literal[16000, 24000] = 16000 +sample_rate: Literal[16000, 24000] = 16000 ``` The sample rate of the audio source. @@ -219,7 +219,7 @@ Defaults to 16000. ### channels ```python -channels: : Literal[1, 2] = 1 +channels: Literal[1, 2] = 1 ``` The number of channels in the audio source. @@ -228,7 +228,7 @@ Defaults to 1 (mono) ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Custom metadata for the track. diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/errors.md b/versioned_docs/version-0.22.0/api/server-python/submodules/errors.md similarity index 93% rename from versioned_docs/version-0.23.0/api/server-python/fishjam/errors.md rename to versioned_docs/version-0.22.0/api/server-python/submodules/errors.md index 0d719368..41f7cc57 100644 --- a/versioned_docs/version-0.23.0/api/server-python/fishjam/errors.md +++ b/versioned_docs/version-0.22.0/api/server-python/submodules/errors.md @@ -10,7 +10,7 @@ custom_edit_url: null ## HTTPError ```python -class HTTPError(builtins.Exception): +class HTTPError(Exception): ``` diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam/events.md b/versioned_docs/version-0.22.0/api/server-python/submodules/events.md similarity index 80% rename from versioned_docs/version-0.23.0/api/server-python/fishjam/events.md rename to versioned_docs/version-0.22.0/api/server-python/submodules/events.md index 052ec540..b36fd45a 100644 --- a/versioned_docs/version-0.23.0/api/server-python/fishjam/events.md +++ b/versioned_docs/version-0.22.0/api/server-python/submodules/events.md @@ -22,7 +22,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -53,7 +53,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -84,7 +84,7 @@ def __init__(room_id: str = ) ### room_id ```python -room_id: : str +room_id: str ``` @@ -112,26 +112,26 @@ Notification sent when a peer is added def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -159,26 +159,26 @@ Notification sent when a peer connects def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -206,26 +206,26 @@ Notification sent when a peer is removed def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -253,26 +253,26 @@ Notification sent when a peer disconnects from FJ def __init__( room_id: str = , peer_id: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -301,32 +301,32 @@ def __init__( room_id: str = , peer_id: str = , metadata: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### metadata ```python -metadata: : str +metadata: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -355,32 +355,32 @@ def __init__( room_id: str = , peer_id: str = , reason: str = , - peer_type: fishjam.events._protos.fishjam.ServerMessagePeerType = + peer_type: ServerMessagePeerType = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### reason ```python -reason: : str +reason: str ``` ### peer_type ```python -peer_type: : fishjam.events._protos.fishjam.ServerMessagePeerType +peer_type: ServerMessagePeerType ``` @@ -411,7 +411,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -442,7 +442,7 @@ def __init__(stream_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` @@ -471,32 +471,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -525,32 +525,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -579,32 +579,32 @@ def __init__( room_id: str = , peer_id: str = , component_id: str = , - track: fishjam.events._protos.fishjam.notifications.Track = + track: Track = ) ``` ### room_id ```python -room_id: : str +room_id: str ``` ### peer_id ```python -peer_id: : str +peer_id: str ``` ### component_id ```python -component_id: : str +component_id: str ``` ### track ```python -track: : fishjam.events._protos.fishjam.notifications.Track +track: Track ``` @@ -635,13 +635,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -672,13 +672,13 @@ def __init__(stream_id: str = , viewer_id: str = ) ### stream_id ```python -stream_id: : str +stream_id: str ``` ### viewer_id ```python -viewer_id: : str +viewer_id: str ``` @@ -705,7 +705,7 @@ Describes a media track ```python def __init__( id: str = , - type: fishjam.events._protos.fishjam.notifications.TrackType = , + type: TrackType = , metadata: str = ) ``` @@ -713,19 +713,19 @@ def __init__( ### id ```python -id: : str +id: str ``` ### type ```python -type: : fishjam.events._protos.fishjam.notifications.TrackType +type: TrackType ``` ### metadata ```python -metadata: : str +metadata: str ``` @@ -751,21 +751,21 @@ from this. Bases :class:`enum.IntEnum`. ### TRACK_ENCODING_UNSPECIFIED ```python -TRACK_ENCODING_UNSPECIFIED = +TRACK_ENCODING_UNSPECIFIED = ``` ### TRACK_ENCODING_PCM16 ```python -TRACK_ENCODING_PCM16 = +TRACK_ENCODING_PCM16 = ``` ### TRACK_ENCODING_OPUS ```python -TRACK_ENCODING_OPUS = +TRACK_ENCODING_OPUS = ``` @@ -790,21 +790,21 @@ Defines types of tracks being published by peers and component ### TRACK_TYPE_UNSPECIFIED ```python -TRACK_TYPE_UNSPECIFIED = +TRACK_TYPE_UNSPECIFIED = ``` ### TRACK_TYPE_VIDEO ```python -TRACK_TYPE_VIDEO = +TRACK_TYPE_VIDEO = ``` ### TRACK_TYPE_AUDIO ```python -TRACK_TYPE_AUDIO = +TRACK_TYPE_AUDIO = ``` @@ -830,21 +830,21 @@ from this. Bases :class:`enum.IntEnum`. ### PEER_TYPE_UNSPECIFIED ```python -PEER_TYPE_UNSPECIFIED = +PEER_TYPE_UNSPECIFIED = ``` ### PEER_TYPE_WEBRTC ```python -PEER_TYPE_WEBRTC = +PEER_TYPE_WEBRTC = ``` ### PEER_TYPE_AGENT ```python -PEER_TYPE_AGENT = +PEER_TYPE_AGENT = ``` diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam/peer.md b/versioned_docs/version-0.22.0/api/server-python/submodules/peer.md similarity index 70% rename from versioned_docs/version-0.20.0/api/server-python/fishjam/peer.md rename to versioned_docs/version-0.22.0/api/server-python/submodules/peer.md index 4a5e0fcc..c1bfb405 100644 --- a/versioned_docs/version-0.20.0/api/server-python/fishjam/peer.md +++ b/versioned_docs/version-0.22.0/api/server-python/submodules/peer.md @@ -25,7 +25,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -43,27 +43,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## PeerStatus ```python -class PeerStatus(builtins.str, enum.Enum): +class PeerStatus(str, enum.Enum): ``` Informs about the peer status ### CONNECTED ```python -CONNECTED = +CONNECTED = ``` ### DISCONNECTED ```python -DISCONNECTED = +DISCONNECTED = ``` @@ -75,20 +75,20 @@ DISCONNECTED = --- ## PeerType ```python -class PeerType(builtins.str, enum.Enum): +class PeerType(str, enum.Enum): ``` Peer type ### AGENT ```python -AGENT = +AGENT = ``` ### WEBRTC ```python -WEBRTC = +WEBRTC = ``` diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam/room.md b/versioned_docs/version-0.22.0/api/server-python/submodules/room.md similarity index 50% rename from versioned_docs/version-0.21.0/api/server-python/fishjam/room.md rename to versioned_docs/version-0.22.0/api/server-python/submodules/room.md index 53847c63..6459e895 100644 --- a/versioned_docs/version-0.21.0/api/server-python/fishjam/room.md +++ b/versioned_docs/version-0.22.0/api/server-python/submodules/room.md @@ -27,48 +27,48 @@ Attributes: ### __init__ ```python def __init__( - max_peers: Union[NoneType, fishjam._openapi_client.types.Unset, int] = , - public: Union[fishjam._openapi_client.types.Unset, bool] = False, - room_type: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] = , - video_codec: Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, fishjam._openapi_client.types.Unset, str] = + max_peers: Union[NoneType, Unset, int] = , + public: Union[Unset, bool] = False, + room_type: Union[Unset, RoomConfigRoomType] = , + video_codec: Union[Unset, RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, Unset, str] = ) ``` Method generated by attrs for class RoomConfig. ### max_peers ```python -max_peers: : Union[NoneType, fishjam._openapi_client.types.Unset, int] +max_peers: Union[NoneType, Unset, int] ``` ### public ```python -public: : Union[fishjam._openapi_client.types.Unset, bool] +public: Union[Unset, bool] ``` ### room_type ```python -room_type: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_room_type.RoomConfigRoomType] +room_type: Union[Unset, RoomConfigRoomType] ``` ### video_codec ```python -video_codec: : Union[fishjam._openapi_client.types.Unset, fishjam._openapi_client.models.room_config_video_codec.RoomConfigVideoCodec] +video_codec: Union[Unset, RoomConfigVideoCodec] ``` ### webhook_url ```python -webhook_url: : Union[NoneType, fishjam._openapi_client.types.Unset, str] +webhook_url: Union[NoneType, Unset, str] ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -86,27 +86,27 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` --- ## RoomConfigVideoCodec ```python -class RoomConfigVideoCodec(builtins.str, enum.Enum): +class RoomConfigVideoCodec(str, enum.Enum): ``` Enforces video codec for each peer in the room ### H264 ```python -H264 = +H264 = ``` ### VP8 ```python -VP8 = +VP8 = ``` @@ -118,48 +118,48 @@ VP8 = --- ## RoomConfigRoomType ```python -class RoomConfigRoomType(builtins.str, enum.Enum): +class RoomConfigRoomType(str, enum.Enum): ``` The use-case of the room. If not provided, this defaults to conference. ### AUDIO_ONLY ```python -AUDIO_ONLY = +AUDIO_ONLY = ``` ### AUDIO_ONLY_LIVESTREAM ```python -AUDIO_ONLY_LIVESTREAM = +AUDIO_ONLY_LIVESTREAM = ``` ### BROADCASTER ```python -BROADCASTER = +BROADCASTER = ``` ### CONFERENCE ```python -CONFERENCE = +CONFERENCE = ``` ### FULL_FEATURE ```python -FULL_FEATURE = +FULL_FEATURE = ``` ### LIVESTREAM ```python -LIVESTREAM = +LIVESTREAM = ``` diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam.md b/versioned_docs/version-0.23.0/api/server-python/fishjam.md index 1a6d1da2..f0c4dcd2 100644 --- a/versioned_docs/version-0.23.0/api/server-python/fishjam.md +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam.md @@ -8,15 +8,15 @@ custom_edit_url: null ## Submodules -- [events](fishjam/events) -- [errors](fishjam/errors) -- [room](fishjam/room) -- [peer](fishjam/peer) -- [agent](fishjam/agent) +- [events](submodules/events) +- [errors](submodules/errors) +- [room](submodules/room) +- [peer](submodules/peer) +- [agent](submodules/agent) ## FishjamClient ```python -class FishjamClient(fishjam.api._client.Client): +class FishjamClient(Client): ``` Allows for managing rooms @@ -31,8 +31,8 @@ Create a FishjamClient instance, providing the fishjam id and management token. def create_peer( self, room_id: str, - options: fishjam.api._fishjam_client.PeerOptions | None = None -) -> tuple[fishjam._openapi_client.models.peer.Peer, str] + options: PeerOptions | None = None +) -> tuple[Peer, str] ``` Creates peer in the room @@ -46,7 +46,7 @@ The possible options to pass for peer are `PeerOptions`. def create_agent( self, room_id: str, - options: fishjam.api._fishjam_client.AgentOptions | None = None + options: AgentOptions | None = None ) ``` @@ -55,21 +55,21 @@ def create_agent( ```python def create_room( self, - options: fishjam.api._fishjam_client.RoomOptions | None = None -) -> fishjam.api._fishjam_client.Room + options: RoomOptions | None = None +) -> Room ``` Creates a new room Returns the created `Room` ### get_all_rooms ```python -def get_all_rooms(self) -> list[fishjam.api._fishjam_client.Room] +def get_all_rooms(self) -> list[Room] ``` Returns list of all rooms ### get_room ```python -def get_room(self, room_id: str) -> fishjam.api._fishjam_client.Room +def get_room(self, room_id: str) -> Room ``` Returns room with the given id @@ -135,7 +135,7 @@ Create FishjamNotifier instance, providing the fishjam id and management token. ```python def on_server_notification( self, - handler: Union[Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] + handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] ) ``` Decorator used for defining handler for Fishjam Notifications @@ -168,7 +168,7 @@ If already connected, returns immediately. ```python def receive_binary( binary: bytes -) -> Union[fishjam.events._protos.fishjam.ServerMessageRoomCreated, fishjam.events._protos.fishjam.ServerMessageRoomDeleted, fishjam.events._protos.fishjam.ServerMessageRoomCrashed, fishjam.events._protos.fishjam.ServerMessagePeerAdded, fishjam.events._protos.fishjam.ServerMessagePeerDeleted, fishjam.events._protos.fishjam.ServerMessagePeerConnected, fishjam.events._protos.fishjam.ServerMessagePeerDisconnected, fishjam.events._protos.fishjam.ServerMessagePeerMetadataUpdated, fishjam.events._protos.fishjam.ServerMessagePeerCrashed, fishjam.events._protos.fishjam.ServerMessageStreamConnected, fishjam.events._protos.fishjam.ServerMessageStreamDisconnected, fishjam.events._protos.fishjam.ServerMessageViewerConnected, fishjam.events._protos.fishjam.ServerMessageViewerDisconnected, fishjam.events._protos.fishjam.ServerMessageTrackAdded, fishjam.events._protos.fishjam.ServerMessageTrackRemoved, fishjam.events._protos.fishjam.ServerMessageTrackMetadataUpdated, NoneType] +) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] ``` Transform received protobuf notification to adequate notification instance. The available notifications are listed in `fishjam.events` module. @@ -191,7 +191,7 @@ Method generated by attrs for class PeerMetadata. ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -209,7 +209,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` @@ -232,21 +232,21 @@ def __init__( ### enable_simulcast ```python -enable_simulcast: : bool = True +enable_simulcast: bool = True ``` Enables the peer to use simulcast ### metadata ```python -metadata: : dict[str, typing.Any] | None = None +metadata: dict[str, typing.Any] | None = None ``` Peer metadata ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` Configuration of peer's subscribing policy @@ -272,35 +272,35 @@ def __init__( ### max_peers ```python -max_peers: : int | None = None +max_peers: int | None = None ``` Maximum amount of peers allowed into the room ### video_codec ```python -video_codec: : Optional[Literal['h264', 'vp8']] = None +video_codec: Optional[Literal['h264', 'vp8']] = None ``` Enforces video codec for each peer in the room ### webhook_url ```python -webhook_url: : str | None = None +webhook_url: str | None = None ``` URL where Fishjam notifications will be sent ### room_type ```python -room_type: : Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' +room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' ``` The use-case of the room. If not provided, this defaults to conference. ### public ```python -public: : bool = False +public: bool = False ``` True if livestream viewers can omit specifying a token. @@ -315,7 +315,7 @@ Options specific to a WebRTC Peer ### __init__ ```python def __init__( - output: fishjam.api._fishjam_client.AgentOutputOptions = , + output: AgentOutputOptions = , subscribe_mode: Literal['auto', 'manual'] = 'auto' ) ``` @@ -323,13 +323,13 @@ def __init__( ### output ```python -output: : fishjam.api._fishjam_client.AgentOutputOptions +output: AgentOutputOptions ``` ### subscribe_mode ```python -subscribe_mode: : Literal['auto', 'manual'] = 'auto' +subscribe_mode: Literal['auto', 'manual'] = 'auto' ``` @@ -352,14 +352,14 @@ def __init__( ### audio_format ```python -audio_format: : Literal['pcm16'] = 'pcm16' +audio_format: Literal['pcm16'] = 'pcm16' ``` ### audio_sample_rate ```python -audio_sample_rate: : Literal[16000, 24000] = 16000 +audio_sample_rate: Literal[16000, 24000] = 16000 ``` @@ -374,28 +374,28 @@ Description of the room state ### __init__ ```python def __init__( - config: fishjam._openapi_client.models.room_config.RoomConfig, + config: RoomConfig, id: str, - peers: list[fishjam._openapi_client.models.peer.Peer] + peers: list[Peer] ) ``` ### config ```python -config: : fishjam._openapi_client.models.room_config.RoomConfig +config: RoomConfig ``` Room configuration ### id ```python -id: : str +id: str ``` Room ID ### peers ```python -peers: : list[fishjam._openapi_client.models.peer.Peer] +peers: list[Peer] ``` List of all peers @@ -419,61 +419,61 @@ Attributes: ```python def __init__( id: str, - metadata: Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata], - status: fishjam._openapi_client.models.peer_status.PeerStatus, - subscribe_mode: fishjam._openapi_client.models.subscribe_mode.SubscribeMode, - subscriptions: fishjam._openapi_client.models.subscriptions.Subscriptions, - tracks: list[fishjam._openapi_client.models.track.Track], - type_: fishjam._openapi_client.models.peer_type.PeerType + metadata: Optional[PeerMetadata], + status: PeerStatus, + subscribe_mode: SubscribeMode, + subscriptions: Subscriptions, + tracks: list[Track], + type_: PeerType ) ``` Method generated by attrs for class Peer. ### id ```python -id: : str +id: str ``` ### metadata ```python -metadata: : Optional[fishjam._openapi_client.models.peer_metadata.PeerMetadata] +metadata: Optional[PeerMetadata] ``` ### status ```python -status: : fishjam._openapi_client.models.peer_status.PeerStatus +status: PeerStatus ``` ### subscribe_mode ```python -subscribe_mode: : fishjam._openapi_client.models.subscribe_mode.SubscribeMode +subscribe_mode: SubscribeMode ``` ### subscriptions ```python -subscriptions: : fishjam._openapi_client.models.subscriptions.Subscriptions +subscriptions: Subscriptions ``` ### tracks ```python -tracks: : list[fishjam._openapi_client.models.track.Track] +tracks: list[Track] ``` ### type_ ```python -type_: : fishjam._openapi_client.models.peer_type.PeerType +type_: PeerType ``` ### additional_properties ```python -additional_properties: : dict[str, typing.Any] +additional_properties: dict[str, typing.Any] ``` @@ -491,7 +491,7 @@ def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T ### additional_keys ```python -additional_keys: : list[str] +additional_keys: list[str] ``` diff --git a/versioned_docs/version-0.23.0/api/server-python/submodules/agent.md b/versioned_docs/version-0.23.0/api/server-python/submodules/agent.md new file mode 100644 index 00000000..3fae055c --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/submodules/agent.md @@ -0,0 +1,237 @@ +--- +title: agent +sidebar_label: agent +custom_edit_url: null +--- + +# agent + + + +## Agent +```python +class Agent: +``` +Allows for connecting to a Fishjam room as an agent peer. +Provides callbacks for receiving audio. + +### __init__ +```python +def __init__(id: str, room_id: str, token: str, fishjam_url: str) +``` +Create Agent instance, providing the fishjam id and management token. + +This constructor should not be called directly. +Instead, you should call :func:`fishjam.FishjamClient.create_agent`. + +### id +```python +id +``` + + +### room_id +```python +room_id +``` + + +### connect +```python +def connect(self) +``` +Connect the agent to Fishjam to start receiving messages. + +Incoming messages from Fishjam will be routed to handlers +defined with :func:`on_track_data`. + +:raises AgentAuthError: authentication failed + +--- +## AgentError +```python +class AgentError(Exception): +``` +Base exception class for all agent exceptions + +--- +## AgentSession +```python +class AgentSession: +``` + + +### __init__ +```python +def __init__( + agent: fishjam.agent.agent.Agent, + websocket: websockets.asyncio.client.ClientConnection +) +``` + + +### agent +```python +agent +``` + + +### receive +```python +def receive( + self +) -> AsyncIterator[AgentResponseTrackData] +``` +Returns an infinite async iterator over the incoming messages from Fishjam to +the agent. + +### add_track +```python +def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) +``` +Adds a track to the connected agent, with the specified options and metadata. + +Returns an instance of :class:`OutgoingTrack`, which can be used to send data +over the added track. + +### disconnect +```python +def disconnect(self) +``` +Ends the agent session by closing the websocket connection. +Useful when you don't use the context manager to obtain the session. + +--- +## AgentAuthError +```python +class AgentAuthError(fishjam.agent.errors.AgentError): +``` +Agent failed to authenticate properly + +### __init__ +```python +def __init__(reason: str) +``` + + +### reason +```python +reason +``` + + +--- +## IncomingTrackData +```python +IncomingTrackData = + +``` + + +--- +## OutgoingTrack +```python +class OutgoingTrack: +``` +Represents an outgoing track of an agent connected to Fishjam, +created by :func:`Agent.add_track`. + +### __init__ +```python +def __init__( + id: str, + session: fishjam.agent.agent.AgentSession, + options: fishjam.agent.agent.OutgoingAudioTrackOptions +) +``` + + +### id +```python +id: str +``` +The global identifier of the track. + +### session +```python +session: fishjam.agent.agent.AgentSession +``` +The agent the track belongs to. + +### options +```python +options: fishjam.agent.agent.OutgoingAudioTrackOptions +``` +The parameters used to create the track. + +### send_chunk +```python +def send_chunk(self, data: bytes) +``` +Send a chunk of audio to Fishjam on this track. + +Peers connected to the room of the agent will receive this data. + +### interrupt +```python +def interrupt(self) +``` +Interrupt current track. + +Any audio that has been sent, but not played +will be cleared and be prevented from playing. + +Audio sent after the interrupt will be played normally. + +--- +## OutgoingAudioTrackOptions +```python +class OutgoingAudioTrackOptions: +``` +Parameters of an outgoing audio track. + +### __init__ +```python +def __init__( + encoding: TrackEncoding = , + sample_rate: Literal[16000, 24000] = 16000, + channels: Literal[1, 2] = 1, + metadata: dict[str, typing.Any] | None = None +) +``` + + +### encoding +```python +encoding: TrackEncoding = + +``` +The encoding of the audio source. +Defaults to raw 16-bit PCM. + +### sample_rate +```python +sample_rate: Literal[16000, 24000] = 16000 + +``` +The sample rate of the audio source. +Defaults to 16000. + +### channels +```python +channels: Literal[1, 2] = 1 + +``` +The number of channels in the audio source. +Supported values are 1 (mono) and 2 (stereo). +Defaults to 1 (mono) + +### metadata +```python +metadata: dict[str, typing.Any] | None = None + +``` +Custom metadata for the track. +Must be JSON-encodable. + +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/submodules/errors.md b/versioned_docs/version-0.23.0/api/server-python/submodules/errors.md new file mode 100644 index 00000000..41f7cc57 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/submodules/errors.md @@ -0,0 +1,59 @@ +--- +title: errors +sidebar_label: errors +custom_edit_url: null +--- + +# errors + + + +## HTTPError +```python +class HTTPError(Exception): +``` + + +--- +## BadRequestError +```python +class BadRequestError(HTTPError): +``` + + +--- +## UnauthorizedError +```python +class UnauthorizedError(HTTPError): +``` + + +--- +## NotFoundError +```python +class NotFoundError(HTTPError): +``` + + +--- +## ServiceUnavailableError +```python +class ServiceUnavailableError(HTTPError): +``` + + +--- +## InternalServerError +```python +class InternalServerError(HTTPError): +``` + + +--- +## ConflictError +```python +class ConflictError(HTTPError): +``` + + +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/submodules/events.md b/versioned_docs/version-0.23.0/api/server-python/submodules/events.md new file mode 100644 index 00000000..b36fd45a --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/submodules/events.md @@ -0,0 +1,863 @@ +--- +title: events +sidebar_label: events +custom_edit_url: null +--- + +# events + + + +## ServerMessageRoomCreated +```python +class ServerMessageRoomCreated(betterproto.Message): +``` +Notification sent when a room is created + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomDeleted +```python +class ServerMessageRoomDeleted(betterproto.Message): +``` +Notification sent when a room is deleted + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageRoomCrashed +```python +class ServerMessageRoomCrashed(betterproto.Message): +``` +Notification sent when a room crashes + +### __init__ +```python +def __init__(room_id: str = ) +``` + + +### room_id +```python +room_id: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerAdded +```python +class ServerMessagePeerAdded(betterproto.Message): +``` +Notification sent when a peer is added + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### peer_type +```python +peer_type: ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerConnected +```python +class ServerMessagePeerConnected(betterproto.Message): +``` +Notification sent when a peer connects + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### peer_type +```python +peer_type: ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDeleted +```python +class ServerMessagePeerDeleted(betterproto.Message): +``` +Notification sent when a peer is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### peer_type +```python +peer_type: ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerDisconnected +```python +class ServerMessagePeerDisconnected(betterproto.Message): +``` +Notification sent when a peer disconnects from FJ + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + peer_type: ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### peer_type +```python +peer_type: ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerMetadataUpdated +```python +class ServerMessagePeerMetadataUpdated(betterproto.Message): +``` +Notification sent when peer updates its metadata + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + metadata: str = , + peer_type: ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### metadata +```python +metadata: str +``` + + +### peer_type +```python +peer_type: ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessagePeerCrashed +```python +class ServerMessagePeerCrashed(betterproto.Message): +``` +Notification sent when a peer crashes + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + reason: str = , + peer_type: ServerMessagePeerType = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### reason +```python +reason: str +``` + + +### peer_type +```python +peer_type: ServerMessagePeerType +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamConnected +```python +class ServerMessageStreamConnected(betterproto.Message): +``` +Notification sent when streamer successfully connects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageStreamDisconnected +```python +class ServerMessageStreamDisconnected(betterproto.Message): +``` +Notification sent when streamer disconnects + +### __init__ +```python +def __init__(stream_id: str = ) +``` + + +### stream_id +```python +stream_id: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackAdded +```python +class ServerMessageTrackAdded(betterproto.Message): +``` +Notification sent when peer or component adds new track + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: Track = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### component_id +```python +component_id: str +``` + + +### track +```python +track: Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackMetadataUpdated +```python +class ServerMessageTrackMetadataUpdated(betterproto.Message): +``` +Notification sent when metadata of a multimedia track is updated + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: Track = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### component_id +```python +component_id: str +``` + + +### track +```python +track: Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageTrackRemoved +```python +class ServerMessageTrackRemoved(betterproto.Message): +``` +Notification sent when a track is removed + +### __init__ +```python +def __init__( + room_id: str = , + peer_id: str = , + component_id: str = , + track: Track = +) +``` + + +### room_id +```python +room_id: str +``` + + +### peer_id +```python +peer_id: str +``` + + +### component_id +```python +component_id: str +``` + + +### track +```python +track: Track +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerConnected +```python +class ServerMessageViewerConnected(betterproto.Message): +``` +Notification sent when viewer successfully connects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: str +``` + + +### viewer_id +```python +viewer_id: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## ServerMessageViewerDisconnected +```python +class ServerMessageViewerDisconnected(betterproto.Message): +``` +Notification sent when viewer disconnects + +### __init__ +```python +def __init__(stream_id: str = , viewer_id: str = ) +``` + + +### stream_id +```python +stream_id: str +``` + + +### viewer_id +```python +viewer_id: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## Track +```python +class Track(betterproto.Message): +``` +Describes a media track + +### __init__ +```python +def __init__( + id: str = , + type: TrackType = , + metadata: str = +) +``` + + +### id +```python +id: str +``` + + +### type +```python +type: TrackType +``` + + +### metadata +```python +metadata: str +``` + + +#### Inherited Members +* **Message**: + * `SerializeToString` + * `parse` + * `FromString` + * `to_dict` + * `from_dict` + * `to_json` + * `from_json` + * `to_pydict` + * `from_pydict` + * `is_set` +--- +## TrackEncoding +```python +class TrackEncoding(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### TRACK_ENCODING_UNSPECIFIED +```python +TRACK_ENCODING_UNSPECIFIED = + +``` + + +### TRACK_ENCODING_PCM16 +```python +TRACK_ENCODING_PCM16 = + +``` + + +### TRACK_ENCODING_OPUS +```python +TRACK_ENCODING_OPUS = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## TrackType +```python +class TrackType(betterproto.Enum): +``` +Defines types of tracks being published by peers and component + +### TRACK_TYPE_UNSPECIFIED +```python +TRACK_TYPE_UNSPECIFIED = + +``` + + +### TRACK_TYPE_VIDEO +```python +TRACK_TYPE_VIDEO = + +``` + + +### TRACK_TYPE_AUDIO +```python +TRACK_TYPE_AUDIO = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- +## ServerMessagePeerType +```python +class ServerMessagePeerType(betterproto.Enum): +``` +The base class for protobuf enumerations, all generated enumerations will inherit +from this. Bases :class:`enum.IntEnum`. + +### PEER_TYPE_UNSPECIFIED +```python +PEER_TYPE_UNSPECIFIED = + +``` + + +### PEER_TYPE_WEBRTC +```python +PEER_TYPE_WEBRTC = + +``` + + +### PEER_TYPE_AGENT +```python +PEER_TYPE_AGENT = + +``` + + +#### Inherited Members +* **Enum**: + * `from_string` + + + + + +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/submodules/peer.md b/versioned_docs/version-0.23.0/api/server-python/submodules/peer.md new file mode 100644 index 00000000..c1bfb405 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/submodules/peer.md @@ -0,0 +1,100 @@ +--- +title: peer +sidebar_label: peer +custom_edit_url: null +--- + +# peer + + + +## PeerMetadata +```python +class PeerMetadata: +``` +Custom metadata set by the peer + +Example: + \{'name': 'FishjamUser'\} + +### __init__ +```python +def __init__() +``` +Method generated by attrs for class PeerMetadata. + +### additional_properties +```python +additional_properties: dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: list[str] +``` + + +--- +## PeerStatus +```python +class PeerStatus(str, enum.Enum): +``` +Informs about the peer status + +### CONNECTED +```python +CONNECTED = + +``` + + +### DISCONNECTED +```python +DISCONNECTED = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## PeerType +```python +class PeerType(str, enum.Enum): +``` +Peer type + +### AGENT +```python +AGENT = + +``` + + +### WEBRTC +```python +WEBRTC = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- diff --git a/versioned_docs/version-0.23.0/api/server-python/submodules/room.md b/versioned_docs/version-0.23.0/api/server-python/submodules/room.md new file mode 100644 index 00000000..6459e895 --- /dev/null +++ b/versioned_docs/version-0.23.0/api/server-python/submodules/room.md @@ -0,0 +1,171 @@ +--- +title: room +sidebar_label: room +custom_edit_url: null +--- + +# room + + + +## RoomConfig +```python +class RoomConfig: +``` +Room configuration + +Attributes: + max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. + public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. + room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to + conference. Default: RoomConfigRoomType.CONFERENCE. + video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: + RoomConfigVideoCodec.H264. + webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: + https://backend.address.com/fishjam-notifications-endpoint. + +### __init__ +```python +def __init__( + max_peers: Union[NoneType, Unset, int] = , + public: Union[Unset, bool] = False, + room_type: Union[Unset, RoomConfigRoomType] = , + video_codec: Union[Unset, RoomConfigVideoCodec] = , + webhook_url: Union[NoneType, Unset, str] = +) +``` +Method generated by attrs for class RoomConfig. + +### max_peers +```python +max_peers: Union[NoneType, Unset, int] +``` + + +### public +```python +public: Union[Unset, bool] +``` + + +### room_type +```python +room_type: Union[Unset, RoomConfigRoomType] +``` + + +### video_codec +```python +video_codec: Union[Unset, RoomConfigVideoCodec] +``` + + +### webhook_url +```python +webhook_url: Union[NoneType, Unset, str] +``` + + +### additional_properties +```python +additional_properties: dict[str, typing.Any] +``` + + +### to_dict +```python +def to_dict(self) -> dict[str, typing.Any] +``` + + +### from_dict +```python +def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T +``` + + +### additional_keys +```python +additional_keys: list[str] +``` + + +--- +## RoomConfigVideoCodec +```python +class RoomConfigVideoCodec(str, enum.Enum): +``` +Enforces video codec for each peer in the room + +### H264 +```python +H264 = + +``` + + +### VP8 +```python +VP8 = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- +## RoomConfigRoomType +```python +class RoomConfigRoomType(str, enum.Enum): +``` +The use-case of the room. If not provided, this defaults to conference. + +### AUDIO_ONLY +```python +AUDIO_ONLY = + +``` + + +### AUDIO_ONLY_LIVESTREAM +```python +AUDIO_ONLY_LIVESTREAM = + +``` + + +### BROADCASTER +```python +BROADCASTER = + +``` + + +### CONFERENCE +```python +CONFERENCE = + +``` + + +### FULL_FEATURE +```python +FULL_FEATURE = + +``` + + +### LIVESTREAM +```python +LIVESTREAM = + +``` + + +#### Inherited Members +* **Enum**: + * `name` + * `value` +--- From 180fd6df97526a02c5d4ace383ad2d1425613ad5 Mon Sep 17 00:00:00 2001 From: p1003 Date: Fri, 5 Dec 2025 15:24:54 +0100 Subject: [PATCH 4/4] python server sdk docs --- .github/workflows/docs.yaml | 2 + .github/workflows/static_check.yml | 2 + .gitignore | 3 +- .prettierignore | 1 + README.md | 6 + docs/api/server-python/fishjam.md | 498 ---------- docs/api/server-python/submodules/agent.md | 237 ----- docs/api/server-python/submodules/errors.md | 59 -- docs/api/server-python/submodules/events.md | 863 ------------------ docs/api/server-python/submodules/peer.md | 100 -- docs/api/server-python/submodules/room.md | 171 ---- docusaurus.config.ts | 98 +- packages/python-server-sdk | 2 +- scripts/generate_python_docs.sh | 21 +- .../api/server-python/fishjam.md | 498 ---------- .../api/server-python/submodules/agent.md | 237 ----- .../api/server-python/submodules/errors.md | 59 -- .../api/server-python/submodules/events.md | 863 ------------------ .../api/server-python/submodules/peer.md | 100 -- .../api/server-python/submodules/room.md | 171 ---- .../api/server-python/fishjam.md | 498 ---------- .../api/server-python/submodules/agent.md | 237 ----- .../api/server-python/submodules/errors.md | 59 -- .../api/server-python/submodules/events.md | 863 ------------------ .../api/server-python/submodules/peer.md | 100 -- .../api/server-python/submodules/room.md | 171 ---- .../api/server-python/fishjam.md | 498 ---------- .../api/server-python/submodules/agent.md | 237 ----- .../api/server-python/submodules/errors.md | 59 -- .../api/server-python/submodules/events.md | 863 ------------------ .../api/server-python/submodules/peer.md | 100 -- .../api/server-python/submodules/room.md | 171 ---- .../api/server-python/fishjam.md | 16 +- .../api/server-python/submodules/peer.md | 2 +- .../api/server-python/submodules/room.md | 16 +- 35 files changed, 95 insertions(+), 7786 deletions(-) delete mode 100644 docs/api/server-python/fishjam.md delete mode 100644 docs/api/server-python/submodules/agent.md delete mode 100644 docs/api/server-python/submodules/errors.md delete mode 100644 docs/api/server-python/submodules/events.md delete mode 100644 docs/api/server-python/submodules/peer.md delete mode 100644 docs/api/server-python/submodules/room.md delete mode 100644 versioned_docs/version-0.20.0/api/server-python/fishjam.md delete mode 100644 versioned_docs/version-0.20.0/api/server-python/submodules/agent.md delete mode 100644 versioned_docs/version-0.20.0/api/server-python/submodules/errors.md delete mode 100644 versioned_docs/version-0.20.0/api/server-python/submodules/events.md delete mode 100644 versioned_docs/version-0.20.0/api/server-python/submodules/peer.md delete mode 100644 versioned_docs/version-0.20.0/api/server-python/submodules/room.md delete mode 100644 versioned_docs/version-0.21.0/api/server-python/fishjam.md delete mode 100644 versioned_docs/version-0.21.0/api/server-python/submodules/agent.md delete mode 100644 versioned_docs/version-0.21.0/api/server-python/submodules/errors.md delete mode 100644 versioned_docs/version-0.21.0/api/server-python/submodules/events.md delete mode 100644 versioned_docs/version-0.21.0/api/server-python/submodules/peer.md delete mode 100644 versioned_docs/version-0.21.0/api/server-python/submodules/room.md delete mode 100644 versioned_docs/version-0.22.0/api/server-python/fishjam.md delete mode 100644 versioned_docs/version-0.22.0/api/server-python/submodules/agent.md delete mode 100644 versioned_docs/version-0.22.0/api/server-python/submodules/errors.md delete mode 100644 versioned_docs/version-0.22.0/api/server-python/submodules/events.md delete mode 100644 versioned_docs/version-0.22.0/api/server-python/submodules/peer.md delete mode 100644 versioned_docs/version-0.22.0/api/server-python/submodules/room.md diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 997cb029..79c76808 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -40,6 +40,8 @@ jobs: node-version: "lts/*" - name: Use corepack run: corepack enable + - name: Install uv + uses: astral-sh/setup-uv@v6 - name: Install dependencies run: yarn install --immutable - name: Fetch SDK packages diff --git a/.github/workflows/static_check.yml b/.github/workflows/static_check.yml index 4615ce91..6dc23ac0 100644 --- a/.github/workflows/static_check.yml +++ b/.github/workflows/static_check.yml @@ -18,6 +18,8 @@ jobs: node-version: "lts/*" - name: Use corepack run: corepack enable + - name: Install uv + uses: astral-sh/setup-uv@v6 - name: Run prepare run: scripts/prepare.sh - name: Install node dependencies diff --git a/.gitignore b/.gitignore index 25cb6574..e867858d 100644 --- a/.gitignore +++ b/.gitignore @@ -137,7 +137,6 @@ build docs/api/mobile/** docs/api/web/** docs/api/server/** -# TODO: remove this after https://github.com/fishjam-cloud/python-server-sdk/pull/51 is merged -# docs/api/server-python/** +docs/api/server-python/** .cursor/ diff --git a/.prettierignore b/.prettierignore index a7e1c764..ccdcb540 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,4 @@ node_modules/* packages/* api/** versioned_docs/*/api/** +docs/api/server-python/* diff --git a/README.md b/README.md index 934fa5bf..494b80fd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ The Documentation explains how Fishjam works and how it can be integrated in you ### Local Development +#### Python + +`python-server-sdk` requires [uv](https://docs.astral.sh/uv/). Make sure to have it installed first. + +#### yarn + Get all dependencies ``` diff --git a/docs/api/server-python/fishjam.md b/docs/api/server-python/fishjam.md deleted file mode 100644 index f0c4dcd2..00000000 --- a/docs/api/server-python/fishjam.md +++ /dev/null @@ -1,498 +0,0 @@ ---- -title: fishjam -sidebar_label: fishjam -custom_edit_url: null ---- - -# fishjam - - -## Submodules -- [events](submodules/events) -- [errors](submodules/errors) -- [room](submodules/room) -- [peer](submodules/peer) -- [agent](submodules/agent) - -## FishjamClient -```python -class FishjamClient(Client): -``` -Allows for managing rooms - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create a FishjamClient instance, providing the fishjam id and management token. - -### create_peer -```python -def create_peer( - self, - room_id: str, - options: PeerOptions | None = None -) -> tuple[Peer, str] -``` -Creates peer in the room - -Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer -to authenticate to Fishjam. - -The possible options to pass for peer are `PeerOptions`. - -### create_agent -```python -def create_agent( - self, - room_id: str, - options: AgentOptions | None = None -) -``` - - -### create_room -```python -def create_room( - self, - options: RoomOptions | None = None -) -> Room -``` -Creates a new room -Returns the created `Room` - -### get_all_rooms -```python -def get_all_rooms(self) -> list[Room] -``` -Returns list of all rooms - -### get_room -```python -def get_room(self, room_id: str) -> Room -``` -Returns room with the given id - -### delete_peer -```python -def delete_peer(self, room_id: str, peer_id: str) -> None -``` -Deletes peer - -### delete_room -```python -def delete_room(self, room_id: str) -> None -``` -Deletes a room - -### refresh_peer_token -```python -def refresh_peer_token(self, room_id: str, peer_id: str) -> str -``` -Refreshes peer token - -### create_livestream_viewer_token -```python -def create_livestream_viewer_token(self, room_id: str) -> str -``` -Generates viewer token for livestream rooms - -### create_livestream_streamer_token -```python -def create_livestream_streamer_token(self, room_id: str) -> str -``` -Generates streamer token for livestream rooms - -### subscribe_peer -```python -def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) -``` -Subscribe a peer to all tracks of another peer. - -### subscribe_tracks -```python -def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) -``` -Subscribe a peer to specific tracks of another peer. - -#### Inherited Members -* **Client**: - * `client` ---- -## FishjamNotifier -```python -class FishjamNotifier: -``` -Allows for receiving WebSocket messages from Fishjam. - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create FishjamNotifier instance, providing the fishjam id and management token. - -### on_server_notification -```python -def on_server_notification( - self, - handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] -) -``` -Decorator used for defining handler for Fishjam Notifications - -### connect -```python -def connect(self) -``` -A coroutine which connects FishjamNotifier to Fishjam and listens for -all incoming messages from the Fishjam. - -It runs until the connection isn't closed. - -The incoming messages are handled by the functions defined using the -`on_server_notification` decorator. - -The handler have to be defined before calling `connect`, -otherwise the messages won't be received. - -### wait_ready -```python -def wait_ready(self) -> None -``` -Waits until the notifier is connected and authenticated to Fishjam. - -If already connected, returns immediately. - ---- -## receive_binary -```python -def receive_binary( - binary: bytes -) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] -``` -Transform received protobuf notification to adequate notification instance. -The available notifications are listed in `fishjam.events` module. - ---- -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerOptions -```python -class PeerOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - enable_simulcast: bool = True, - metadata: dict[str, typing.Any] | None = None, - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### enable_simulcast -```python -enable_simulcast: bool = True - -``` -Enables the peer to use simulcast - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Peer metadata - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` -Configuration of peer's subscribing policy - ---- -## RoomOptions -```python -class RoomOptions: -``` -Description of a room options - -### __init__ -```python -def __init__( - max_peers: int | None = None, - video_codec: Optional[Literal['h264', 'vp8']] = None, - webhook_url: str | None = None, - room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', - public: bool = False -) -``` - - -### max_peers -```python -max_peers: int | None = None - -``` -Maximum amount of peers allowed into the room - -### video_codec -```python -video_codec: Optional[Literal['h264', 'vp8']] = None - -``` -Enforces video codec for each peer in the room - -### webhook_url -```python -webhook_url: str | None = None - -``` -URL where Fishjam notifications will be sent - -### room_type -```python -room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' - -``` -The use-case of the room. If not provided, this defaults to conference. - -### public -```python -public: bool = False - -``` -True if livestream viewers can omit specifying a token. - ---- -## AgentOptions -```python -class AgentOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - output: AgentOutputOptions = , - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### output -```python -output: AgentOutputOptions -``` - - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` - - ---- -## AgentOutputOptions -```python -class AgentOutputOptions: -``` -Options of the desired format of audio tracks going from Fishjam to the agent. - -### __init__ -```python -def __init__( - audio_format: Literal['pcm16'] = 'pcm16', - audio_sample_rate: Literal[16000, 24000] = 16000 -) -``` - - -### audio_format -```python -audio_format: Literal['pcm16'] = 'pcm16' - -``` - - -### audio_sample_rate -```python -audio_sample_rate: Literal[16000, 24000] = 16000 - -``` - - ---- -## Room -```python -class Room: -``` -Description of the room state - -### __init__ -```python -def __init__( - config: RoomConfig, - id: str, - peers: list[Peer] -) -``` - - -### config -```python -config: RoomConfig -``` -Room configuration - -### id -```python -id: str -``` -Room ID - -### peers -```python -peers: list[Peer] -``` -List of all peers - ---- -## Peer -```python -class Peer: -``` -Describes peer status - -Attributes: - id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. - metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. - status (PeerStatus): Informs about the peer status Example: disconnected. - subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy - subscriptions (Subscriptions): Describes peer's subscriptions in manual mode - tracks (list['Track']): List of all peer's tracks - type_ (PeerType): Peer type Example: webrtc. - -### __init__ -```python -def __init__( - id: str, - metadata: Optional[PeerMetadata], - status: PeerStatus, - subscribe_mode: SubscribeMode, - subscriptions: Subscriptions, - tracks: list[Track], - type_: PeerType -) -``` -Method generated by attrs for class Peer. - -### id -```python -id: str -``` - - -### metadata -```python -metadata: Optional[PeerMetadata] -``` - - -### status -```python -status: PeerStatus -``` - - -### subscribe_mode -```python -subscribe_mode: SubscribeMode -``` - - -### subscriptions -```python -subscriptions: Subscriptions -``` - - -### tracks -```python -tracks: list[Track] -``` - - -### type_ -```python -type_: PeerType -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- diff --git a/docs/api/server-python/submodules/agent.md b/docs/api/server-python/submodules/agent.md deleted file mode 100644 index 3fae055c..00000000 --- a/docs/api/server-python/submodules/agent.md +++ /dev/null @@ -1,237 +0,0 @@ ---- -title: agent -sidebar_label: agent -custom_edit_url: null ---- - -# agent - - - -## Agent -```python -class Agent: -``` -Allows for connecting to a Fishjam room as an agent peer. -Provides callbacks for receiving audio. - -### __init__ -```python -def __init__(id: str, room_id: str, token: str, fishjam_url: str) -``` -Create Agent instance, providing the fishjam id and management token. - -This constructor should not be called directly. -Instead, you should call :func:`fishjam.FishjamClient.create_agent`. - -### id -```python -id -``` - - -### room_id -```python -room_id -``` - - -### connect -```python -def connect(self) -``` -Connect the agent to Fishjam to start receiving messages. - -Incoming messages from Fishjam will be routed to handlers -defined with :func:`on_track_data`. - -:raises AgentAuthError: authentication failed - ---- -## AgentError -```python -class AgentError(Exception): -``` -Base exception class for all agent exceptions - ---- -## AgentSession -```python -class AgentSession: -``` - - -### __init__ -```python -def __init__( - agent: fishjam.agent.agent.Agent, - websocket: websockets.asyncio.client.ClientConnection -) -``` - - -### agent -```python -agent -``` - - -### receive -```python -def receive( - self -) -> AsyncIterator[AgentResponseTrackData] -``` -Returns an infinite async iterator over the incoming messages from Fishjam to -the agent. - -### add_track -```python -def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) -``` -Adds a track to the connected agent, with the specified options and metadata. - -Returns an instance of :class:`OutgoingTrack`, which can be used to send data -over the added track. - -### disconnect -```python -def disconnect(self) -``` -Ends the agent session by closing the websocket connection. -Useful when you don't use the context manager to obtain the session. - ---- -## AgentAuthError -```python -class AgentAuthError(fishjam.agent.errors.AgentError): -``` -Agent failed to authenticate properly - -### __init__ -```python -def __init__(reason: str) -``` - - -### reason -```python -reason -``` - - ---- -## IncomingTrackData -```python -IncomingTrackData = - -``` - - ---- -## OutgoingTrack -```python -class OutgoingTrack: -``` -Represents an outgoing track of an agent connected to Fishjam, -created by :func:`Agent.add_track`. - -### __init__ -```python -def __init__( - id: str, - session: fishjam.agent.agent.AgentSession, - options: fishjam.agent.agent.OutgoingAudioTrackOptions -) -``` - - -### id -```python -id: str -``` -The global identifier of the track. - -### session -```python -session: fishjam.agent.agent.AgentSession -``` -The agent the track belongs to. - -### options -```python -options: fishjam.agent.agent.OutgoingAudioTrackOptions -``` -The parameters used to create the track. - -### send_chunk -```python -def send_chunk(self, data: bytes) -``` -Send a chunk of audio to Fishjam on this track. - -Peers connected to the room of the agent will receive this data. - -### interrupt -```python -def interrupt(self) -``` -Interrupt current track. - -Any audio that has been sent, but not played -will be cleared and be prevented from playing. - -Audio sent after the interrupt will be played normally. - ---- -## OutgoingAudioTrackOptions -```python -class OutgoingAudioTrackOptions: -``` -Parameters of an outgoing audio track. - -### __init__ -```python -def __init__( - encoding: TrackEncoding = , - sample_rate: Literal[16000, 24000] = 16000, - channels: Literal[1, 2] = 1, - metadata: dict[str, typing.Any] | None = None -) -``` - - -### encoding -```python -encoding: TrackEncoding = - -``` -The encoding of the audio source. -Defaults to raw 16-bit PCM. - -### sample_rate -```python -sample_rate: Literal[16000, 24000] = 16000 - -``` -The sample rate of the audio source. -Defaults to 16000. - -### channels -```python -channels: Literal[1, 2] = 1 - -``` -The number of channels in the audio source. -Supported values are 1 (mono) and 2 (stereo). -Defaults to 1 (mono) - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Custom metadata for the track. -Must be JSON-encodable. - ---- diff --git a/docs/api/server-python/submodules/errors.md b/docs/api/server-python/submodules/errors.md deleted file mode 100644 index 41f7cc57..00000000 --- a/docs/api/server-python/submodules/errors.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: errors -sidebar_label: errors -custom_edit_url: null ---- - -# errors - - - -## HTTPError -```python -class HTTPError(Exception): -``` - - ---- -## BadRequestError -```python -class BadRequestError(HTTPError): -``` - - ---- -## UnauthorizedError -```python -class UnauthorizedError(HTTPError): -``` - - ---- -## NotFoundError -```python -class NotFoundError(HTTPError): -``` - - ---- -## ServiceUnavailableError -```python -class ServiceUnavailableError(HTTPError): -``` - - ---- -## InternalServerError -```python -class InternalServerError(HTTPError): -``` - - ---- -## ConflictError -```python -class ConflictError(HTTPError): -``` - - ---- diff --git a/docs/api/server-python/submodules/events.md b/docs/api/server-python/submodules/events.md deleted file mode 100644 index b36fd45a..00000000 --- a/docs/api/server-python/submodules/events.md +++ /dev/null @@ -1,863 +0,0 @@ ---- -title: events -sidebar_label: events -custom_edit_url: null ---- - -# events - - - -## ServerMessageRoomCreated -```python -class ServerMessageRoomCreated(betterproto.Message): -``` -Notification sent when a room is created - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomDeleted -```python -class ServerMessageRoomDeleted(betterproto.Message): -``` -Notification sent when a room is deleted - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomCrashed -```python -class ServerMessageRoomCrashed(betterproto.Message): -``` -Notification sent when a room crashes - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerAdded -```python -class ServerMessagePeerAdded(betterproto.Message): -``` -Notification sent when a peer is added - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerConnected -```python -class ServerMessagePeerConnected(betterproto.Message): -``` -Notification sent when a peer connects - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDeleted -```python -class ServerMessagePeerDeleted(betterproto.Message): -``` -Notification sent when a peer is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDisconnected -```python -class ServerMessagePeerDisconnected(betterproto.Message): -``` -Notification sent when a peer disconnects from FJ - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerMetadataUpdated -```python -class ServerMessagePeerMetadataUpdated(betterproto.Message): -``` -Notification sent when peer updates its metadata - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - metadata: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### metadata -```python -metadata: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerCrashed -```python -class ServerMessagePeerCrashed(betterproto.Message): -``` -Notification sent when a peer crashes - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - reason: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### reason -```python -reason: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamConnected -```python -class ServerMessageStreamConnected(betterproto.Message): -``` -Notification sent when streamer successfully connects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamDisconnected -```python -class ServerMessageStreamDisconnected(betterproto.Message): -``` -Notification sent when streamer disconnects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackAdded -```python -class ServerMessageTrackAdded(betterproto.Message): -``` -Notification sent when peer or component adds new track - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackMetadataUpdated -```python -class ServerMessageTrackMetadataUpdated(betterproto.Message): -``` -Notification sent when metadata of a multimedia track is updated - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackRemoved -```python -class ServerMessageTrackRemoved(betterproto.Message): -``` -Notification sent when a track is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerConnected -```python -class ServerMessageViewerConnected(betterproto.Message): -``` -Notification sent when viewer successfully connects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerDisconnected -```python -class ServerMessageViewerDisconnected(betterproto.Message): -``` -Notification sent when viewer disconnects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## Track -```python -class Track(betterproto.Message): -``` -Describes a media track - -### __init__ -```python -def __init__( - id: str = , - type: TrackType = , - metadata: str = -) -``` - - -### id -```python -id: str -``` - - -### type -```python -type: TrackType -``` - - -### metadata -```python -metadata: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## TrackEncoding -```python -class TrackEncoding(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### TRACK_ENCODING_UNSPECIFIED -```python -TRACK_ENCODING_UNSPECIFIED = - -``` - - -### TRACK_ENCODING_PCM16 -```python -TRACK_ENCODING_PCM16 = - -``` - - -### TRACK_ENCODING_OPUS -```python -TRACK_ENCODING_OPUS = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## TrackType -```python -class TrackType(betterproto.Enum): -``` -Defines types of tracks being published by peers and component - -### TRACK_TYPE_UNSPECIFIED -```python -TRACK_TYPE_UNSPECIFIED = - -``` - - -### TRACK_TYPE_VIDEO -```python -TRACK_TYPE_VIDEO = - -``` - - -### TRACK_TYPE_AUDIO -```python -TRACK_TYPE_AUDIO = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## ServerMessagePeerType -```python -class ServerMessagePeerType(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### PEER_TYPE_UNSPECIFIED -```python -PEER_TYPE_UNSPECIFIED = - -``` - - -### PEER_TYPE_WEBRTC -```python -PEER_TYPE_WEBRTC = - -``` - - -### PEER_TYPE_AGENT -```python -PEER_TYPE_AGENT = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- diff --git a/docs/api/server-python/submodules/peer.md b/docs/api/server-python/submodules/peer.md deleted file mode 100644 index c1bfb405..00000000 --- a/docs/api/server-python/submodules/peer.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: peer -sidebar_label: peer -custom_edit_url: null ---- - -# peer - - - -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerStatus -```python -class PeerStatus(str, enum.Enum): -``` -Informs about the peer status - -### CONNECTED -```python -CONNECTED = - -``` - - -### DISCONNECTED -```python -DISCONNECTED = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## PeerType -```python -class PeerType(str, enum.Enum): -``` -Peer type - -### AGENT -```python -AGENT = - -``` - - -### WEBRTC -```python -WEBRTC = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/docs/api/server-python/submodules/room.md b/docs/api/server-python/submodules/room.md deleted file mode 100644 index 6459e895..00000000 --- a/docs/api/server-python/submodules/room.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: room -sidebar_label: room -custom_edit_url: null ---- - -# room - - - -## RoomConfig -```python -class RoomConfig: -``` -Room configuration - -Attributes: - max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. - public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. - room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to - conference. Default: RoomConfigRoomType.CONFERENCE. - video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: - RoomConfigVideoCodec.H264. - webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: - https://backend.address.com/fishjam-notifications-endpoint. - -### __init__ -```python -def __init__( - max_peers: Union[NoneType, Unset, int] = , - public: Union[Unset, bool] = False, - room_type: Union[Unset, RoomConfigRoomType] = , - video_codec: Union[Unset, RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, Unset, str] = -) -``` -Method generated by attrs for class RoomConfig. - -### max_peers -```python -max_peers: Union[NoneType, Unset, int] -``` - - -### public -```python -public: Union[Unset, bool] -``` - - -### room_type -```python -room_type: Union[Unset, RoomConfigRoomType] -``` - - -### video_codec -```python -video_codec: Union[Unset, RoomConfigVideoCodec] -``` - - -### webhook_url -```python -webhook_url: Union[NoneType, Unset, str] -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## RoomConfigVideoCodec -```python -class RoomConfigVideoCodec(str, enum.Enum): -``` -Enforces video codec for each peer in the room - -### H264 -```python -H264 = - -``` - - -### VP8 -```python -VP8 = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## RoomConfigRoomType -```python -class RoomConfigRoomType(str, enum.Enum): -``` -The use-case of the room. If not provided, this defaults to conference. - -### AUDIO_ONLY -```python -AUDIO_ONLY = - -``` - - -### AUDIO_ONLY_LIVESTREAM -```python -AUDIO_ONLY_LIVESTREAM = - -``` - - -### BROADCASTER -```python -BROADCASTER = - -``` - - -### CONFERENCE -```python -CONFERENCE = - -``` - - -### FULL_FEATURE -```python -FULL_FEATURE = - -``` - - -### LIVESTREAM -```python -LIVESTREAM = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/docusaurus.config.ts b/docusaurus.config.ts index afb3f64b..072d2b03 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -15,7 +15,9 @@ import { import { rendererClassic, transformerTwoslash } from "@shikijs/twoslash"; import { NormalizedSidebar, + NormalizedSidebarItem, SidebarItemsGeneratorVersion, + SidebarItemCategory, } from "@docusaurus/plugin-content-docs/src/sidebars/types.js"; function isErrorFromVersionedDocs(options: { meta?: { __raw?: string } }) { @@ -56,56 +58,74 @@ const rehypeShikiPlugin = [ } satisfies RehypeShikiOptions, ] satisfies MDXPlugin; +type CustomInjectedCategory = Omit & { + items: any; +}; + function injectTypeDocSidebar( version: SidebarItemsGeneratorVersion, items: NormalizedSidebar, ): NormalizedSidebar { + console.log(version.versionName); + const docs_without_python_reference = ["0.20.0", "0.21.0", "0.22.0"]; + + const exclude_python = docs_without_python_reference.includes( + version.versionName, + ); + return items.map((item) => { if (item.customProps?.id === "generated-api" && item.type === "category") { + const injectedItems: (CustomInjectedCategory | NormalizedSidebarItem)[] = + [ + { + type: "category", + label: "React Native SDK", + link: { type: "doc", id: "api/mobile/index" }, + items: require( + `${version.contentPath}/api/mobile/typedoc-sidebar.cjs`, + ), + }, + { + type: "category", + label: "React SDK", + link: { type: "doc", id: "api/web/index" }, + items: require( + `${version.contentPath}/api/web/typedoc-sidebar.cjs`, + ), + }, + { + type: "category", + label: "Server SDK for JS", + link: { type: "doc", id: "api/server/index" }, + items: require( + `${version.contentPath}/api/server/typedoc-sidebar.cjs`, + ), + }, + ]; + + if (!exclude_python) { + injectedItems.push({ + type: "category", + label: "Server SDK for Python", + link: { type: "doc", id: "api/server-python/fishjam" }, + items: [ + { + type: "autogenerated", + dirName: "api/server-python", + }, + ], + }); + } + return { ...item, items: [ - ...([ - { - type: "category", - label: "React Native SDK", - link: { type: "doc", id: "api/mobile/index" }, - items: require( - `${version.contentPath}/api/mobile/typedoc-sidebar.cjs`, - ), - }, - { - type: "category", - label: "React SDK", - link: { type: "doc", id: "api/web/index" }, - items: require( - `${version.contentPath}/api/web/typedoc-sidebar.cjs`, - ), - }, - { - type: "category", - label: "Server SDK for JS", - link: { type: "doc", id: "api/server/index" }, - items: require( - `${version.contentPath}/api/server/typedoc-sidebar.cjs`, - ), - }, - { - type: "category", - label: "Server SDK for Python", - link: { type: "doc", id: "api/server-python/fishjam" }, - items: [ - { - type: "autogenerated", - dirName: "api/server-python", - }, - ], - }, - ] as const), - ...item.items.filter((element) => element.type == "doc"), - ], + ...injectedItems, + ...item.items.filter((element) => element.type === "doc"), + ] as NormalizedSidebar, }; } + return item; }); } diff --git a/packages/python-server-sdk b/packages/python-server-sdk index 3ad5bbeb..5544a540 160000 --- a/packages/python-server-sdk +++ b/packages/python-server-sdk @@ -1 +1 @@ -Subproject commit 3ad5bbeb667f7aa687f948023f804ab60a49db39 +Subproject commit 5544a54041aec14c57a82d6463639502261cf7ef diff --git a/scripts/generate_python_docs.sh b/scripts/generate_python_docs.sh index 9bf135fe..38c11e96 100755 --- a/scripts/generate_python_docs.sh +++ b/scripts/generate_python_docs.sh @@ -6,19 +6,10 @@ ROOTDIR=$(dirname $(dirname "$(readlink -f $0)")) echo $ROOTDIR cd $ROOTDIR +cd packages/python-server-sdk +uv sync --all-packages +uv run generate_docusaurus +cd $ROOTDIR -# cd packages/python-server-sdk -# uv run generate_docs - -# cd $ROOTDIR -# rm packages/python-server-sdk/docs/api/index.md -# cp -r packages/python-server-sdk/docs/api docs/api/server-python -rm -rf versioned_docs/version-0.20.0/api/server-python -rm -rf versioned_docs/version-0.21.0/api/server-python -rm -rf versioned_docs/version-0.22.0/api/server-python -rm -rf versioned_docs/version-0.23.0/api/server-python - -cp -r docs/api/server-python versioned_docs/version-0.20.0/api/server-python -cp -r docs/api/server-python versioned_docs/version-0.21.0/api/server-python -cp -r docs/api/server-python versioned_docs/version-0.22.0/api/server-python -cp -r docs/api/server-python versioned_docs/version-0.23.0/api/server-python +rm -rf docs/api/server-python +cp -r packages/python-server-sdk/docusaurus docs/api/server-python diff --git a/versioned_docs/version-0.20.0/api/server-python/fishjam.md b/versioned_docs/version-0.20.0/api/server-python/fishjam.md deleted file mode 100644 index f0c4dcd2..00000000 --- a/versioned_docs/version-0.20.0/api/server-python/fishjam.md +++ /dev/null @@ -1,498 +0,0 @@ ---- -title: fishjam -sidebar_label: fishjam -custom_edit_url: null ---- - -# fishjam - - -## Submodules -- [events](submodules/events) -- [errors](submodules/errors) -- [room](submodules/room) -- [peer](submodules/peer) -- [agent](submodules/agent) - -## FishjamClient -```python -class FishjamClient(Client): -``` -Allows for managing rooms - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create a FishjamClient instance, providing the fishjam id and management token. - -### create_peer -```python -def create_peer( - self, - room_id: str, - options: PeerOptions | None = None -) -> tuple[Peer, str] -``` -Creates peer in the room - -Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer -to authenticate to Fishjam. - -The possible options to pass for peer are `PeerOptions`. - -### create_agent -```python -def create_agent( - self, - room_id: str, - options: AgentOptions | None = None -) -``` - - -### create_room -```python -def create_room( - self, - options: RoomOptions | None = None -) -> Room -``` -Creates a new room -Returns the created `Room` - -### get_all_rooms -```python -def get_all_rooms(self) -> list[Room] -``` -Returns list of all rooms - -### get_room -```python -def get_room(self, room_id: str) -> Room -``` -Returns room with the given id - -### delete_peer -```python -def delete_peer(self, room_id: str, peer_id: str) -> None -``` -Deletes peer - -### delete_room -```python -def delete_room(self, room_id: str) -> None -``` -Deletes a room - -### refresh_peer_token -```python -def refresh_peer_token(self, room_id: str, peer_id: str) -> str -``` -Refreshes peer token - -### create_livestream_viewer_token -```python -def create_livestream_viewer_token(self, room_id: str) -> str -``` -Generates viewer token for livestream rooms - -### create_livestream_streamer_token -```python -def create_livestream_streamer_token(self, room_id: str) -> str -``` -Generates streamer token for livestream rooms - -### subscribe_peer -```python -def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) -``` -Subscribe a peer to all tracks of another peer. - -### subscribe_tracks -```python -def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) -``` -Subscribe a peer to specific tracks of another peer. - -#### Inherited Members -* **Client**: - * `client` ---- -## FishjamNotifier -```python -class FishjamNotifier: -``` -Allows for receiving WebSocket messages from Fishjam. - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create FishjamNotifier instance, providing the fishjam id and management token. - -### on_server_notification -```python -def on_server_notification( - self, - handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] -) -``` -Decorator used for defining handler for Fishjam Notifications - -### connect -```python -def connect(self) -``` -A coroutine which connects FishjamNotifier to Fishjam and listens for -all incoming messages from the Fishjam. - -It runs until the connection isn't closed. - -The incoming messages are handled by the functions defined using the -`on_server_notification` decorator. - -The handler have to be defined before calling `connect`, -otherwise the messages won't be received. - -### wait_ready -```python -def wait_ready(self) -> None -``` -Waits until the notifier is connected and authenticated to Fishjam. - -If already connected, returns immediately. - ---- -## receive_binary -```python -def receive_binary( - binary: bytes -) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] -``` -Transform received protobuf notification to adequate notification instance. -The available notifications are listed in `fishjam.events` module. - ---- -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerOptions -```python -class PeerOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - enable_simulcast: bool = True, - metadata: dict[str, typing.Any] | None = None, - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### enable_simulcast -```python -enable_simulcast: bool = True - -``` -Enables the peer to use simulcast - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Peer metadata - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` -Configuration of peer's subscribing policy - ---- -## RoomOptions -```python -class RoomOptions: -``` -Description of a room options - -### __init__ -```python -def __init__( - max_peers: int | None = None, - video_codec: Optional[Literal['h264', 'vp8']] = None, - webhook_url: str | None = None, - room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', - public: bool = False -) -``` - - -### max_peers -```python -max_peers: int | None = None - -``` -Maximum amount of peers allowed into the room - -### video_codec -```python -video_codec: Optional[Literal['h264', 'vp8']] = None - -``` -Enforces video codec for each peer in the room - -### webhook_url -```python -webhook_url: str | None = None - -``` -URL where Fishjam notifications will be sent - -### room_type -```python -room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' - -``` -The use-case of the room. If not provided, this defaults to conference. - -### public -```python -public: bool = False - -``` -True if livestream viewers can omit specifying a token. - ---- -## AgentOptions -```python -class AgentOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - output: AgentOutputOptions = , - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### output -```python -output: AgentOutputOptions -``` - - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` - - ---- -## AgentOutputOptions -```python -class AgentOutputOptions: -``` -Options of the desired format of audio tracks going from Fishjam to the agent. - -### __init__ -```python -def __init__( - audio_format: Literal['pcm16'] = 'pcm16', - audio_sample_rate: Literal[16000, 24000] = 16000 -) -``` - - -### audio_format -```python -audio_format: Literal['pcm16'] = 'pcm16' - -``` - - -### audio_sample_rate -```python -audio_sample_rate: Literal[16000, 24000] = 16000 - -``` - - ---- -## Room -```python -class Room: -``` -Description of the room state - -### __init__ -```python -def __init__( - config: RoomConfig, - id: str, - peers: list[Peer] -) -``` - - -### config -```python -config: RoomConfig -``` -Room configuration - -### id -```python -id: str -``` -Room ID - -### peers -```python -peers: list[Peer] -``` -List of all peers - ---- -## Peer -```python -class Peer: -``` -Describes peer status - -Attributes: - id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. - metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. - status (PeerStatus): Informs about the peer status Example: disconnected. - subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy - subscriptions (Subscriptions): Describes peer's subscriptions in manual mode - tracks (list['Track']): List of all peer's tracks - type_ (PeerType): Peer type Example: webrtc. - -### __init__ -```python -def __init__( - id: str, - metadata: Optional[PeerMetadata], - status: PeerStatus, - subscribe_mode: SubscribeMode, - subscriptions: Subscriptions, - tracks: list[Track], - type_: PeerType -) -``` -Method generated by attrs for class Peer. - -### id -```python -id: str -``` - - -### metadata -```python -metadata: Optional[PeerMetadata] -``` - - -### status -```python -status: PeerStatus -``` - - -### subscribe_mode -```python -subscribe_mode: SubscribeMode -``` - - -### subscriptions -```python -subscriptions: Subscriptions -``` - - -### tracks -```python -tracks: list[Track] -``` - - -### type_ -```python -type_: PeerType -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- diff --git a/versioned_docs/version-0.20.0/api/server-python/submodules/agent.md b/versioned_docs/version-0.20.0/api/server-python/submodules/agent.md deleted file mode 100644 index 3fae055c..00000000 --- a/versioned_docs/version-0.20.0/api/server-python/submodules/agent.md +++ /dev/null @@ -1,237 +0,0 @@ ---- -title: agent -sidebar_label: agent -custom_edit_url: null ---- - -# agent - - - -## Agent -```python -class Agent: -``` -Allows for connecting to a Fishjam room as an agent peer. -Provides callbacks for receiving audio. - -### __init__ -```python -def __init__(id: str, room_id: str, token: str, fishjam_url: str) -``` -Create Agent instance, providing the fishjam id and management token. - -This constructor should not be called directly. -Instead, you should call :func:`fishjam.FishjamClient.create_agent`. - -### id -```python -id -``` - - -### room_id -```python -room_id -``` - - -### connect -```python -def connect(self) -``` -Connect the agent to Fishjam to start receiving messages. - -Incoming messages from Fishjam will be routed to handlers -defined with :func:`on_track_data`. - -:raises AgentAuthError: authentication failed - ---- -## AgentError -```python -class AgentError(Exception): -``` -Base exception class for all agent exceptions - ---- -## AgentSession -```python -class AgentSession: -``` - - -### __init__ -```python -def __init__( - agent: fishjam.agent.agent.Agent, - websocket: websockets.asyncio.client.ClientConnection -) -``` - - -### agent -```python -agent -``` - - -### receive -```python -def receive( - self -) -> AsyncIterator[AgentResponseTrackData] -``` -Returns an infinite async iterator over the incoming messages from Fishjam to -the agent. - -### add_track -```python -def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) -``` -Adds a track to the connected agent, with the specified options and metadata. - -Returns an instance of :class:`OutgoingTrack`, which can be used to send data -over the added track. - -### disconnect -```python -def disconnect(self) -``` -Ends the agent session by closing the websocket connection. -Useful when you don't use the context manager to obtain the session. - ---- -## AgentAuthError -```python -class AgentAuthError(fishjam.agent.errors.AgentError): -``` -Agent failed to authenticate properly - -### __init__ -```python -def __init__(reason: str) -``` - - -### reason -```python -reason -``` - - ---- -## IncomingTrackData -```python -IncomingTrackData = - -``` - - ---- -## OutgoingTrack -```python -class OutgoingTrack: -``` -Represents an outgoing track of an agent connected to Fishjam, -created by :func:`Agent.add_track`. - -### __init__ -```python -def __init__( - id: str, - session: fishjam.agent.agent.AgentSession, - options: fishjam.agent.agent.OutgoingAudioTrackOptions -) -``` - - -### id -```python -id: str -``` -The global identifier of the track. - -### session -```python -session: fishjam.agent.agent.AgentSession -``` -The agent the track belongs to. - -### options -```python -options: fishjam.agent.agent.OutgoingAudioTrackOptions -``` -The parameters used to create the track. - -### send_chunk -```python -def send_chunk(self, data: bytes) -``` -Send a chunk of audio to Fishjam on this track. - -Peers connected to the room of the agent will receive this data. - -### interrupt -```python -def interrupt(self) -``` -Interrupt current track. - -Any audio that has been sent, but not played -will be cleared and be prevented from playing. - -Audio sent after the interrupt will be played normally. - ---- -## OutgoingAudioTrackOptions -```python -class OutgoingAudioTrackOptions: -``` -Parameters of an outgoing audio track. - -### __init__ -```python -def __init__( - encoding: TrackEncoding = , - sample_rate: Literal[16000, 24000] = 16000, - channels: Literal[1, 2] = 1, - metadata: dict[str, typing.Any] | None = None -) -``` - - -### encoding -```python -encoding: TrackEncoding = - -``` -The encoding of the audio source. -Defaults to raw 16-bit PCM. - -### sample_rate -```python -sample_rate: Literal[16000, 24000] = 16000 - -``` -The sample rate of the audio source. -Defaults to 16000. - -### channels -```python -channels: Literal[1, 2] = 1 - -``` -The number of channels in the audio source. -Supported values are 1 (mono) and 2 (stereo). -Defaults to 1 (mono) - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Custom metadata for the track. -Must be JSON-encodable. - ---- diff --git a/versioned_docs/version-0.20.0/api/server-python/submodules/errors.md b/versioned_docs/version-0.20.0/api/server-python/submodules/errors.md deleted file mode 100644 index 41f7cc57..00000000 --- a/versioned_docs/version-0.20.0/api/server-python/submodules/errors.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: errors -sidebar_label: errors -custom_edit_url: null ---- - -# errors - - - -## HTTPError -```python -class HTTPError(Exception): -``` - - ---- -## BadRequestError -```python -class BadRequestError(HTTPError): -``` - - ---- -## UnauthorizedError -```python -class UnauthorizedError(HTTPError): -``` - - ---- -## NotFoundError -```python -class NotFoundError(HTTPError): -``` - - ---- -## ServiceUnavailableError -```python -class ServiceUnavailableError(HTTPError): -``` - - ---- -## InternalServerError -```python -class InternalServerError(HTTPError): -``` - - ---- -## ConflictError -```python -class ConflictError(HTTPError): -``` - - ---- diff --git a/versioned_docs/version-0.20.0/api/server-python/submodules/events.md b/versioned_docs/version-0.20.0/api/server-python/submodules/events.md deleted file mode 100644 index b36fd45a..00000000 --- a/versioned_docs/version-0.20.0/api/server-python/submodules/events.md +++ /dev/null @@ -1,863 +0,0 @@ ---- -title: events -sidebar_label: events -custom_edit_url: null ---- - -# events - - - -## ServerMessageRoomCreated -```python -class ServerMessageRoomCreated(betterproto.Message): -``` -Notification sent when a room is created - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomDeleted -```python -class ServerMessageRoomDeleted(betterproto.Message): -``` -Notification sent when a room is deleted - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomCrashed -```python -class ServerMessageRoomCrashed(betterproto.Message): -``` -Notification sent when a room crashes - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerAdded -```python -class ServerMessagePeerAdded(betterproto.Message): -``` -Notification sent when a peer is added - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerConnected -```python -class ServerMessagePeerConnected(betterproto.Message): -``` -Notification sent when a peer connects - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDeleted -```python -class ServerMessagePeerDeleted(betterproto.Message): -``` -Notification sent when a peer is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDisconnected -```python -class ServerMessagePeerDisconnected(betterproto.Message): -``` -Notification sent when a peer disconnects from FJ - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerMetadataUpdated -```python -class ServerMessagePeerMetadataUpdated(betterproto.Message): -``` -Notification sent when peer updates its metadata - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - metadata: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### metadata -```python -metadata: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerCrashed -```python -class ServerMessagePeerCrashed(betterproto.Message): -``` -Notification sent when a peer crashes - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - reason: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### reason -```python -reason: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamConnected -```python -class ServerMessageStreamConnected(betterproto.Message): -``` -Notification sent when streamer successfully connects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamDisconnected -```python -class ServerMessageStreamDisconnected(betterproto.Message): -``` -Notification sent when streamer disconnects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackAdded -```python -class ServerMessageTrackAdded(betterproto.Message): -``` -Notification sent when peer or component adds new track - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackMetadataUpdated -```python -class ServerMessageTrackMetadataUpdated(betterproto.Message): -``` -Notification sent when metadata of a multimedia track is updated - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackRemoved -```python -class ServerMessageTrackRemoved(betterproto.Message): -``` -Notification sent when a track is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerConnected -```python -class ServerMessageViewerConnected(betterproto.Message): -``` -Notification sent when viewer successfully connects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerDisconnected -```python -class ServerMessageViewerDisconnected(betterproto.Message): -``` -Notification sent when viewer disconnects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## Track -```python -class Track(betterproto.Message): -``` -Describes a media track - -### __init__ -```python -def __init__( - id: str = , - type: TrackType = , - metadata: str = -) -``` - - -### id -```python -id: str -``` - - -### type -```python -type: TrackType -``` - - -### metadata -```python -metadata: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## TrackEncoding -```python -class TrackEncoding(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### TRACK_ENCODING_UNSPECIFIED -```python -TRACK_ENCODING_UNSPECIFIED = - -``` - - -### TRACK_ENCODING_PCM16 -```python -TRACK_ENCODING_PCM16 = - -``` - - -### TRACK_ENCODING_OPUS -```python -TRACK_ENCODING_OPUS = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## TrackType -```python -class TrackType(betterproto.Enum): -``` -Defines types of tracks being published by peers and component - -### TRACK_TYPE_UNSPECIFIED -```python -TRACK_TYPE_UNSPECIFIED = - -``` - - -### TRACK_TYPE_VIDEO -```python -TRACK_TYPE_VIDEO = - -``` - - -### TRACK_TYPE_AUDIO -```python -TRACK_TYPE_AUDIO = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## ServerMessagePeerType -```python -class ServerMessagePeerType(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### PEER_TYPE_UNSPECIFIED -```python -PEER_TYPE_UNSPECIFIED = - -``` - - -### PEER_TYPE_WEBRTC -```python -PEER_TYPE_WEBRTC = - -``` - - -### PEER_TYPE_AGENT -```python -PEER_TYPE_AGENT = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.20.0/api/server-python/submodules/peer.md b/versioned_docs/version-0.20.0/api/server-python/submodules/peer.md deleted file mode 100644 index c1bfb405..00000000 --- a/versioned_docs/version-0.20.0/api/server-python/submodules/peer.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: peer -sidebar_label: peer -custom_edit_url: null ---- - -# peer - - - -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerStatus -```python -class PeerStatus(str, enum.Enum): -``` -Informs about the peer status - -### CONNECTED -```python -CONNECTED = - -``` - - -### DISCONNECTED -```python -DISCONNECTED = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## PeerType -```python -class PeerType(str, enum.Enum): -``` -Peer type - -### AGENT -```python -AGENT = - -``` - - -### WEBRTC -```python -WEBRTC = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.20.0/api/server-python/submodules/room.md b/versioned_docs/version-0.20.0/api/server-python/submodules/room.md deleted file mode 100644 index 6459e895..00000000 --- a/versioned_docs/version-0.20.0/api/server-python/submodules/room.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: room -sidebar_label: room -custom_edit_url: null ---- - -# room - - - -## RoomConfig -```python -class RoomConfig: -``` -Room configuration - -Attributes: - max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. - public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. - room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to - conference. Default: RoomConfigRoomType.CONFERENCE. - video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: - RoomConfigVideoCodec.H264. - webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: - https://backend.address.com/fishjam-notifications-endpoint. - -### __init__ -```python -def __init__( - max_peers: Union[NoneType, Unset, int] = , - public: Union[Unset, bool] = False, - room_type: Union[Unset, RoomConfigRoomType] = , - video_codec: Union[Unset, RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, Unset, str] = -) -``` -Method generated by attrs for class RoomConfig. - -### max_peers -```python -max_peers: Union[NoneType, Unset, int] -``` - - -### public -```python -public: Union[Unset, bool] -``` - - -### room_type -```python -room_type: Union[Unset, RoomConfigRoomType] -``` - - -### video_codec -```python -video_codec: Union[Unset, RoomConfigVideoCodec] -``` - - -### webhook_url -```python -webhook_url: Union[NoneType, Unset, str] -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## RoomConfigVideoCodec -```python -class RoomConfigVideoCodec(str, enum.Enum): -``` -Enforces video codec for each peer in the room - -### H264 -```python -H264 = - -``` - - -### VP8 -```python -VP8 = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## RoomConfigRoomType -```python -class RoomConfigRoomType(str, enum.Enum): -``` -The use-case of the room. If not provided, this defaults to conference. - -### AUDIO_ONLY -```python -AUDIO_ONLY = - -``` - - -### AUDIO_ONLY_LIVESTREAM -```python -AUDIO_ONLY_LIVESTREAM = - -``` - - -### BROADCASTER -```python -BROADCASTER = - -``` - - -### CONFERENCE -```python -CONFERENCE = - -``` - - -### FULL_FEATURE -```python -FULL_FEATURE = - -``` - - -### LIVESTREAM -```python -LIVESTREAM = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.21.0/api/server-python/fishjam.md b/versioned_docs/version-0.21.0/api/server-python/fishjam.md deleted file mode 100644 index f0c4dcd2..00000000 --- a/versioned_docs/version-0.21.0/api/server-python/fishjam.md +++ /dev/null @@ -1,498 +0,0 @@ ---- -title: fishjam -sidebar_label: fishjam -custom_edit_url: null ---- - -# fishjam - - -## Submodules -- [events](submodules/events) -- [errors](submodules/errors) -- [room](submodules/room) -- [peer](submodules/peer) -- [agent](submodules/agent) - -## FishjamClient -```python -class FishjamClient(Client): -``` -Allows for managing rooms - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create a FishjamClient instance, providing the fishjam id and management token. - -### create_peer -```python -def create_peer( - self, - room_id: str, - options: PeerOptions | None = None -) -> tuple[Peer, str] -``` -Creates peer in the room - -Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer -to authenticate to Fishjam. - -The possible options to pass for peer are `PeerOptions`. - -### create_agent -```python -def create_agent( - self, - room_id: str, - options: AgentOptions | None = None -) -``` - - -### create_room -```python -def create_room( - self, - options: RoomOptions | None = None -) -> Room -``` -Creates a new room -Returns the created `Room` - -### get_all_rooms -```python -def get_all_rooms(self) -> list[Room] -``` -Returns list of all rooms - -### get_room -```python -def get_room(self, room_id: str) -> Room -``` -Returns room with the given id - -### delete_peer -```python -def delete_peer(self, room_id: str, peer_id: str) -> None -``` -Deletes peer - -### delete_room -```python -def delete_room(self, room_id: str) -> None -``` -Deletes a room - -### refresh_peer_token -```python -def refresh_peer_token(self, room_id: str, peer_id: str) -> str -``` -Refreshes peer token - -### create_livestream_viewer_token -```python -def create_livestream_viewer_token(self, room_id: str) -> str -``` -Generates viewer token for livestream rooms - -### create_livestream_streamer_token -```python -def create_livestream_streamer_token(self, room_id: str) -> str -``` -Generates streamer token for livestream rooms - -### subscribe_peer -```python -def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) -``` -Subscribe a peer to all tracks of another peer. - -### subscribe_tracks -```python -def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) -``` -Subscribe a peer to specific tracks of another peer. - -#### Inherited Members -* **Client**: - * `client` ---- -## FishjamNotifier -```python -class FishjamNotifier: -``` -Allows for receiving WebSocket messages from Fishjam. - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create FishjamNotifier instance, providing the fishjam id and management token. - -### on_server_notification -```python -def on_server_notification( - self, - handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] -) -``` -Decorator used for defining handler for Fishjam Notifications - -### connect -```python -def connect(self) -``` -A coroutine which connects FishjamNotifier to Fishjam and listens for -all incoming messages from the Fishjam. - -It runs until the connection isn't closed. - -The incoming messages are handled by the functions defined using the -`on_server_notification` decorator. - -The handler have to be defined before calling `connect`, -otherwise the messages won't be received. - -### wait_ready -```python -def wait_ready(self) -> None -``` -Waits until the notifier is connected and authenticated to Fishjam. - -If already connected, returns immediately. - ---- -## receive_binary -```python -def receive_binary( - binary: bytes -) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] -``` -Transform received protobuf notification to adequate notification instance. -The available notifications are listed in `fishjam.events` module. - ---- -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerOptions -```python -class PeerOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - enable_simulcast: bool = True, - metadata: dict[str, typing.Any] | None = None, - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### enable_simulcast -```python -enable_simulcast: bool = True - -``` -Enables the peer to use simulcast - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Peer metadata - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` -Configuration of peer's subscribing policy - ---- -## RoomOptions -```python -class RoomOptions: -``` -Description of a room options - -### __init__ -```python -def __init__( - max_peers: int | None = None, - video_codec: Optional[Literal['h264', 'vp8']] = None, - webhook_url: str | None = None, - room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', - public: bool = False -) -``` - - -### max_peers -```python -max_peers: int | None = None - -``` -Maximum amount of peers allowed into the room - -### video_codec -```python -video_codec: Optional[Literal['h264', 'vp8']] = None - -``` -Enforces video codec for each peer in the room - -### webhook_url -```python -webhook_url: str | None = None - -``` -URL where Fishjam notifications will be sent - -### room_type -```python -room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' - -``` -The use-case of the room. If not provided, this defaults to conference. - -### public -```python -public: bool = False - -``` -True if livestream viewers can omit specifying a token. - ---- -## AgentOptions -```python -class AgentOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - output: AgentOutputOptions = , - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### output -```python -output: AgentOutputOptions -``` - - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` - - ---- -## AgentOutputOptions -```python -class AgentOutputOptions: -``` -Options of the desired format of audio tracks going from Fishjam to the agent. - -### __init__ -```python -def __init__( - audio_format: Literal['pcm16'] = 'pcm16', - audio_sample_rate: Literal[16000, 24000] = 16000 -) -``` - - -### audio_format -```python -audio_format: Literal['pcm16'] = 'pcm16' - -``` - - -### audio_sample_rate -```python -audio_sample_rate: Literal[16000, 24000] = 16000 - -``` - - ---- -## Room -```python -class Room: -``` -Description of the room state - -### __init__ -```python -def __init__( - config: RoomConfig, - id: str, - peers: list[Peer] -) -``` - - -### config -```python -config: RoomConfig -``` -Room configuration - -### id -```python -id: str -``` -Room ID - -### peers -```python -peers: list[Peer] -``` -List of all peers - ---- -## Peer -```python -class Peer: -``` -Describes peer status - -Attributes: - id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. - metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. - status (PeerStatus): Informs about the peer status Example: disconnected. - subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy - subscriptions (Subscriptions): Describes peer's subscriptions in manual mode - tracks (list['Track']): List of all peer's tracks - type_ (PeerType): Peer type Example: webrtc. - -### __init__ -```python -def __init__( - id: str, - metadata: Optional[PeerMetadata], - status: PeerStatus, - subscribe_mode: SubscribeMode, - subscriptions: Subscriptions, - tracks: list[Track], - type_: PeerType -) -``` -Method generated by attrs for class Peer. - -### id -```python -id: str -``` - - -### metadata -```python -metadata: Optional[PeerMetadata] -``` - - -### status -```python -status: PeerStatus -``` - - -### subscribe_mode -```python -subscribe_mode: SubscribeMode -``` - - -### subscriptions -```python -subscriptions: Subscriptions -``` - - -### tracks -```python -tracks: list[Track] -``` - - -### type_ -```python -type_: PeerType -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- diff --git a/versioned_docs/version-0.21.0/api/server-python/submodules/agent.md b/versioned_docs/version-0.21.0/api/server-python/submodules/agent.md deleted file mode 100644 index 3fae055c..00000000 --- a/versioned_docs/version-0.21.0/api/server-python/submodules/agent.md +++ /dev/null @@ -1,237 +0,0 @@ ---- -title: agent -sidebar_label: agent -custom_edit_url: null ---- - -# agent - - - -## Agent -```python -class Agent: -``` -Allows for connecting to a Fishjam room as an agent peer. -Provides callbacks for receiving audio. - -### __init__ -```python -def __init__(id: str, room_id: str, token: str, fishjam_url: str) -``` -Create Agent instance, providing the fishjam id and management token. - -This constructor should not be called directly. -Instead, you should call :func:`fishjam.FishjamClient.create_agent`. - -### id -```python -id -``` - - -### room_id -```python -room_id -``` - - -### connect -```python -def connect(self) -``` -Connect the agent to Fishjam to start receiving messages. - -Incoming messages from Fishjam will be routed to handlers -defined with :func:`on_track_data`. - -:raises AgentAuthError: authentication failed - ---- -## AgentError -```python -class AgentError(Exception): -``` -Base exception class for all agent exceptions - ---- -## AgentSession -```python -class AgentSession: -``` - - -### __init__ -```python -def __init__( - agent: fishjam.agent.agent.Agent, - websocket: websockets.asyncio.client.ClientConnection -) -``` - - -### agent -```python -agent -``` - - -### receive -```python -def receive( - self -) -> AsyncIterator[AgentResponseTrackData] -``` -Returns an infinite async iterator over the incoming messages from Fishjam to -the agent. - -### add_track -```python -def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) -``` -Adds a track to the connected agent, with the specified options and metadata. - -Returns an instance of :class:`OutgoingTrack`, which can be used to send data -over the added track. - -### disconnect -```python -def disconnect(self) -``` -Ends the agent session by closing the websocket connection. -Useful when you don't use the context manager to obtain the session. - ---- -## AgentAuthError -```python -class AgentAuthError(fishjam.agent.errors.AgentError): -``` -Agent failed to authenticate properly - -### __init__ -```python -def __init__(reason: str) -``` - - -### reason -```python -reason -``` - - ---- -## IncomingTrackData -```python -IncomingTrackData = - -``` - - ---- -## OutgoingTrack -```python -class OutgoingTrack: -``` -Represents an outgoing track of an agent connected to Fishjam, -created by :func:`Agent.add_track`. - -### __init__ -```python -def __init__( - id: str, - session: fishjam.agent.agent.AgentSession, - options: fishjam.agent.agent.OutgoingAudioTrackOptions -) -``` - - -### id -```python -id: str -``` -The global identifier of the track. - -### session -```python -session: fishjam.agent.agent.AgentSession -``` -The agent the track belongs to. - -### options -```python -options: fishjam.agent.agent.OutgoingAudioTrackOptions -``` -The parameters used to create the track. - -### send_chunk -```python -def send_chunk(self, data: bytes) -``` -Send a chunk of audio to Fishjam on this track. - -Peers connected to the room of the agent will receive this data. - -### interrupt -```python -def interrupt(self) -``` -Interrupt current track. - -Any audio that has been sent, but not played -will be cleared and be prevented from playing. - -Audio sent after the interrupt will be played normally. - ---- -## OutgoingAudioTrackOptions -```python -class OutgoingAudioTrackOptions: -``` -Parameters of an outgoing audio track. - -### __init__ -```python -def __init__( - encoding: TrackEncoding = , - sample_rate: Literal[16000, 24000] = 16000, - channels: Literal[1, 2] = 1, - metadata: dict[str, typing.Any] | None = None -) -``` - - -### encoding -```python -encoding: TrackEncoding = - -``` -The encoding of the audio source. -Defaults to raw 16-bit PCM. - -### sample_rate -```python -sample_rate: Literal[16000, 24000] = 16000 - -``` -The sample rate of the audio source. -Defaults to 16000. - -### channels -```python -channels: Literal[1, 2] = 1 - -``` -The number of channels in the audio source. -Supported values are 1 (mono) and 2 (stereo). -Defaults to 1 (mono) - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Custom metadata for the track. -Must be JSON-encodable. - ---- diff --git a/versioned_docs/version-0.21.0/api/server-python/submodules/errors.md b/versioned_docs/version-0.21.0/api/server-python/submodules/errors.md deleted file mode 100644 index 41f7cc57..00000000 --- a/versioned_docs/version-0.21.0/api/server-python/submodules/errors.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: errors -sidebar_label: errors -custom_edit_url: null ---- - -# errors - - - -## HTTPError -```python -class HTTPError(Exception): -``` - - ---- -## BadRequestError -```python -class BadRequestError(HTTPError): -``` - - ---- -## UnauthorizedError -```python -class UnauthorizedError(HTTPError): -``` - - ---- -## NotFoundError -```python -class NotFoundError(HTTPError): -``` - - ---- -## ServiceUnavailableError -```python -class ServiceUnavailableError(HTTPError): -``` - - ---- -## InternalServerError -```python -class InternalServerError(HTTPError): -``` - - ---- -## ConflictError -```python -class ConflictError(HTTPError): -``` - - ---- diff --git a/versioned_docs/version-0.21.0/api/server-python/submodules/events.md b/versioned_docs/version-0.21.0/api/server-python/submodules/events.md deleted file mode 100644 index b36fd45a..00000000 --- a/versioned_docs/version-0.21.0/api/server-python/submodules/events.md +++ /dev/null @@ -1,863 +0,0 @@ ---- -title: events -sidebar_label: events -custom_edit_url: null ---- - -# events - - - -## ServerMessageRoomCreated -```python -class ServerMessageRoomCreated(betterproto.Message): -``` -Notification sent when a room is created - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomDeleted -```python -class ServerMessageRoomDeleted(betterproto.Message): -``` -Notification sent when a room is deleted - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomCrashed -```python -class ServerMessageRoomCrashed(betterproto.Message): -``` -Notification sent when a room crashes - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerAdded -```python -class ServerMessagePeerAdded(betterproto.Message): -``` -Notification sent when a peer is added - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerConnected -```python -class ServerMessagePeerConnected(betterproto.Message): -``` -Notification sent when a peer connects - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDeleted -```python -class ServerMessagePeerDeleted(betterproto.Message): -``` -Notification sent when a peer is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDisconnected -```python -class ServerMessagePeerDisconnected(betterproto.Message): -``` -Notification sent when a peer disconnects from FJ - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerMetadataUpdated -```python -class ServerMessagePeerMetadataUpdated(betterproto.Message): -``` -Notification sent when peer updates its metadata - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - metadata: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### metadata -```python -metadata: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerCrashed -```python -class ServerMessagePeerCrashed(betterproto.Message): -``` -Notification sent when a peer crashes - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - reason: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### reason -```python -reason: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamConnected -```python -class ServerMessageStreamConnected(betterproto.Message): -``` -Notification sent when streamer successfully connects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamDisconnected -```python -class ServerMessageStreamDisconnected(betterproto.Message): -``` -Notification sent when streamer disconnects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackAdded -```python -class ServerMessageTrackAdded(betterproto.Message): -``` -Notification sent when peer or component adds new track - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackMetadataUpdated -```python -class ServerMessageTrackMetadataUpdated(betterproto.Message): -``` -Notification sent when metadata of a multimedia track is updated - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackRemoved -```python -class ServerMessageTrackRemoved(betterproto.Message): -``` -Notification sent when a track is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerConnected -```python -class ServerMessageViewerConnected(betterproto.Message): -``` -Notification sent when viewer successfully connects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerDisconnected -```python -class ServerMessageViewerDisconnected(betterproto.Message): -``` -Notification sent when viewer disconnects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## Track -```python -class Track(betterproto.Message): -``` -Describes a media track - -### __init__ -```python -def __init__( - id: str = , - type: TrackType = , - metadata: str = -) -``` - - -### id -```python -id: str -``` - - -### type -```python -type: TrackType -``` - - -### metadata -```python -metadata: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## TrackEncoding -```python -class TrackEncoding(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### TRACK_ENCODING_UNSPECIFIED -```python -TRACK_ENCODING_UNSPECIFIED = - -``` - - -### TRACK_ENCODING_PCM16 -```python -TRACK_ENCODING_PCM16 = - -``` - - -### TRACK_ENCODING_OPUS -```python -TRACK_ENCODING_OPUS = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## TrackType -```python -class TrackType(betterproto.Enum): -``` -Defines types of tracks being published by peers and component - -### TRACK_TYPE_UNSPECIFIED -```python -TRACK_TYPE_UNSPECIFIED = - -``` - - -### TRACK_TYPE_VIDEO -```python -TRACK_TYPE_VIDEO = - -``` - - -### TRACK_TYPE_AUDIO -```python -TRACK_TYPE_AUDIO = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## ServerMessagePeerType -```python -class ServerMessagePeerType(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### PEER_TYPE_UNSPECIFIED -```python -PEER_TYPE_UNSPECIFIED = - -``` - - -### PEER_TYPE_WEBRTC -```python -PEER_TYPE_WEBRTC = - -``` - - -### PEER_TYPE_AGENT -```python -PEER_TYPE_AGENT = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.21.0/api/server-python/submodules/peer.md b/versioned_docs/version-0.21.0/api/server-python/submodules/peer.md deleted file mode 100644 index c1bfb405..00000000 --- a/versioned_docs/version-0.21.0/api/server-python/submodules/peer.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: peer -sidebar_label: peer -custom_edit_url: null ---- - -# peer - - - -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerStatus -```python -class PeerStatus(str, enum.Enum): -``` -Informs about the peer status - -### CONNECTED -```python -CONNECTED = - -``` - - -### DISCONNECTED -```python -DISCONNECTED = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## PeerType -```python -class PeerType(str, enum.Enum): -``` -Peer type - -### AGENT -```python -AGENT = - -``` - - -### WEBRTC -```python -WEBRTC = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.21.0/api/server-python/submodules/room.md b/versioned_docs/version-0.21.0/api/server-python/submodules/room.md deleted file mode 100644 index 6459e895..00000000 --- a/versioned_docs/version-0.21.0/api/server-python/submodules/room.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: room -sidebar_label: room -custom_edit_url: null ---- - -# room - - - -## RoomConfig -```python -class RoomConfig: -``` -Room configuration - -Attributes: - max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. - public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. - room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to - conference. Default: RoomConfigRoomType.CONFERENCE. - video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: - RoomConfigVideoCodec.H264. - webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: - https://backend.address.com/fishjam-notifications-endpoint. - -### __init__ -```python -def __init__( - max_peers: Union[NoneType, Unset, int] = , - public: Union[Unset, bool] = False, - room_type: Union[Unset, RoomConfigRoomType] = , - video_codec: Union[Unset, RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, Unset, str] = -) -``` -Method generated by attrs for class RoomConfig. - -### max_peers -```python -max_peers: Union[NoneType, Unset, int] -``` - - -### public -```python -public: Union[Unset, bool] -``` - - -### room_type -```python -room_type: Union[Unset, RoomConfigRoomType] -``` - - -### video_codec -```python -video_codec: Union[Unset, RoomConfigVideoCodec] -``` - - -### webhook_url -```python -webhook_url: Union[NoneType, Unset, str] -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## RoomConfigVideoCodec -```python -class RoomConfigVideoCodec(str, enum.Enum): -``` -Enforces video codec for each peer in the room - -### H264 -```python -H264 = - -``` - - -### VP8 -```python -VP8 = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## RoomConfigRoomType -```python -class RoomConfigRoomType(str, enum.Enum): -``` -The use-case of the room. If not provided, this defaults to conference. - -### AUDIO_ONLY -```python -AUDIO_ONLY = - -``` - - -### AUDIO_ONLY_LIVESTREAM -```python -AUDIO_ONLY_LIVESTREAM = - -``` - - -### BROADCASTER -```python -BROADCASTER = - -``` - - -### CONFERENCE -```python -CONFERENCE = - -``` - - -### FULL_FEATURE -```python -FULL_FEATURE = - -``` - - -### LIVESTREAM -```python -LIVESTREAM = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.22.0/api/server-python/fishjam.md b/versioned_docs/version-0.22.0/api/server-python/fishjam.md deleted file mode 100644 index f0c4dcd2..00000000 --- a/versioned_docs/version-0.22.0/api/server-python/fishjam.md +++ /dev/null @@ -1,498 +0,0 @@ ---- -title: fishjam -sidebar_label: fishjam -custom_edit_url: null ---- - -# fishjam - - -## Submodules -- [events](submodules/events) -- [errors](submodules/errors) -- [room](submodules/room) -- [peer](submodules/peer) -- [agent](submodules/agent) - -## FishjamClient -```python -class FishjamClient(Client): -``` -Allows for managing rooms - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create a FishjamClient instance, providing the fishjam id and management token. - -### create_peer -```python -def create_peer( - self, - room_id: str, - options: PeerOptions | None = None -) -> tuple[Peer, str] -``` -Creates peer in the room - -Returns a tuple (`Peer`, `PeerToken`) - the token is needed by Peer -to authenticate to Fishjam. - -The possible options to pass for peer are `PeerOptions`. - -### create_agent -```python -def create_agent( - self, - room_id: str, - options: AgentOptions | None = None -) -``` - - -### create_room -```python -def create_room( - self, - options: RoomOptions | None = None -) -> Room -``` -Creates a new room -Returns the created `Room` - -### get_all_rooms -```python -def get_all_rooms(self) -> list[Room] -``` -Returns list of all rooms - -### get_room -```python -def get_room(self, room_id: str) -> Room -``` -Returns room with the given id - -### delete_peer -```python -def delete_peer(self, room_id: str, peer_id: str) -> None -``` -Deletes peer - -### delete_room -```python -def delete_room(self, room_id: str) -> None -``` -Deletes a room - -### refresh_peer_token -```python -def refresh_peer_token(self, room_id: str, peer_id: str) -> str -``` -Refreshes peer token - -### create_livestream_viewer_token -```python -def create_livestream_viewer_token(self, room_id: str) -> str -``` -Generates viewer token for livestream rooms - -### create_livestream_streamer_token -```python -def create_livestream_streamer_token(self, room_id: str) -> str -``` -Generates streamer token for livestream rooms - -### subscribe_peer -```python -def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str) -``` -Subscribe a peer to all tracks of another peer. - -### subscribe_tracks -```python -def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]) -``` -Subscribe a peer to specific tracks of another peer. - -#### Inherited Members -* **Client**: - * `client` ---- -## FishjamNotifier -```python -class FishjamNotifier: -``` -Allows for receiving WebSocket messages from Fishjam. - -### __init__ -```python -def __init__(fishjam_id: str, management_token: str) -``` -Create FishjamNotifier instance, providing the fishjam id and management token. - -### on_server_notification -```python -def on_server_notification( - self, - handler: Union[Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], NoneType], Callable[[Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated]], Coroutine[Any, Any, None]]] -) -``` -Decorator used for defining handler for Fishjam Notifications - -### connect -```python -def connect(self) -``` -A coroutine which connects FishjamNotifier to Fishjam and listens for -all incoming messages from the Fishjam. - -It runs until the connection isn't closed. - -The incoming messages are handled by the functions defined using the -`on_server_notification` decorator. - -The handler have to be defined before calling `connect`, -otherwise the messages won't be received. - -### wait_ready -```python -def wait_ready(self) -> None -``` -Waits until the notifier is connected and authenticated to Fishjam. - -If already connected, returns immediately. - ---- -## receive_binary -```python -def receive_binary( - binary: bytes -) -> Union[ServerMessageRoomCreated, ServerMessageRoomDeleted, ServerMessageRoomCrashed, ServerMessagePeerAdded, ServerMessagePeerDeleted, ServerMessagePeerConnected, ServerMessagePeerDisconnected, ServerMessagePeerMetadataUpdated, ServerMessagePeerCrashed, ServerMessageStreamConnected, ServerMessageStreamDisconnected, ServerMessageViewerConnected, ServerMessageViewerDisconnected, ServerMessageTrackAdded, ServerMessageTrackRemoved, ServerMessageTrackMetadataUpdated, NoneType] -``` -Transform received protobuf notification to adequate notification instance. -The available notifications are listed in `fishjam.events` module. - ---- -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerOptions -```python -class PeerOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - enable_simulcast: bool = True, - metadata: dict[str, typing.Any] | None = None, - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### enable_simulcast -```python -enable_simulcast: bool = True - -``` -Enables the peer to use simulcast - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Peer metadata - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` -Configuration of peer's subscribing policy - ---- -## RoomOptions -```python -class RoomOptions: -``` -Description of a room options - -### __init__ -```python -def __init__( - max_peers: int | None = None, - video_codec: Optional[Literal['h264', 'vp8']] = None, - webhook_url: str | None = None, - room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference', - public: bool = False -) -``` - - -### max_peers -```python -max_peers: int | None = None - -``` -Maximum amount of peers allowed into the room - -### video_codec -```python -video_codec: Optional[Literal['h264', 'vp8']] = None - -``` -Enforces video codec for each peer in the room - -### webhook_url -```python -webhook_url: str | None = None - -``` -URL where Fishjam notifications will be sent - -### room_type -```python -room_type: Literal['conference', 'audio_only', 'livestream', 'full_feature', 'broadcaster', 'audio_only_livestream'] = 'conference' - -``` -The use-case of the room. If not provided, this defaults to conference. - -### public -```python -public: bool = False - -``` -True if livestream viewers can omit specifying a token. - ---- -## AgentOptions -```python -class AgentOptions: -``` -Options specific to a WebRTC Peer - -### __init__ -```python -def __init__( - output: AgentOutputOptions = , - subscribe_mode: Literal['auto', 'manual'] = 'auto' -) -``` - - -### output -```python -output: AgentOutputOptions -``` - - -### subscribe_mode -```python -subscribe_mode: Literal['auto', 'manual'] = 'auto' - -``` - - ---- -## AgentOutputOptions -```python -class AgentOutputOptions: -``` -Options of the desired format of audio tracks going from Fishjam to the agent. - -### __init__ -```python -def __init__( - audio_format: Literal['pcm16'] = 'pcm16', - audio_sample_rate: Literal[16000, 24000] = 16000 -) -``` - - -### audio_format -```python -audio_format: Literal['pcm16'] = 'pcm16' - -``` - - -### audio_sample_rate -```python -audio_sample_rate: Literal[16000, 24000] = 16000 - -``` - - ---- -## Room -```python -class Room: -``` -Description of the room state - -### __init__ -```python -def __init__( - config: RoomConfig, - id: str, - peers: list[Peer] -) -``` - - -### config -```python -config: RoomConfig -``` -Room configuration - -### id -```python -id: str -``` -Room ID - -### peers -```python -peers: list[Peer] -``` -List of all peers - ---- -## Peer -```python -class Peer: -``` -Describes peer status - -Attributes: - id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. - metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. - status (PeerStatus): Informs about the peer status Example: disconnected. - subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy - subscriptions (Subscriptions): Describes peer's subscriptions in manual mode - tracks (list['Track']): List of all peer's tracks - type_ (PeerType): Peer type Example: webrtc. - -### __init__ -```python -def __init__( - id: str, - metadata: Optional[PeerMetadata], - status: PeerStatus, - subscribe_mode: SubscribeMode, - subscriptions: Subscriptions, - tracks: list[Track], - type_: PeerType -) -``` -Method generated by attrs for class Peer. - -### id -```python -id: str -``` - - -### metadata -```python -metadata: Optional[PeerMetadata] -``` - - -### status -```python -status: PeerStatus -``` - - -### subscribe_mode -```python -subscribe_mode: SubscribeMode -``` - - -### subscriptions -```python -subscriptions: Subscriptions -``` - - -### tracks -```python -tracks: list[Track] -``` - - -### type_ -```python -type_: PeerType -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- diff --git a/versioned_docs/version-0.22.0/api/server-python/submodules/agent.md b/versioned_docs/version-0.22.0/api/server-python/submodules/agent.md deleted file mode 100644 index 3fae055c..00000000 --- a/versioned_docs/version-0.22.0/api/server-python/submodules/agent.md +++ /dev/null @@ -1,237 +0,0 @@ ---- -title: agent -sidebar_label: agent -custom_edit_url: null ---- - -# agent - - - -## Agent -```python -class Agent: -``` -Allows for connecting to a Fishjam room as an agent peer. -Provides callbacks for receiving audio. - -### __init__ -```python -def __init__(id: str, room_id: str, token: str, fishjam_url: str) -``` -Create Agent instance, providing the fishjam id and management token. - -This constructor should not be called directly. -Instead, you should call :func:`fishjam.FishjamClient.create_agent`. - -### id -```python -id -``` - - -### room_id -```python -room_id -``` - - -### connect -```python -def connect(self) -``` -Connect the agent to Fishjam to start receiving messages. - -Incoming messages from Fishjam will be routed to handlers -defined with :func:`on_track_data`. - -:raises AgentAuthError: authentication failed - ---- -## AgentError -```python -class AgentError(Exception): -``` -Base exception class for all agent exceptions - ---- -## AgentSession -```python -class AgentSession: -``` - - -### __init__ -```python -def __init__( - agent: fishjam.agent.agent.Agent, - websocket: websockets.asyncio.client.ClientConnection -) -``` - - -### agent -```python -agent -``` - - -### receive -```python -def receive( - self -) -> AsyncIterator[AgentResponseTrackData] -``` -Returns an infinite async iterator over the incoming messages from Fishjam to -the agent. - -### add_track -```python -def add_track(self, options: fishjam.agent.agent.OutgoingAudioTrackOptions) -``` -Adds a track to the connected agent, with the specified options and metadata. - -Returns an instance of :class:`OutgoingTrack`, which can be used to send data -over the added track. - -### disconnect -```python -def disconnect(self) -``` -Ends the agent session by closing the websocket connection. -Useful when you don't use the context manager to obtain the session. - ---- -## AgentAuthError -```python -class AgentAuthError(fishjam.agent.errors.AgentError): -``` -Agent failed to authenticate properly - -### __init__ -```python -def __init__(reason: str) -``` - - -### reason -```python -reason -``` - - ---- -## IncomingTrackData -```python -IncomingTrackData = - -``` - - ---- -## OutgoingTrack -```python -class OutgoingTrack: -``` -Represents an outgoing track of an agent connected to Fishjam, -created by :func:`Agent.add_track`. - -### __init__ -```python -def __init__( - id: str, - session: fishjam.agent.agent.AgentSession, - options: fishjam.agent.agent.OutgoingAudioTrackOptions -) -``` - - -### id -```python -id: str -``` -The global identifier of the track. - -### session -```python -session: fishjam.agent.agent.AgentSession -``` -The agent the track belongs to. - -### options -```python -options: fishjam.agent.agent.OutgoingAudioTrackOptions -``` -The parameters used to create the track. - -### send_chunk -```python -def send_chunk(self, data: bytes) -``` -Send a chunk of audio to Fishjam on this track. - -Peers connected to the room of the agent will receive this data. - -### interrupt -```python -def interrupt(self) -``` -Interrupt current track. - -Any audio that has been sent, but not played -will be cleared and be prevented from playing. - -Audio sent after the interrupt will be played normally. - ---- -## OutgoingAudioTrackOptions -```python -class OutgoingAudioTrackOptions: -``` -Parameters of an outgoing audio track. - -### __init__ -```python -def __init__( - encoding: TrackEncoding = , - sample_rate: Literal[16000, 24000] = 16000, - channels: Literal[1, 2] = 1, - metadata: dict[str, typing.Any] | None = None -) -``` - - -### encoding -```python -encoding: TrackEncoding = - -``` -The encoding of the audio source. -Defaults to raw 16-bit PCM. - -### sample_rate -```python -sample_rate: Literal[16000, 24000] = 16000 - -``` -The sample rate of the audio source. -Defaults to 16000. - -### channels -```python -channels: Literal[1, 2] = 1 - -``` -The number of channels in the audio source. -Supported values are 1 (mono) and 2 (stereo). -Defaults to 1 (mono) - -### metadata -```python -metadata: dict[str, typing.Any] | None = None - -``` -Custom metadata for the track. -Must be JSON-encodable. - ---- diff --git a/versioned_docs/version-0.22.0/api/server-python/submodules/errors.md b/versioned_docs/version-0.22.0/api/server-python/submodules/errors.md deleted file mode 100644 index 41f7cc57..00000000 --- a/versioned_docs/version-0.22.0/api/server-python/submodules/errors.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: errors -sidebar_label: errors -custom_edit_url: null ---- - -# errors - - - -## HTTPError -```python -class HTTPError(Exception): -``` - - ---- -## BadRequestError -```python -class BadRequestError(HTTPError): -``` - - ---- -## UnauthorizedError -```python -class UnauthorizedError(HTTPError): -``` - - ---- -## NotFoundError -```python -class NotFoundError(HTTPError): -``` - - ---- -## ServiceUnavailableError -```python -class ServiceUnavailableError(HTTPError): -``` - - ---- -## InternalServerError -```python -class InternalServerError(HTTPError): -``` - - ---- -## ConflictError -```python -class ConflictError(HTTPError): -``` - - ---- diff --git a/versioned_docs/version-0.22.0/api/server-python/submodules/events.md b/versioned_docs/version-0.22.0/api/server-python/submodules/events.md deleted file mode 100644 index b36fd45a..00000000 --- a/versioned_docs/version-0.22.0/api/server-python/submodules/events.md +++ /dev/null @@ -1,863 +0,0 @@ ---- -title: events -sidebar_label: events -custom_edit_url: null ---- - -# events - - - -## ServerMessageRoomCreated -```python -class ServerMessageRoomCreated(betterproto.Message): -``` -Notification sent when a room is created - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomDeleted -```python -class ServerMessageRoomDeleted(betterproto.Message): -``` -Notification sent when a room is deleted - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageRoomCrashed -```python -class ServerMessageRoomCrashed(betterproto.Message): -``` -Notification sent when a room crashes - -### __init__ -```python -def __init__(room_id: str = ) -``` - - -### room_id -```python -room_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerAdded -```python -class ServerMessagePeerAdded(betterproto.Message): -``` -Notification sent when a peer is added - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerConnected -```python -class ServerMessagePeerConnected(betterproto.Message): -``` -Notification sent when a peer connects - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDeleted -```python -class ServerMessagePeerDeleted(betterproto.Message): -``` -Notification sent when a peer is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerDisconnected -```python -class ServerMessagePeerDisconnected(betterproto.Message): -``` -Notification sent when a peer disconnects from FJ - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerMetadataUpdated -```python -class ServerMessagePeerMetadataUpdated(betterproto.Message): -``` -Notification sent when peer updates its metadata - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - metadata: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### metadata -```python -metadata: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessagePeerCrashed -```python -class ServerMessagePeerCrashed(betterproto.Message): -``` -Notification sent when a peer crashes - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - reason: str = , - peer_type: ServerMessagePeerType = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### reason -```python -reason: str -``` - - -### peer_type -```python -peer_type: ServerMessagePeerType -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamConnected -```python -class ServerMessageStreamConnected(betterproto.Message): -``` -Notification sent when streamer successfully connects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageStreamDisconnected -```python -class ServerMessageStreamDisconnected(betterproto.Message): -``` -Notification sent when streamer disconnects - -### __init__ -```python -def __init__(stream_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackAdded -```python -class ServerMessageTrackAdded(betterproto.Message): -``` -Notification sent when peer or component adds new track - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackMetadataUpdated -```python -class ServerMessageTrackMetadataUpdated(betterproto.Message): -``` -Notification sent when metadata of a multimedia track is updated - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageTrackRemoved -```python -class ServerMessageTrackRemoved(betterproto.Message): -``` -Notification sent when a track is removed - -### __init__ -```python -def __init__( - room_id: str = , - peer_id: str = , - component_id: str = , - track: Track = -) -``` - - -### room_id -```python -room_id: str -``` - - -### peer_id -```python -peer_id: str -``` - - -### component_id -```python -component_id: str -``` - - -### track -```python -track: Track -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerConnected -```python -class ServerMessageViewerConnected(betterproto.Message): -``` -Notification sent when viewer successfully connects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## ServerMessageViewerDisconnected -```python -class ServerMessageViewerDisconnected(betterproto.Message): -``` -Notification sent when viewer disconnects - -### __init__ -```python -def __init__(stream_id: str = , viewer_id: str = ) -``` - - -### stream_id -```python -stream_id: str -``` - - -### viewer_id -```python -viewer_id: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## Track -```python -class Track(betterproto.Message): -``` -Describes a media track - -### __init__ -```python -def __init__( - id: str = , - type: TrackType = , - metadata: str = -) -``` - - -### id -```python -id: str -``` - - -### type -```python -type: TrackType -``` - - -### metadata -```python -metadata: str -``` - - -#### Inherited Members -* **Message**: - * `SerializeToString` - * `parse` - * `FromString` - * `to_dict` - * `from_dict` - * `to_json` - * `from_json` - * `to_pydict` - * `from_pydict` - * `is_set` ---- -## TrackEncoding -```python -class TrackEncoding(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### TRACK_ENCODING_UNSPECIFIED -```python -TRACK_ENCODING_UNSPECIFIED = - -``` - - -### TRACK_ENCODING_PCM16 -```python -TRACK_ENCODING_PCM16 = - -``` - - -### TRACK_ENCODING_OPUS -```python -TRACK_ENCODING_OPUS = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## TrackType -```python -class TrackType(betterproto.Enum): -``` -Defines types of tracks being published by peers and component - -### TRACK_TYPE_UNSPECIFIED -```python -TRACK_TYPE_UNSPECIFIED = - -``` - - -### TRACK_TYPE_VIDEO -```python -TRACK_TYPE_VIDEO = - -``` - - -### TRACK_TYPE_AUDIO -```python -TRACK_TYPE_AUDIO = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- -## ServerMessagePeerType -```python -class ServerMessagePeerType(betterproto.Enum): -``` -The base class for protobuf enumerations, all generated enumerations will inherit -from this. Bases :class:`enum.IntEnum`. - -### PEER_TYPE_UNSPECIFIED -```python -PEER_TYPE_UNSPECIFIED = - -``` - - -### PEER_TYPE_WEBRTC -```python -PEER_TYPE_WEBRTC = - -``` - - -### PEER_TYPE_AGENT -```python -PEER_TYPE_AGENT = - -``` - - -#### Inherited Members -* **Enum**: - * `from_string` - - - - - -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.22.0/api/server-python/submodules/peer.md b/versioned_docs/version-0.22.0/api/server-python/submodules/peer.md deleted file mode 100644 index c1bfb405..00000000 --- a/versioned_docs/version-0.22.0/api/server-python/submodules/peer.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: peer -sidebar_label: peer -custom_edit_url: null ---- - -# peer - - - -## PeerMetadata -```python -class PeerMetadata: -``` -Custom metadata set by the peer - -Example: - \{'name': 'FishjamUser'\} - -### __init__ -```python -def __init__() -``` -Method generated by attrs for class PeerMetadata. - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## PeerStatus -```python -class PeerStatus(str, enum.Enum): -``` -Informs about the peer status - -### CONNECTED -```python -CONNECTED = - -``` - - -### DISCONNECTED -```python -DISCONNECTED = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## PeerType -```python -class PeerType(str, enum.Enum): -``` -Peer type - -### AGENT -```python -AGENT = - -``` - - -### WEBRTC -```python -WEBRTC = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.22.0/api/server-python/submodules/room.md b/versioned_docs/version-0.22.0/api/server-python/submodules/room.md deleted file mode 100644 index 6459e895..00000000 --- a/versioned_docs/version-0.22.0/api/server-python/submodules/room.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: room -sidebar_label: room -custom_edit_url: null ---- - -# room - - - -## RoomConfig -```python -class RoomConfig: -``` -Room configuration - -Attributes: - max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. - public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. - room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to - conference. Default: RoomConfigRoomType.CONFERENCE. - video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: - RoomConfigVideoCodec.H264. - webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: - https://backend.address.com/fishjam-notifications-endpoint. - -### __init__ -```python -def __init__( - max_peers: Union[NoneType, Unset, int] = , - public: Union[Unset, bool] = False, - room_type: Union[Unset, RoomConfigRoomType] = , - video_codec: Union[Unset, RoomConfigVideoCodec] = , - webhook_url: Union[NoneType, Unset, str] = -) -``` -Method generated by attrs for class RoomConfig. - -### max_peers -```python -max_peers: Union[NoneType, Unset, int] -``` - - -### public -```python -public: Union[Unset, bool] -``` - - -### room_type -```python -room_type: Union[Unset, RoomConfigRoomType] -``` - - -### video_codec -```python -video_codec: Union[Unset, RoomConfigVideoCodec] -``` - - -### webhook_url -```python -webhook_url: Union[NoneType, Unset, str] -``` - - -### additional_properties -```python -additional_properties: dict[str, typing.Any] -``` - - -### to_dict -```python -def to_dict(self) -> dict[str, typing.Any] -``` - - -### from_dict -```python -def from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T -``` - - -### additional_keys -```python -additional_keys: list[str] -``` - - ---- -## RoomConfigVideoCodec -```python -class RoomConfigVideoCodec(str, enum.Enum): -``` -Enforces video codec for each peer in the room - -### H264 -```python -H264 = - -``` - - -### VP8 -```python -VP8 = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- -## RoomConfigRoomType -```python -class RoomConfigRoomType(str, enum.Enum): -``` -The use-case of the room. If not provided, this defaults to conference. - -### AUDIO_ONLY -```python -AUDIO_ONLY = - -``` - - -### AUDIO_ONLY_LIVESTREAM -```python -AUDIO_ONLY_LIVESTREAM = - -``` - - -### BROADCASTER -```python -BROADCASTER = - -``` - - -### CONFERENCE -```python -CONFERENCE = - -``` - - -### FULL_FEATURE -```python -FULL_FEATURE = - -``` - - -### LIVESTREAM -```python -LIVESTREAM = - -``` - - -#### Inherited Members -* **Enum**: - * `name` - * `value` ---- diff --git a/versioned_docs/version-0.23.0/api/server-python/fishjam.md b/versioned_docs/version-0.23.0/api/server-python/fishjam.md index f0c4dcd2..98c39ed1 100644 --- a/versioned_docs/version-0.23.0/api/server-python/fishjam.md +++ b/versioned_docs/version-0.23.0/api/server-python/fishjam.md @@ -181,7 +181,7 @@ class PeerMetadata: Custom metadata set by the peer Example: - \{'name': 'FishjamUser'\} +- \{'name': 'FishjamUser'\} ### __init__ ```python @@ -407,13 +407,13 @@ class Peer: Describes peer status Attributes: - id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. - metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. - status (PeerStatus): Informs about the peer status Example: disconnected. - subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy - subscriptions (Subscriptions): Describes peer's subscriptions in manual mode - tracks (list['Track']): List of all peer's tracks - type_ (PeerType): Peer type Example: webrtc. +- id (str): Assigned peer id Example: 4a1c1164-5fb7-425d-89d7-24cdb8fff1cf. +- metadata (Union['PeerMetadata', None]): Custom metadata set by the peer Example: \{'name': 'FishjamUser'\}. +- status (PeerStatus): Informs about the peer status Example: disconnected. +- subscribe_mode (SubscribeMode): Configuration of peer's subscribing policy +- subscriptions (Subscriptions): Describes peer's subscriptions in manual mode +- tracks (list['Track']): List of all peer's tracks +- type_ (PeerType): Peer type Example: webrtc. ### __init__ ```python diff --git a/versioned_docs/version-0.23.0/api/server-python/submodules/peer.md b/versioned_docs/version-0.23.0/api/server-python/submodules/peer.md index c1bfb405..01c7c474 100644 --- a/versioned_docs/version-0.23.0/api/server-python/submodules/peer.md +++ b/versioned_docs/version-0.23.0/api/server-python/submodules/peer.md @@ -15,7 +15,7 @@ class PeerMetadata: Custom metadata set by the peer Example: - \{'name': 'FishjamUser'\} +- \{'name': 'FishjamUser'\} ### __init__ ```python diff --git a/versioned_docs/version-0.23.0/api/server-python/submodules/room.md b/versioned_docs/version-0.23.0/api/server-python/submodules/room.md index 6459e895..de5f7f91 100644 --- a/versioned_docs/version-0.23.0/api/server-python/submodules/room.md +++ b/versioned_docs/version-0.23.0/api/server-python/submodules/room.md @@ -15,14 +15,14 @@ class RoomConfig: Room configuration Attributes: - max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. - public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. - room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to - conference. Default: RoomConfigRoomType.CONFERENCE. - video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: - RoomConfigVideoCodec.H264. - webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: - https://backend.address.com/fishjam-notifications-endpoint. +- max_peers (Union[None, Unset, int]): Maximum amount of peers allowed into the room Example: 10. +- public (Union[Unset, bool]): True if livestream viewers can omit specifying a token. Default: False. +- room_type (Union[Unset, RoomConfigRoomType]): The use-case of the room. If not provided, this defaults to + conference. Default: RoomConfigRoomType.CONFERENCE. +- video_codec (Union[Unset, RoomConfigVideoCodec]): Enforces video codec for each peer in the room Default: + RoomConfigVideoCodec.H264. +- webhook_url (Union[None, Unset, str]): URL where Fishjam notifications will be sent Example: + https://backend.address.com/fishjam-notifications-endpoint. ### __init__ ```python