...
Note |
---|
The user should not be able to manipulate their playback session count themselves; You should not provide the user with a direct means to access the API but rather call it as a side-effect of other user initiated actions. |
Creating a new session
The client should retrieve an index of the current sessions so that it is able to tell the user whether she can start a new stream or not.
If the client has reached their maximum number of sessions then the frontend should not allow the user to play media.
When the user starts playing media the client should POST to the endpoint detailed above to create a new session.
When the client calls the API to create a new session the server will check the number of sessions that already exist.
If the account is not allowed to play another stream then the API will respond with a "403 Forbidden" error, with a body as below:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{
"id": 56071904,
"code": "df1e80a",
"title": "Too many sessions",
"details": "You have tried to open a new playback session but you are already at the maximum allowable limit. You need to stop playing content on another device in order to watch on this one."
} |
Periodical PATCH calls to the session
...