A driver's turn (interactive streams)
The viewer's rights plus publish on `control/<namespace>/<turn_id>`. Token id `turn:<turn_id>`, subject `driver:<driver_ref>`. Your backend runs the queue of drivers; the device's Gate ends the turn at its own deadline.
The viewer's rights plus publish on control/<namespace>/<turn_id>.
Token id turn:<turn_id>, subject driver:<driver_ref>. Your backend runs the
queue of drivers; the device's Gate ends the turn at its own deadline.
secretKeyAuthorizationBearer <token>sk_...
id*stringapplication/json- body
turn_id*stringprintable, no '/' or spaces
length <= 59driver_ref?stringdefault driver
ttl?integerthe turn plus a few seconds
1 <= value <= 360065minted
application/json- response
A token and where to use it; the player and the SDK publisher take it whole.
token?stringthe CAT, base64url without padding; CLIENT_SETUP AUTHORIZATION TOKEN type 1
token_id?|the CWT cti: s-... (viewer), pub-... (SDK publisher asked with token_id), ing-... (gateway), turn: (controller); null for a device publisher token
expires_at?stringdate-timeexp?integerUnix seconds
relays?array<>namespace?stringcatalog?stringrelay_cert_sha256?stringonly for a relay with a self-signed certificate
hls?stringthe LL-HLS playlist for the player fallback; with the API edge, /v1/play/{id}/hls/index.m3u8 and only for streams with encoder ingest
turn_id?stringcontrol_namespace?stringcurl -X POST 'https://api.nearglass.com/v1/streams/st_8f2c41d09a7be3105c6e2d77/controller-tokens' \ -H 'Content-Type: application/json' \ -d '{ "turn_id": "t1", "driver_ref": "user-4821", "ttl": 65}'{ "token": "string", "token_id": "string", "expires_at": "2019-08-24T14:15:22Z", "exp": 0, "relays": [ { "url": "string" } ], "namespace": "string", "catalog": "string", "relay_cert_sha256": "string", "hls": "string", "turn_id": "string", "control_namespace": "string"}A seat and its viewer token (server admission), or a place in line POST
Call it from your backend after your own login. Without `seat`, a new seat id is made; while the viewer waits, call again with the `seat` from the last answer every `retry_after_ms`. A seat is kept by the player's heartbeat (`/v1/play/{id}/hb`): 20 s without one (60 s for a hidden tab) and the seat is lost and its relay sessions closed.
End a turn DELETE
Closes the turn's control session at the relay (admin close of turn:<turn_id>).