Skip to content

Commit 8fc6755

Browse files
committed
comment suggestions
1 parent 70ff535 commit 8fc6755

File tree

9 files changed

+24
-23
lines changed

9 files changed

+24
-23
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Your Fishjam envs, which you can get at https://fishjam.io/app
2+
FISHJAM_ID="your-fishjam-id"
3+
FISHJAM_MANAGEMENT_TOKEN="your-management-token"

examples/selective_subscription/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@ Demo application showing selective subscription functionality with [Fishjam](htt
88
- [uv](https://docs.astral.sh/uv/) package manager
99
- Fishjam credentials ([get them here](https://fishjam.io/app))
1010

11+
> [!IMPORTANT]
12+
> All commands should be run from the `examples/selective_subscription` directory
13+
1114
## Quick Start
1215

1316
1. Install dependencies (in the `examples/selective_subscription` directory):
1417
```bash
15-
cd examples/selective_subscription
1618
uv sync
1719
```
1820

21+
To run the app, first copy [`.env.example`](./.env.example) to `.env` and populate your environment variables.
22+
23+
Once you have populated `.env`, you can run the demo with
24+
1925
2. Run the server:
2026
```bash
21-
FISHJAM_ID=<your-id> \
22-
FISHJAM_MANAGEMENT_TOKEN=<your-token> \
23-
uv run main.py
27+
uv run ./main.py
2428
```
2529

2630
3. Open http://localhost:8000 in your browser

examples/selective_subscription/pyproject.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ dependencies = [
88
"starlette>=0.35.0",
99
"uvicorn>=0.25.0",
1010
"fishjam-server-sdk",
11+
"python-dotenv",
1112
]
1213

1314
[tool.uv.sources]
14-
fishjam-server-sdk = { workspace = true }
15-
16-
[build-system]
17-
requires = ["hatchling"]
18-
build-backend = "hatchling.build"
19-
20-
[tool.hatch.build.targets.wheel]
21-
packages = ["selective_subscription"]
15+
fishjam-server-sdk = { workspace = true }

examples/selective_subscription/selective_subscription/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def subscribe_peer(request: Request) -> Response:
5252
{"error": "peer_id and target_peer_id are required"}, status_code=400
5353
)
5454

55-
room_service.subscibe_peer(peer_id, target_peer_id)
55+
room_service.subscribe_peer(peer_id, target_peer_id)
5656
return JSONResponse({"status": "subscribed"})
5757
except Exception as e:
5858
return JSONResponse({"error": str(e)}, status_code=500)

examples/selective_subscription/selective_subscription/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import os
22

3+
import dotenv
4+
5+
dotenv.load_dotenv()
6+
37
FISHJAM_ID = os.environ["FISHJAM_ID"]
48
FISHJAM_TOKEN = os.environ["FISHJAM_MANAGEMENT_TOKEN"]
59
HOST = os.getenv("HOST", "localhost")

examples/selective_subscription/selective_subscription/room_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def create_peer(self) -> tuple[Peer, str]:
2929
peer, token = self.fishjam.create_peer(room.id, options)
3030
return peer, token
3131

32-
def subscibe_peer(self, peer_id: str, target_peer_id: str):
32+
def subscribe_peer(self, peer_id: str, target_peer_id: str):
3333
room = self.get_or_create_room()
3434
self.fishjam.subscribe_peer(room.id, peer_id, target_peer_id)
3535

fishjam/api/_fishjam_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def create_livestream_streamer_token(self, room_id: str) -> str:
264264
return response.token
265265

266266
def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str):
267-
"" "Subscribe a peer to all tracks of another peer." ""
267+
"""Subscribe a peer to all tracks of another peer."""
268268

269269
self._request(
270270
room_subscribe_peer,
@@ -274,7 +274,7 @@ def subscribe_peer(self, room_id: str, peer_id: str, target_peer_id: str):
274274
)
275275

276276
def subscribe_tracks(self, room_id: str, peer_id: str, track_ids: list[str]):
277-
"" "Subscribe a peer to specific tracks of another peer." ""
277+
"""Subscribe a peer to specific tracks of another peer."""
278278

279279
self._request(
280280
room_subscribe_tracks,

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ dependencies = [
1515
"httpx>=0.28.0,<0.29.0",
1616
"attrs>=21.3.0",
1717
"flask-cors>=6.0.1,<7",
18-
"uvicorn>=0.35.0",
19-
"starlette>=0.46.2",
2018
]
2119

2220
[project.urls]

uv.lock

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)