The following shows how to use the video player with your site. The instructions can be used below to generate your own embed links to the Rali Video Player.
Conversational Video Player
The player is located at the following url:
https://rali.io/player/src
There are a few minimum http parameters that are needed for the embedded player:
URL Params | Description |
api-key | API Key, provided by Rali. See Getting Started |
url | Video URL that needs to be URL encoded |
user | Authenticated user object, this is required if allow-anonymous is not set to true. See User Object for formatting. |
Example `src` attribute for an iframe using the player:
https://rali.io/player/src?api-key=334389048b872a533002b34d73f8c29fd09efc50&url=http://site-with-videos.herokuapp.com/bushes.mp4
See iFrame Format
Secured Video Player
The secured video allows for signing the data passed to the video player. The player is located at the following url:
https://rali.io/player/src
There are a few minimum http parameters that are needed for the embedded player
URL Params | Description |
api-key | API Key, provided by Rali. See Getting Started |
url | Video URL that needs to be URL encoded |
data | Encrypted JWT data |
Example `src` attribute for an iframe using the player:
https://rali.io/player/src?api-key=334389048b872a533002b34d73f8c29fd09efc50&url=http://site-with-videos.herokuapp.com/bushes.mp4&data=JTdCJTIyaWQlMjIlM0ElMjJ4eHgteXl5LXp6eiUyMiUyQyUyMmRpc3BsYXlOYW1lJTIyJTNBJTIyTXIuJTIwQWRhbXMlMjIlMkMlMjJpbWFnZSUyMiUzQSUyMmh0dHBzJTNBJTJGJTJGY2RuLmZpbGVzdGFja2NvbnRlbnQuY29tJTJGU2RZY0dJZ0JRb0s1T29pamJ3YjUlMjIlN0Q=
See iFrame Format
In order to generate the JWT data, the following Rali values must be used:
API Key – ex. ONQ-XXXXXXXXXXXXXXXX
API Secret – ex. xxxxxxxxxxxxxxxxxxxxxxxxxxx
The API key and secret can be found in the Admin section of the Rali tenant. See Getting Started
JWT Format
Attribute | Description | Required | Example |
iss | Issuer, this is the site that is issuing the token | Yes | https://yoursite.com |
sub | Subject, Logged in user | Yes | user@yoursite.com |
exp | Expiration, Time token will expire (minimum 10 mins) | Yes | 1356999524 |
iat | Issued at time, Time token was created | Yes | 1356999524 |
aud | Audience, Rali tenant url | Yes | https://rali.io |
key | Rali tenant Client API Key | Yes | ONQ-XXXXXXXXXXX |
user | Base64 encoded user object | Yes | See User Object for formatting |
referrer | Url where the link is rendered | Yes | https://yoursite.com/page1 |
Sample Code
PHP:
$secret = "xxxxxxxxxxxxxxxxxx"; // API Secret $token = array( "iss" => "https://yoursite.com", "aud" => https://rali.io, "sub" => "engageoq.can@yoursite.com", "iat" => 1356999524, "exp" => 1356999524, "user" => $user, "referrer" => window.location, ); $data = JWT::encode($token, $secret);