Nearglass

The public waiting room (a page, publishable key)

For streams with `admission: public`. A waiting page calls it every 2 s with its `seat`; when offered a seat (state `offer`, 10 s), the viewer presses Join and the page calls with `join: true`. Rate limited per client address (a burst of 20, then 2 a second). Any origin may call it (CORS).

POST
/v1/play/{id}/admit

For streams with admission: public. A waiting page calls it every 2 s with its seat; when offered a seat (state offer, 10 s), the viewer presses Join and the page calls with join: true. Rate limited per client address (a burst of 20, then 2 a second). Any origin may call it (CORS).

Authorization

publishableKey
headerAuthorizationBearer <token>

pk_...

Path Parameters

id*string

Request Body

application/json
  1. body
seat?SeatId
Match^se_[0-9a-f]{32}$
join?boolean
Defaultfalse
ttl?integer
Range1 <= value <= 3600
viewer_ref?string

accepted and ignored: a public seat is anonymous (its relay subject is seat:)

Response Body

not seated (yet)

application/json
  1. response
state?string
Value in"wait""offer""full"
seat?SeatId
Match^se_[0-9a-f]{32}$
position?integer

wait: place in line, from 1

offer_s?integer

offer: seconds left to join

retry_s?integer

full: seconds before asking again

retry_after_ms?integer
play_url?string

as in Seated: {play_url}/leave gives the place in line up at once

Example Request
curl -X POST 'https://api.nearglass.com/v1/play/st_8f2c41d09a7be3105c6e2d77/admit' \  -H 'Content-Type: application/json' \  -d '{  "join": true}'
Example Response
{  "state": "wait",  "seat": "string",  "position": 0,  "offer_s": 0,  "retry_s": 0,  "retry_after_ms": 0,  "play_url": "string"}