Dynamic Real-Time Identification & Session Control (DRISC) is a session management mechanism that will allow our broadcasters to define and control the number of simultaneous sessions allowed per offer for a given user. DRISC integration is largely based on APIs which allow easy integration with any client application which supports basic protocols.
In order to achieve that consumer application needs to maintain Websocket connection which allows bidirectional data flow between the application and DRISC. DRISC uses it to exchange messages to ensure all sessions are alive as well as communicate events like Message - TAKE_OVER.
For fully functional integration it is crucial to:
- Allow content stream / playback only when connection is established and server responded with Message - OK
- Respond to server Message - PING with the Message - PONG to ensure DRISC can keep track of disconnected sessions.
All modern technologies should support Websockets and HTTP, it’s up to you to choose the library or native API of your technology. For documentation purposes, we are going to focus on native APIs from Web browser but this should be easily achieved with popular libraries, for example, Axios, etc.
Before we start the integration, please make sure you have the following technical requirements ready:
- Websockets client
- HTTP client
- (Optional) Offline persistence layer. For example Web Storage API
All requests are being authorized with the Authorization header, using the Bearer token which is JWTJWT - JWT (JSON Web Token) - open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. In Cleeng, JWT payload contains: customerId, publisherId, expiration date. JWT is valid for 15 minutes and after that time a refresh token mechanism can be used.. Refer here to know more about JWT token generation and refresh token.
DRISC can be used with the following use cases:
This use case covers only the session control mechanism. Following this will help you to create and end the sessions for the end-user.
This use case covers the takeover functionality. This will help the end-user to take over the other concurrent active sessions at a given time.
This use case covers how to handle DRISC, when the integration is completed, but for some reason, you want to keep DRISC disabled.
To have the session control mechanism work properly, the number of sessions allowed per offer has to be properly defined. So the DRISC server can use
sessionLimit set per offer to control the session pool for a given customer. At the moment, this functionality is not available out of the box. Hence reach out to your AM to have this configured properly.
Also, you should enable the DRISC functionality in the Cleeng dashboard to complete the DRISC setup. You can find the DRISC settings in the Admin section of the Cleeng dashboard. Without DRISC enabled in the dashboard, you will get a 200 "DRISC Disabled" error while trying to create a new session.
Now you have read and understood the prerequisites to build a frictionless session control mechanism for your application. Continue reading further the Configure Session control article to start the integration.
Updated 5 days ago