Typed Janus and DataChannel client for the Janus TextRoom plugin
Project description
janus-textroom-plugin
Typed bindings for janus.plugin.textroom, packaged independently from
janus-api-core and other named plugins.
TextRoom has two intentionally separate protocols:
- Janus plugin messages establish/restart the data-only PeerConnection and
perform synchronous room administration using a
requestfield. - Chat participation travels as UTF-8 JSON over a DataChannel using a
textroomfield and a mandatory transaction.
from janus_api.models.base import Jsep
from janus_textroom_plugin import TextRoomPlugin
textroom = TextRoomPlugin(session=session)
await textroom.attach()
offer = await textroom.setup()
# Apply offer.jsep in the WebRTC implementation, create the data channel,
# then return the local answer.
await textroom.ack(Jsep(type="answer", sdp=answer_sdp))
textroom.bind_datachannel(channel)
await textroom.join(1234, "alice", display="Alice")
await textroom.message(1234, "Hello everyone")
Room administration is deliberately independent of the WebRTC transport:
await textroom.create_room(
room=1234,
description="Support",
secret="room-admin-secret",
history=50,
)
rooms = await textroom.list_rooms()
participants = await textroom.list_participants(1234)
DataChannelLike is a small adapter protocol (ready_state plus send).
Incoming channel payloads must be handed to feed_datachannel(). The
transaction manager bounds pending requests, event backlog, and payload size;
it applies per-request timeouts and deterministically fails pending futures
when closed or cancelled. It does not close the application's underlying
WebRTC transport. Feed each incoming UTF-8 frame back to
textroom.feed_datachannel(payload) on the channel's owning event loop.
Room list/create/edit/destroy/exists/ACL queries use Janus messages. Join, message, announcement, leave, and kick use the DataChannel and can never be accidentally serialized into the Janus plugin body.
All operations accept a per-call timeout. Applications should call
await textroom.aclose() during shutdown so outstanding transaction waiters
are failed deterministically before the Janus handle is detached.
See the official TextRoom API.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file janus_textroom_plugin-3.0.0.tar.gz.
File metadata
- Download URL: janus_textroom_plugin-3.0.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8856899294be3563ff838fcbcbfdd698418c2971adb197c0f078447a13ac027c
|
|
| MD5 |
fa1775759155ebbd149c34b630b30df6
|
|
| BLAKE2b-256 |
4997acf0140e7182314b7d6efc112ee9ea8ee267ef4ae0ed153be89bfc724b69
|
File details
Details for the file janus_textroom_plugin-3.0.0-py3-none-any.whl.
File metadata
- Download URL: janus_textroom_plugin-3.0.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea2592cbf1b5d59a9353292635bf8e96db5e21386fa6c1659880729252994290
|
|
| MD5 |
622f05be1355a3acab6b09c51488a0ac
|
|
| BLAKE2b-256 |
33b104cd44ad3649592337fea84552d28eec26d071281ad3f10671612ae46f2e
|