mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-05-26 07:08:11 +00:00
refactor: remove redundant code comments from datachannel POC scripts
This commit is contained in:
@@ -129,7 +129,6 @@ async def _create_peer(name: str, room: dict, session: aiohttp.ClientSession, is
|
||||
p_ice_sub.clear()
|
||||
await asyncio.sleep(0.3)
|
||||
|
||||
# pub
|
||||
peer["pc_pub"] = RTCPeerConnection(configuration=RTCConfiguration(iceServers=ice_servers, bundlePolicy=RTCBundlePolicy.MAX_BUNDLE))
|
||||
peer["pc_pub"].addTrack(AudioStreamTrack())
|
||||
peer["dc"] = peer["pc_pub"].createDataChannel("_reliable", ordered=True)
|
||||
|
||||
@@ -25,7 +25,6 @@ def _get_room_token(room_id: str, display_name: str) -> tuple[str, str]:
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
# 1. Guest Registration
|
||||
reg_req = requests.post(
|
||||
f"{API_BASE}/auth/api/v1/auth/user/guest-register",
|
||||
json={"displayName": display_name, "device": {"deviceName": "Linux", "deviceType": "PARTICIPANT_DEVICE_TYPE_WEB_DESKTOP"}},
|
||||
@@ -34,13 +33,11 @@ def _get_room_token(room_id: str, display_name: str) -> tuple[str, str]:
|
||||
reg_req.raise_for_status()
|
||||
headers["Authorization"] = f"Bearer {reg_req.json()['accessToken']}"
|
||||
|
||||
# 2. Room Creation (if empty)
|
||||
if not room_id:
|
||||
room_req = requests.post(f"{API_BASE}/api-room/api/v2/room", json={"roomType": "ROOM_TYPE_ALL_ON_SCREEN", "roomPrivacy": "ROOM_PRIVACY_FREE"}, headers=headers)
|
||||
room_req.raise_for_status()
|
||||
room_id = room_req.json()["roomId"]
|
||||
|
||||
# 3. Join & Token
|
||||
requests.post(f"{API_BASE}/api-room/api/v1/room/{room_id}/join", json={}, headers=headers).raise_for_status()
|
||||
tok_req = requests.get(f"{API_BASE}/api-room-manager/api/v1/room/{room_id}/token", params={"deviceType": "PARTICIPANT_DEVICE_TYPE_WEB_DESKTOP", "displayName": display_name}, headers=headers)
|
||||
tok_req.raise_for_status()
|
||||
|
||||
Reference in New Issue
Block a user